feat: add LocaleProvider and hooks for managing locale and timezone settings
Some checks failed
Frontend CI / lint (push) Failing after 19s
Frontend CI / build (push) Has been skipped

This commit is contained in:
JSC
2025-08-15 19:19:05 +02:00
parent 32140d7b5a
commit cd654b8777
6 changed files with 182 additions and 9 deletions

14
src/lib/utils/locale.ts Normal file
View File

@@ -0,0 +1,14 @@
// 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']
}