isValidIanaTimezoneId()
Home > @gooddata/sdk-model > isValidIanaTimezoneId
isValidIanaTimezoneId() function
This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Tests whether timezoneId is a valid IANA timezone identifier according to the runtime ICU data (via Intl.DateTimeFormat). The BROWSER_DETECTED sentinel is not a valid IANA ID — use isValidDashboardTimezoneId() for values stored on the dashboard.
Identifiers are case-sensitive. Intl accepts timezones case-insensitively, so a value that only differs in case from the canonical form (e.g. "america/new_york") is rejected. Aliases that resolve to a different identifier (e.g. "Etc/UTC" → "UTC") are still accepted as ICU-known IDs. Offset-style identifiers (e.g. "+01", "+0100", "+01:00") are rejected.
Signature:
export declare function isValidIanaTimezoneId(timezoneId: string): boolean;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
timezoneId |
string |
timezone identifier to test |
Returns:
boolean