Files
sbd2-frontend/src/lib/utils/locale.ts
JSC cd654b8777
Some checks failed
Frontend CI / lint (push) Failing after 19s
Frontend CI / build (push) Has been skipped
feat: add LocaleProvider and hooks for managing locale and timezone settings
2025-08-15 19:19:05 +02:00

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']
}