fix(nc-gui): Cannot read properties of undefined (reading 'abbreviation')

This commit is contained in:
Ramesh Mane
2025-09-10 08:19:28 +00:00
parent 47f4263419
commit 43b2e397e5
2 changed files with 11 additions and 4 deletions

View File

@@ -70,7 +70,13 @@ export function parseFlexibleDate(dateString: string) {
const timezones = getTimeZones({ includeUtc: true })
export function getTimeZoneFromName(name: string = Intl.DateTimeFormat().resolvedOptions().timeZone) {
return timezones.find((k) => isSameTimezone(k.name, name))
const timezone = timezones.find((k) => isSameTimezone(k.name, name))
if (timezone) return timezone
console.log('Timezone not found', name)
return timezones.find((k) => k.group.includes(name))
}
export function withTimezone(timezone?: string) {