@vvo/tzdb 6.199.0 → 6.200.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,54 +1,65 @@
1
- export type TimeZoneName = string;
2
- export interface RawTimeZone {
3
- /** IANA name of the most populated zone of the group, like "America/Los_Angeles" */
4
- name: TimeZoneName;
5
- /** English generic name, like "Pacific Time" */
6
- alternativeName: string;
7
- /** Every IANA name, current or deprecated, that shows this exact time */
8
- group: TimeZoneName[];
9
- continentCode: string;
10
- continentName: string;
11
- countryName: string;
12
- countryCode: string;
13
- /** Up to four cities, most populated first */
14
- mainCities: string[];
15
- /** UTC offset outside of daylight saving time */
16
- rawOffsetInMinutes: number;
17
- /** Abbreviation outside of daylight saving time, like "PST" */
18
- abbreviation: string;
19
- /** Abbreviation during daylight saving time, like "PDT". Only for zones that observe it */
20
- dstAbbreviation?: string;
21
- rawFormat: string;
1
+ //#region src/types.d.ts
2
+ type TimeZoneName = string;
3
+ interface RawTimeZone {
4
+ /** IANA name of the most populated zone of the group, like "America/Los_Angeles" */
5
+ name: TimeZoneName;
6
+ /** English generic name, like "Pacific Time" */
7
+ alternativeName: string;
8
+ /** Every IANA name, current or deprecated, that shows this exact time */
9
+ group: TimeZoneName[];
10
+ continentCode: string;
11
+ continentName: string;
12
+ countryName: string;
13
+ countryCode: string;
14
+ /** Up to four cities, most populated first */
15
+ mainCities: string[];
16
+ /** UTC offset outside of daylight saving time */
17
+ rawOffsetInMinutes: number;
18
+ /** Abbreviation outside of daylight saving time, like "PST" */
19
+ abbreviation: string;
20
+ /** Abbreviation during daylight saving time, like "PDT". Only for zones that observe it */
21
+ dstAbbreviation?: string;
22
+ rawFormat: string;
22
23
  }
23
- export interface TimeZone extends RawTimeZone {
24
- /** UTC offset right now, according to the tz database of the browser or Node.js */
25
- currentTimeOffsetInMinutes: number;
26
- currentTimeFormat: string;
27
- /** "PDT" or "PST" depending on the current date */
28
- currentAbbreviation: string;
24
+ interface TimeZone extends RawTimeZone {
25
+ /** UTC offset right now, according to the tz database of the browser or Node.js */
26
+ currentTimeOffsetInMinutes: number;
27
+ currentTimeFormat: string;
28
+ /** "PDT" or "PST" depending on the current date */
29
+ currentAbbreviation: string;
29
30
  }
30
- export interface TimeZoneOptions {
31
- /** Adds an "Etc/UTC" time zone, whose group includes "UTC" and "GMT" */
32
- includeUtc?: boolean;
33
- /**
34
- * Adds the fixed offset time zones from "Etc/GMT-14" to "Etc/GMT+12".
35
- * Their sign is inverted: "Etc/GMT+5" is 5 hours behind UTC.
36
- */
37
- includeGmtOffsets?: boolean;
38
- /**
39
- * Translates alternativeName, countryName and continentName with the Intl
40
- * API, like "fr" or "es-MX". City names are not translated.
41
- */
42
- locale?: string;
31
+ interface TimeZoneOptions {
32
+ /** Adds an "Etc/UTC" time zone, whose group includes "UTC" and "GMT" */
33
+ includeUtc?: boolean;
34
+ /**
35
+ * Adds the fixed offset time zones from "Etc/GMT-14" to "Etc/GMT+12".
36
+ * Their sign is inverted: "Etc/GMT+5" is 5 hours behind UTC.
37
+ */
38
+ includeGmtOffsets?: boolean;
39
+ /**
40
+ * Translates alternativeName, countryName and continentName with the Intl
41
+ * API, like "fr" or "es-MX". City names are not translated.
42
+ */
43
+ locale?: string;
43
44
  }
45
+ //#endregion
46
+ //#region src/index.d.ts
44
47
  export declare const rawTimeZones: RawTimeZone[];
45
48
  export declare const timeZonesNames: TimeZoneName[];
46
49
  export declare const abbreviations: Record<string, string>;
47
50
  /** Release of the IANA tz database used to build the data, like "2026e" */
48
51
  export declare const tzdbVersion: string;
52
+ /**
53
+ * ISO 3166 country code of any IANA time zone name, current or deprecated,
54
+ * like "FR" for "Europe/Paris" or "IN" for "Asia/Calcutta". Undefined for
55
+ * names without a country, like "UTC".
56
+ */
57
+ export declare function getCountryCode(timeZone: string): string | undefined;
49
58
  /**
50
59
  * Time zones grouped by country and clock, sorted by current offset. The
51
60
  * current offset comes from the runtime's own tz database, which browsers
52
61
  * and operating systems keep up to date.
53
62
  */
54
63
  export declare function getTimeZones(options?: TimeZoneOptions): TimeZone[];
64
+ //#endregion
65
+ export type { RawTimeZone, TimeZone, TimeZoneName, TimeZoneOptions };
package/dist/index.d.ts CHANGED
@@ -1,54 +1,65 @@
1
- export type TimeZoneName = string;
2
- export interface RawTimeZone {
3
- /** IANA name of the most populated zone of the group, like "America/Los_Angeles" */
4
- name: TimeZoneName;
5
- /** English generic name, like "Pacific Time" */
6
- alternativeName: string;
7
- /** Every IANA name, current or deprecated, that shows this exact time */
8
- group: TimeZoneName[];
9
- continentCode: string;
10
- continentName: string;
11
- countryName: string;
12
- countryCode: string;
13
- /** Up to four cities, most populated first */
14
- mainCities: string[];
15
- /** UTC offset outside of daylight saving time */
16
- rawOffsetInMinutes: number;
17
- /** Abbreviation outside of daylight saving time, like "PST" */
18
- abbreviation: string;
19
- /** Abbreviation during daylight saving time, like "PDT". Only for zones that observe it */
20
- dstAbbreviation?: string;
21
- rawFormat: string;
1
+ //#region src/types.d.ts
2
+ type TimeZoneName = string;
3
+ interface RawTimeZone {
4
+ /** IANA name of the most populated zone of the group, like "America/Los_Angeles" */
5
+ name: TimeZoneName;
6
+ /** English generic name, like "Pacific Time" */
7
+ alternativeName: string;
8
+ /** Every IANA name, current or deprecated, that shows this exact time */
9
+ group: TimeZoneName[];
10
+ continentCode: string;
11
+ continentName: string;
12
+ countryName: string;
13
+ countryCode: string;
14
+ /** Up to four cities, most populated first */
15
+ mainCities: string[];
16
+ /** UTC offset outside of daylight saving time */
17
+ rawOffsetInMinutes: number;
18
+ /** Abbreviation outside of daylight saving time, like "PST" */
19
+ abbreviation: string;
20
+ /** Abbreviation during daylight saving time, like "PDT". Only for zones that observe it */
21
+ dstAbbreviation?: string;
22
+ rawFormat: string;
22
23
  }
23
- export interface TimeZone extends RawTimeZone {
24
- /** UTC offset right now, according to the tz database of the browser or Node.js */
25
- currentTimeOffsetInMinutes: number;
26
- currentTimeFormat: string;
27
- /** "PDT" or "PST" depending on the current date */
28
- currentAbbreviation: string;
24
+ interface TimeZone extends RawTimeZone {
25
+ /** UTC offset right now, according to the tz database of the browser or Node.js */
26
+ currentTimeOffsetInMinutes: number;
27
+ currentTimeFormat: string;
28
+ /** "PDT" or "PST" depending on the current date */
29
+ currentAbbreviation: string;
29
30
  }
30
- export interface TimeZoneOptions {
31
- /** Adds an "Etc/UTC" time zone, whose group includes "UTC" and "GMT" */
32
- includeUtc?: boolean;
33
- /**
34
- * Adds the fixed offset time zones from "Etc/GMT-14" to "Etc/GMT+12".
35
- * Their sign is inverted: "Etc/GMT+5" is 5 hours behind UTC.
36
- */
37
- includeGmtOffsets?: boolean;
38
- /**
39
- * Translates alternativeName, countryName and continentName with the Intl
40
- * API, like "fr" or "es-MX". City names are not translated.
41
- */
42
- locale?: string;
31
+ interface TimeZoneOptions {
32
+ /** Adds an "Etc/UTC" time zone, whose group includes "UTC" and "GMT" */
33
+ includeUtc?: boolean;
34
+ /**
35
+ * Adds the fixed offset time zones from "Etc/GMT-14" to "Etc/GMT+12".
36
+ * Their sign is inverted: "Etc/GMT+5" is 5 hours behind UTC.
37
+ */
38
+ includeGmtOffsets?: boolean;
39
+ /**
40
+ * Translates alternativeName, countryName and continentName with the Intl
41
+ * API, like "fr" or "es-MX". City names are not translated.
42
+ */
43
+ locale?: string;
43
44
  }
45
+ //#endregion
46
+ //#region src/index.d.ts
44
47
  export declare const rawTimeZones: RawTimeZone[];
45
48
  export declare const timeZonesNames: TimeZoneName[];
46
49
  export declare const abbreviations: Record<string, string>;
47
50
  /** Release of the IANA tz database used to build the data, like "2026e" */
48
51
  export declare const tzdbVersion: string;
52
+ /**
53
+ * ISO 3166 country code of any IANA time zone name, current or deprecated,
54
+ * like "FR" for "Europe/Paris" or "IN" for "Asia/Calcutta". Undefined for
55
+ * names without a country, like "UTC".
56
+ */
57
+ export declare function getCountryCode(timeZone: string): string | undefined;
49
58
  /**
50
59
  * Time zones grouped by country and clock, sorted by current offset. The
51
60
  * current offset comes from the runtime's own tz database, which browsers
52
61
  * and operating systems keep up to date.
53
62
  */
54
63
  export declare function getTimeZones(options?: TimeZoneOptions): TimeZone[];
64
+ //#endregion
65
+ export type { RawTimeZone, TimeZone, TimeZoneName, TimeZoneOptions };