You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,10 +11,10 @@
11
11
12
12
Lightweight time zone listing and date converting. Intended for adding time zone support to high-level date libraries, but also for direct application usage.
13
13
14
-
* Tiny code base - 3.5 KB minified, 1.5 KB gzipped. Do not pack unnecessary weight in your application.
15
-
* Packed time zone data - 178 KB minified, 22.5 KB gzipped. Single time zones are unpacked on demand.
16
-
*Even smaller version with limited, 2012-2022 timezone data - 31 KB minified, 8K gzipped.
17
-
* Generated from the official time zone database version 2018e. Canonical time zone names, aliases, UTC offsets, and daylight-saving time changes.
14
+
* Tiny code base - 4.6 KB minified, 1.7 KB gzipped. Do not pack unnecessary weight in your application.
15
+
* Packed time zone data - 923 KB minified, 33.3 KB gzipped. Single time zones are unpacked on demand.
16
+
*Smaller bundles with limited data - 1900-2050 (204 kB minified, 25.2 kB gzipped) and 2012-2022 (31.2 KB minified, 8.2 kB gzipped).
17
+
* Generated from the official time zone database version 2018g. Canonical time zone names, aliases, UTC offsets, and daylight-saving time changes.
18
18
* Minimal interface for time zone lookup and conversions. Parsing, formatting and manipulating dates is usually the task for a higher-level date library.
19
19
20
20
### Table of Contents
@@ -83,6 +83,7 @@ In lieu of a formal styleguide, take care to maintain the existing coding style.
83
83
84
84
## Release History
85
85
86
+
* 2018-11-06 v1.6.0 Upgrade the time zone database to the version 2018g.
86
87
* 2018-10-08 v1.5.5 Fix compatibility with IE. Thanks, [Andrii](https://github.com/AndriiDidkivsky)!
`Date` objects in the last two scenarios are initialized only for formatting or conversion purposes, because other methods, than the date part getters, deliver wrong results. Such "invalid" `Date` instances should exist only temporarily in a restricted scope. They should not be shared widely in the application to prevent mistakes from happening. The local time in a valid `Date` object has to match the UTC time maintained by the same object.
432
432
433
+
## Data Generator
434
+
435
+
If you want to [limit the time zone data](#limit-the-loaded-time-zone-data) to improve performance of your application by reducing the size of the JavaScript code, you can use the command-line tool included in this package:
The module generated by this tool exposes a data object as a default export, which is expected bu the function[populatePluralData](#populatepluraldata).
461
+
433
462
[time object]: ./design.md#time-object
434
463
[IANA time zones]: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
Copy file name to clipboardExpand all lines: docs/design.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ The purpose of this library is to offer an efficient support for time zone handl
4
4
5
5
* Lightweight - nothing else is included. Thus serving well for other date & time libraries, but also for applications, which do not manipulate dates.
6
6
* Tiny - use packed time zone data, unpacked on demand. Compromise between loading time and being ready to use immediately.
7
-
* Reliable - generated from the fresh official time zone database version 2018e. Canonical time zone names, aliases, UTC offsets, and daylight-saving time changes.
7
+
* Reliable - generated from the fresh official time zone database version 2018g. Canonical time zone names, aliases, UTC offsets, and daylight-saving time changes.
8
8
* Customizable - named exports and functions divided to separate modules allow tree-shaking. Alternative time zone data can be supplied to reduce the library size.
Copy file name to clipboardExpand all lines: docs/usage.md
+26-6Lines changed: 26 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -170,18 +170,20 @@ See the functions [convertDateToTime](./API.md#convertdatetotime) and [convertTi
170
170
171
171
## Limit the loaded time zone data
172
172
173
-
The full time zone data cover all dates between 1970 and 2018. If you process dates only from a limited time period, you can initialize this library with a subset of time zone data and decrease the loading time of your application. For example, the difference between the full time zone data and the data for this decade only:
173
+
If you process dates only from a limited time period, you can initialize this library with a subset of the [IANA time zone database] and decrease the loading time of your application. For example, the difference between the full time zone data and the data for this decade only:
174
174
175
-
```
176
-
Data for 1970-2018: 178 KB minified, 22.5 KB gzipped
175
+
```txt
176
+
Full IANA TZ data: 923 KB minified, 33.3 KB gzipped
177
+
Data for 1900-2050: 200 KB minified, 23.3 KB gzipped
178
+
Data for 1970-2018: 106 KB minified, 13.1 KB gzipped
177
179
Data for 2012-2022: 27 KB minified, 6.5 KB gzipped
178
180
```
179
181
180
182
Custom time zone data can be used if the module `lookup-convert` is loaded instead of the default `index` module.
@@ -199,7 +201,7 @@ Custom time zone data can be used if the module `lookup-convert` is loaded inste
199
201
If you want to use the time zone data for years 2012-2022 published by this project, you can simplify your code by using a bundled package with both data and code.
0 commit comments