UNPKG

@burglekitt/gmt

Version:

Temporal-based date and time utilities with timezone support and polyfill integration

16 lines (15 loc) 555 B
/** * Validate whether a string is a valid IANA timeZone identifier. * * - Uses Temporal.ZonedDateTime.from to test timezone validity. * - Uses regex to check format. * - Returns false for invalid timezone formats. * * @param timeZone timeZone identifier to validate * @returns boolean indicating validity * * @example isValidTimeZone("America/New_York") // true * @example isValidTimeZone("Europe/London") // true * @example isValidTimeZone("Invalid/Timezone") // false */ export declare function isValidTimeZone(timeZone: string): boolean;