@vvo/tzdb 6.198.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/README.md +136 -135
- package/abbreviations.json +15 -0
- package/dist/index.cjs +4654 -0
- package/dist/index.d.cts +65 -0
- package/dist/index.d.ts +45 -8
- package/dist/index.js +4647 -34
- package/package.json +89 -120
- package/raw-time-zones.json +166 -167
- package/time-zones-names.json +1 -1
- package/dist/formatTimeZone.js +0 -26
- package/dist/formatTimeZone.js.map +0 -1
- package/dist/getTimeZones.js +0 -62
- package/dist/getTimeZones.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/utils/timeZone.js +0 -99
- package/dist/utils/timeZone.js.map +0 -1
- package/index.d.ts +0 -28
- package/lib/formatTimeZone.js +0 -31
- package/lib/getTimeZones.js +0 -71
- package/lib/index.js +0 -4
- package/lib/utils/timeZone.js +0 -113
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
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;
|
|
23
|
+
}
|
|
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;
|
|
30
|
+
}
|
|
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;
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/index.d.ts
|
|
47
|
+
export declare const rawTimeZones: RawTimeZone[];
|
|
48
|
+
export declare const timeZonesNames: TimeZoneName[];
|
|
49
|
+
export declare const abbreviations: Record<string, string>;
|
|
50
|
+
/** Release of the IANA tz database used to build the data, like "2026e" */
|
|
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;
|
|
58
|
+
/**
|
|
59
|
+
* Time zones grouped by country and clock, sorted by current offset. The
|
|
60
|
+
* current offset comes from the runtime's own tz database, which browsers
|
|
61
|
+
* and operating systems keep up to date.
|
|
62
|
+
*/
|
|
63
|
+
export declare function getTimeZones(options?: TimeZoneOptions): TimeZone[];
|
|
64
|
+
//#endregion
|
|
65
|
+
export type { RawTimeZone, TimeZone, TimeZoneName, TimeZoneOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,28 +1,65 @@
|
|
|
1
|
+
//#region src/types.d.ts
|
|
1
2
|
type TimeZoneName = string;
|
|
2
|
-
|
|
3
3
|
interface RawTimeZone {
|
|
4
|
+
/** IANA name of the most populated zone of the group, like "America/Los_Angeles" */
|
|
4
5
|
name: TimeZoneName;
|
|
6
|
+
/** English generic name, like "Pacific Time" */
|
|
5
7
|
alternativeName: string;
|
|
6
|
-
|
|
8
|
+
/** Every IANA name, current or deprecated, that shows this exact time */
|
|
9
|
+
group: TimeZoneName[];
|
|
7
10
|
continentCode: string;
|
|
8
11
|
continentName: string;
|
|
9
12
|
countryName: string;
|
|
10
13
|
countryCode: string;
|
|
14
|
+
/** Up to four cities, most populated first */
|
|
11
15
|
mainCities: string[];
|
|
16
|
+
/** UTC offset outside of daylight saving time */
|
|
12
17
|
rawOffsetInMinutes: number;
|
|
18
|
+
/** Abbreviation outside of daylight saving time, like "PST" */
|
|
13
19
|
abbreviation: string;
|
|
20
|
+
/** Abbreviation during daylight saving time, like "PDT". Only for zones that observe it */
|
|
21
|
+
dstAbbreviation?: string;
|
|
14
22
|
rawFormat: string;
|
|
15
23
|
}
|
|
16
|
-
|
|
17
24
|
interface TimeZone extends RawTimeZone {
|
|
25
|
+
/** UTC offset right now, according to the tz database of the browser or Node.js */
|
|
18
26
|
currentTimeOffsetInMinutes: number;
|
|
19
27
|
currentTimeFormat: string;
|
|
28
|
+
/** "PDT" or "PST" depending on the current date */
|
|
29
|
+
currentAbbreviation: string;
|
|
20
30
|
}
|
|
21
|
-
|
|
22
31
|
interface TimeZoneOptions {
|
|
32
|
+
/** Adds an "Etc/UTC" time zone, whose group includes "UTC" and "GMT" */
|
|
23
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;
|
|
24
44
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
export const
|
|
28
|
-
export
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/index.d.ts
|
|
47
|
+
export declare const rawTimeZones: RawTimeZone[];
|
|
48
|
+
export declare const timeZonesNames: TimeZoneName[];
|
|
49
|
+
export declare const abbreviations: Record<string, string>;
|
|
50
|
+
/** Release of the IANA tz database used to build the data, like "2026e" */
|
|
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;
|
|
58
|
+
/**
|
|
59
|
+
* Time zones grouped by country and clock, sorted by current offset. The
|
|
60
|
+
* current offset comes from the runtime's own tz database, which browsers
|
|
61
|
+
* and operating systems keep up to date.
|
|
62
|
+
*/
|
|
63
|
+
export declare function getTimeZones(options?: TimeZoneOptions): TimeZone[];
|
|
64
|
+
//#endregion
|
|
65
|
+
export type { RawTimeZone, TimeZone, TimeZoneName, TimeZoneOptions };
|