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
* Build ESM output to dist
* Announce ESM exports in package.json
* Add exports for lookup-convert, parse-format, data and limited data
* Replace `commander` with a hand-coded command-line parsing
* Upgrade dev dependencies
* Replace npm with pnpm (worked slower)
* Replace cpy-cli with cp.js (started to create wrong paths)
* Replace eslint with denolint (worked slower)
* Replace coveralls with codecov (they cancel accounts)
* Replace travis with github actions (more work to maintain)
BREAKING CHANGE: The initial ESM support exposed the sources at paths like `src/index.js` and worked only if you used a bundler. **The proper ESM support** has been provided by files built to paths like `dist/index.mjs`, which are mapped to export modules in `package.json`. For example, if you imported the main module like this:
import { getZonedTime } from ./node_modules/timezone-support/src/index.js
Change it to this:
import { getZonedTime } from timezone-support
See also sections "Loading" and "Modules" in `API.md`.
**Replacing `commander` in `create-timezone-data`** with a hand-coded command-line parsing should not affect anybody, because the command-line format did not change, but there might be some undetected difference.
Declaring export modules in `package.json` **works reliably since Node.js 14.8**, but the rest of the source code and loading the files from the `dist` directory directly should work since Node.js 6. The script `create-timezone-data` needs the `fs/promises` implementation, which was introduced in Node.js 14.
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
11
14
12
* Tiny code base - 4.6 KB minified, 1.7 KB gzipped. Do not pack unnecessary weight in your application.
15
13
* Packed time zone data - 924 KB minified, 33.6 KB gzipped. Single time zones are unpacked on demand.
16
14
* Smaller bundles of code with limited data - 1900-2050 (206 kB minified, 25.4 kB gzipped), 1970-2038 (141 kB minified, 15.8 kB gzipped) and 2012-2022 (31.3 KB minified, 8.25 kB gzipped).
17
-
* Generated from the official time zone database version 2019a. Canonical time zone names, aliases, UTC offsets, and daylight-saving time changes.
15
+
* Generated from the official time zone database version 2022f. Canonical time zone names, aliases, UTC offsets, and daylight-saving time changes.
16
+
* ESM, UMD and CJS module formats provided.
18
17
* Minimal interface for time zone lookup and conversions. Parsing, formatting and manipulating dates is usually the task for a higher-level date library.
19
18
20
19
**Attention**: exported identifiers in vanilla browser modules changed in the version 2.0.0. See the [migration guide] for more information.
@@ -56,13 +55,11 @@ const nativeDate = new Date(getUnixTime(berlinTime, berlin))
56
55
57
56
## Installation and Getting Started
58
57
59
-
This module can be installed in your project using [NPM] or [Yarn]. Make sure, that you use [Node.js] version 6 or newer.
60
-
61
-
```sh
62
-
$ npm i timezone-support --save
63
-
```
58
+
This module can be installed in your project using [NPM], [PNPM] or [Yarn]. Make sure, that you use [Node.js] version 14.8 or newer.
64
59
65
60
```sh
61
+
$ npm i timezone-support
62
+
$ pnpm i timezone-support
66
63
$ yarn add timezone-support
67
64
```
68
65
@@ -72,7 +69,7 @@ Functions are exposed as named exports from the package modules, for example:
You can read more about the [module loading](./docs/API.md#loading) in other environments, like with ES6 or in web browsers. [Usage scenarios](./docs/usage.md#usage-scenarios) demonstrate applications of this library in typical real-world scenarios. [Design concepts](./docs/design.md#design-concepts) explain the approach to time zone handling taken by tni library and types of values used ion the interface. [Generating custom time zone data](./docs/usage.md#generate-custom-time-zone-data) will allow you to save the overall package size by limiting the supported year span. Finally, the [API reference](./docs/API.md#api-reference) lists all functions with a description of their functionality.
72
+
You can read more about the [module loading] in other environments, like with ES6 or in web browsers. [Usage scenarios] demonstrate applications of this library in typical real-world scenarios. [Design concepts] explain the approach to time zone handling taken by tni library and types of values used ion the interface. [Generating custom time zone data] will allow you to save the overall package size by limiting the supported year span. Finally, the [API reference] lists all functions with a description of their functionality.
76
73
77
74
You can see [complete sample applications] too, which can help you start with integration of this library.
78
75
@@ -85,34 +82,24 @@ You can see [complete sample applications] too, which can help you start with in
85
82
86
83
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
87
84
88
-
## Release History
89
-
90
-
* 2018-06-11 v2.0.2 Upgrade the time zone database to the version 2019a.
91
-
* 2018-06-11 v2.0.1 Default to midnight, if the time part of a date is missing.
92
-
* 2018-06-10 v2.0.0 Use proper identifiers in vanilla browser modules.
93
-
* 2018-11-17 v1.8.0 Include time zone data for years 1970-2038.
94
-
* 2018-11-17 v1.7.0 Include full time zone data separately loadable.
95
-
* 2018-11-06 v1.6.0 Upgrade the time zone database to the version 2018g.
96
-
* 2018-10-08 v1.5.5 Fix compatibility with IE. Thanks, [Andrii](https://github.com/AndriiDidkivsky)!
0 commit comments