14 lines
536 B
TypeScript
14 lines
536 B
TypeScript
// Get supported timezones, fallback to basic list if Intl.supportedValuesOf is not available
|
|
export const getSupportedTimezones = (): string[] => {
|
|
try {
|
|
if (typeof Intl !== 'undefined' && 'supportedValuesOf' in Intl) {
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
return (Intl as any).supportedValuesOf('timeZone')
|
|
}
|
|
} catch {
|
|
console.warn('Intl.supportedValuesOf not available, using fallback timezones')
|
|
}
|
|
|
|
// Fallback timezone list
|
|
return ['America/New_York', 'Europe/Paris']
|
|
} |