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
`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
+
`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
433
433
434
## Data Generator
434
435
@@ -437,24 +438,26 @@ If you want to [limit the time zone data](#limit-the-loaded-time-zone-data) to i
The module generated by this tool exposes a data object as a default export, which is expected bu the function[populatePluralData](#populatepluraldata).
@@ -202,7 +202,7 @@ Custom time zone data can be used if the module `lookup-convert` is loaded inste
202
202
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.
@@ -236,4 +236,54 @@ See the function [populateTimeZones](./API.md#populatetimezones) for more inform
236
236
237
237
## Generate custom time zone data
238
238
239
+
Except for the time zone data for the three year spans bundled with this module, other data modules can be generated to customize the year span and thus the overall package size. There is a command line tool [`create-timezone-data`](./API.md#data-generator) for this included in this package.
240
+
241
+
For example, you can generate time zone data for years 1978-2028 and save it to the module `data-1978-2028.js` in the CommonJS format, which you wil bundle to your application:
And then load them instead of the default full time zone data. You need to require `timezone-support/dist/lookup-convert` instead of `timezone-support` everywhere in your application and populate the library with the custom data, when your application starts:
0 commit comments