@vvo/tzdb 6.200.0 → 6.201.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 +12 -11
- package/dist/index.cjs +3 -4
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -126,6 +126,7 @@ Options:
|
|
|
126
126
|
- `locale`: translates `alternativeName`, `countryName` and `continentName`. With `"fr"`, Los Angeles
|
|
127
127
|
shows as "-07:00 heure du Pacifique nord-américain - Los Angeles, ...". City names stay as they are.
|
|
128
128
|
- `includeUtc`: adds `Etc/UTC`, whose group includes `UTC` and `GMT`.
|
|
129
|
+
- `date`: computes the `current*` fields at this date instead of now, like the date of a meeting.
|
|
129
130
|
- `includeGmtOffsets`: adds the fixed offsets `Etc/GMT-14` to `Etc/GMT+12`. As in POSIX, the sign
|
|
130
131
|
is inverted: `Etc/GMT+5` is 5 hours behind UTC.
|
|
131
132
|
|
|
@@ -156,17 +157,17 @@ The IANA tz database release behind the data, like `"2026e"`.
|
|
|
156
157
|
|
|
157
158
|
## Compared to countries-and-timezones
|
|
158
159
|
|
|
159
|
-
|
|
|
160
|
-
|
|
|
161
|
-
| Data updates
|
|
162
|
-
| Current offsets
|
|
163
|
-
|
|
|
164
|
-
|
|
|
165
|
-
|
|
|
166
|
-
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
160
|
+
| | @vvo/tzdb | countries-and-timezones |
|
|
161
|
+
| --------------------------------- | ---------------------------- | ----------------------------------- |
|
|
162
|
+
| Data updates | Every day, automatically | By hand |
|
|
163
|
+
| Current offsets | From the browser, at runtime | Computed when the package was built |
|
|
164
|
+
| Abbreviations that follow DST | Yes | No |
|
|
165
|
+
| Translations | Any language the browser has | No |
|
|
166
|
+
| Country of a time zone | 4 kB | 9 kB |
|
|
167
|
+
| Picker list with cities and names | 17 kB | Not available |
|
|
168
|
+
|
|
169
|
+
Sizes are minified and gzipped. countries-and-timezones weighs 9 kB in total, without cities, display
|
|
170
|
+
names or abbreviations.
|
|
170
171
|
|
|
171
172
|
## How time zones are grouped
|
|
172
173
|
|
package/dist/index.cjs
CHANGED
|
@@ -4570,10 +4570,9 @@ function translator(locale, date) {
|
|
|
4570
4570
|
* and operating systems keep up to date.
|
|
4571
4571
|
*/
|
|
4572
4572
|
function getTimeZones(options = {}) {
|
|
4573
|
-
const { includeUtc = false, includeGmtOffsets = false, locale } = options;
|
|
4574
|
-
const
|
|
4575
|
-
const
|
|
4576
|
-
const offsets = rawTimeZones.map(({ name }) => getOffset(name, now));
|
|
4573
|
+
const { includeUtc = false, includeGmtOffsets = false, locale, date = /* @__PURE__ */ new Date() } = options;
|
|
4574
|
+
const translate = locale ? translator(locale, date) : void 0;
|
|
4575
|
+
const offsets = rawTimeZones.map(({ name }) => getOffset(name, date));
|
|
4577
4576
|
const hasIntl = offsets.some((offset) => offset !== void 0);
|
|
4578
4577
|
const timeZones = [];
|
|
4579
4578
|
rawTimeZones.forEach((rawTimeZone, index) => {
|
package/dist/index.d.cts
CHANGED
|
@@ -41,6 +41,8 @@ interface TimeZoneOptions {
|
|
|
41
41
|
* API, like "fr" or "es-MX". City names are not translated.
|
|
42
42
|
*/
|
|
43
43
|
locale?: string;
|
|
44
|
+
/** Computes the current* fields at this date instead of now, like the date of a meeting */
|
|
45
|
+
date?: Date;
|
|
44
46
|
}
|
|
45
47
|
//#endregion
|
|
46
48
|
//#region src/index.d.ts
|
package/dist/index.d.ts
CHANGED
|
@@ -41,6 +41,8 @@ interface TimeZoneOptions {
|
|
|
41
41
|
* API, like "fr" or "es-MX". City names are not translated.
|
|
42
42
|
*/
|
|
43
43
|
locale?: string;
|
|
44
|
+
/** Computes the current* fields at this date instead of now, like the date of a meeting */
|
|
45
|
+
date?: Date;
|
|
44
46
|
}
|
|
45
47
|
//#endregion
|
|
46
48
|
//#region src/index.d.ts
|
package/dist/index.js
CHANGED
|
@@ -4569,10 +4569,9 @@ function translator(locale, date) {
|
|
|
4569
4569
|
* and operating systems keep up to date.
|
|
4570
4570
|
*/
|
|
4571
4571
|
function getTimeZones(options = {}) {
|
|
4572
|
-
const { includeUtc = false, includeGmtOffsets = false, locale } = options;
|
|
4573
|
-
const
|
|
4574
|
-
const
|
|
4575
|
-
const offsets = rawTimeZones.map(({ name }) => getOffset(name, now));
|
|
4572
|
+
const { includeUtc = false, includeGmtOffsets = false, locale, date = /* @__PURE__ */ new Date() } = options;
|
|
4573
|
+
const translate = locale ? translator(locale, date) : void 0;
|
|
4574
|
+
const offsets = rawTimeZones.map(({ name }) => getOffset(name, date));
|
|
4576
4575
|
const hasIntl = offsets.some((offset) => offset !== void 0);
|
|
4577
4576
|
const timeZones = [];
|
|
4578
4577
|
rawTimeZones.forEach((rawTimeZone, index) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vvo/tzdb",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.201.0",
|
|
4
4
|
"description": "Always up to date list of IANA time zones for time zone pickers, with major cities, current offsets, DST abbreviations and the country of any time zone",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"abbreviations",
|