@js-joda/locale 4.0.0 → 4.2.1
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/.babelrc +15 -9
- package/CHANGELOG.md +20 -2
- package/README.md +11 -10
- package/dist/js-joda-locale.d.ts +7 -0
- package/dist/js-joda-locale.js +207 -158
- package/dist/js-joda-locale.js.map +1 -1
- package/dist/js-joda-locale.min.js +19 -13
- package/dist/prebuilt/de/index.js +231 -175
- package/dist/prebuilt/de/index.js.map +1 -1
- package/dist/prebuilt/de-de/index.js +231 -175
- package/dist/prebuilt/de-de/index.js.map +1 -1
- package/dist/prebuilt/en/index.js +231 -175
- package/dist/prebuilt/en/index.js.map +1 -1
- package/dist/prebuilt/en-us/index.js +231 -175
- package/dist/prebuilt/en-us/index.js.map +1 -1
- package/dist/prebuilt/es/index.js +231 -175
- package/dist/prebuilt/es/index.js.map +1 -1
- package/dist/prebuilt/fr/index.js +231 -175
- package/dist/prebuilt/fr/index.js.map +1 -1
- package/dist/prebuilt/fr-fr/index.js +231 -175
- package/dist/prebuilt/fr-fr/index.js.map +1 -1
- package/dist/prebuilt/hi/index.js +231 -175
- package/dist/prebuilt/hi/index.js.map +1 -1
- package/dist/prebuilt/it/index.js +231 -175
- package/dist/prebuilt/it/index.js.map +1 -1
- package/dist/prebuilt/it-it/index.js +231 -175
- package/dist/prebuilt/it-it/index.js.map +1 -1
- package/dist/prebuilt/ja/index.js +231 -175
- package/dist/prebuilt/ja/index.js.map +1 -1
- package/dist/prebuilt/ja-jp/index.js +231 -175
- package/dist/prebuilt/ja-jp/index.js.map +1 -1
- package/dist/prebuilt/ko/index.js +231 -175
- package/dist/prebuilt/ko/index.js.map +1 -1
- package/dist/prebuilt/ro/index.js +231 -175
- package/dist/prebuilt/ro/index.js.map +1 -1
- package/dist/prebuilt/sv/index.js +231 -175
- package/dist/prebuilt/sv/index.js.map +1 -1
- package/dist/prebuilt/sv-se/index.js +231 -175
- package/dist/prebuilt/sv-se/index.js.map +1 -1
- package/dist/prebuilt/zh/index.js +231 -175
- package/dist/prebuilt/zh/index.js.map +1 -1
- package/examples/usage_node_build.js +2 -2
- package/package.json +19 -45
- package/src/_init.js +2 -0
- package/src/format/LocaleDateTimeFormatter.js +57 -1
- package/src/format/LocaleStore.js +4 -2
- package/src/format/cldr/CldrCache.js +6 -0
- package/src/format/cldr/CldrDateTimeFormatterBuilder.js +1 -1
- package/src/format/cldr/CldrDateTimeTextProvider.js +2 -2
- package/src/format/cldr/CldrZoneTextPrinterParser.js +23 -5
- package/src/plug.js +4 -0
- package/src/temporal/WeekFields.js +2 -2
- package/utils/load_cldrData.prebuilt.js +4 -1
- package/utils/load_cldrData.postinstall.js +0 -15
package/.babelrc
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"presets": [
|
|
3
|
-
[
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
["@babel/preset-env", {
|
|
4
|
+
"modules": "auto",
|
|
5
|
+
"targets": {
|
|
6
|
+
"edge": "17",
|
|
7
|
+
"firefox": "60",
|
|
8
|
+
"chrome": "67",
|
|
9
|
+
"safari": "11.1",
|
|
10
|
+
"ie": "11"
|
|
11
|
+
}
|
|
12
|
+
}]
|
|
9
13
|
],
|
|
10
14
|
"comments": false,
|
|
11
15
|
"env": {
|
|
12
16
|
"test": {
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
|
|
17
|
+
"presets": ["@babel/preset-env", {
|
|
18
|
+
"plugins": [
|
|
19
|
+
"istanbul"
|
|
20
|
+
]
|
|
21
|
+
}]
|
|
16
22
|
}
|
|
17
23
|
}
|
|
18
24
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
3
3
|
|
|
4
4
|
### next (upcoming)
|
|
5
5
|
|
|
6
|
+
### 4.2.1
|
|
7
|
+
|
|
8
|
+
* [#560](https://github.com/js-joda/js-joda/pull/560) Add RFC_1123_DATE_TIME to locale ts definition ([@pithu](https://github.com/pithu))
|
|
9
|
+
|
|
10
|
+
### 4.2.0
|
|
11
|
+
|
|
12
|
+
* Upgrade dependencies #555 by @pithu
|
|
13
|
+
* Change @babel/preset-env targets, fix IE11 issues #555 by @pithu
|
|
14
|
+
* Add new built-in formatter DateTimeFormatter.RFC_1123_DATE_TIME #556 by @pithu
|
|
15
|
+
|
|
16
|
+
### 4.1.0
|
|
17
|
+
|
|
18
|
+
* Fix bug with GMT timezone parsing and improve caching #550 by @pithu
|
|
19
|
+
|
|
20
|
+
### 4.0.1
|
|
21
|
+
|
|
22
|
+
* Add new Locales to prebuilt packages #543 by @pithu
|
|
23
|
+
|
|
6
24
|
### 4.0.0
|
|
7
25
|
|
|
8
26
|
Even this is a major release, it should not break anything.
|
|
@@ -51,7 +69,7 @@ and some added prebuilt Locale packages for browser usage.
|
|
|
51
69
|
introduced new plugin concept
|
|
52
70
|
* Hide `use(plug)` concept from public api.
|
|
53
71
|
The function for extending js-joda is not exported anymore.
|
|
54
|
-
The code for extending js-joda `use(plug)` is not required anymore, because js-joda
|
|
72
|
+
The code for extending js-joda `use(plug)` is not required anymore, because @js-joda/locale automaticaly extends
|
|
55
73
|
js-joda when imported.
|
|
56
74
|
However, using `Locale` now requires extracting it from the `@js-joda/locale` module instead of `js-joda`
|
|
57
75
|
|
|
@@ -59,7 +77,7 @@ introduced new plugin concept
|
|
|
59
77
|
|
|
60
78
|
* add possibility to publish locale specific packages (e.g. @js-joda/locale_de, @js-joda/locale_en-US, ...)
|
|
61
79
|
|
|
62
|
-
* add prebuilt packages to main js-joda
|
|
80
|
+
* add prebuilt packages to main @js-joda/locale package (e.g. @js-joda/locale/dist/prebuilt/de/js-joda-locale, ...)
|
|
63
81
|
|
|
64
82
|
### 1.0.0
|
|
65
83
|
|
package/README.md
CHANGED
|
@@ -6,8 +6,9 @@
|
|
|
6
6
|
[](https://travis-ci.org/js-joda/js-joda)
|
|
7
7
|
[](https://saucelabs.com/u/js-joda)
|
|
8
8
|
[](https://coveralls.io/github/js-joda/js-joda?branch=master)
|
|
9
|
-
[](https://img.shields.io/npm/dm/%40js-joda%2Flocale.svg)
|
|
10
|
+
|
|
11
|
+
[](https://saucelabs.com/u/js-joda)
|
|
11
12
|
|
|
12
13
|
## Motivation
|
|
13
14
|
|
|
@@ -60,7 +61,7 @@ The cldr data is a peer dependency of this package, meaning it must be provided/
|
|
|
60
61
|
Since the complete cldr-data package can be quite large, the examples and documentation below show ways to dynamically
|
|
61
62
|
load or reduce the amount of data needed.
|
|
62
63
|
|
|
63
|
-
The implementation of `@js-joda/locale` also requires
|
|
64
|
+
The implementation of `@js-joda/locale` also requires `@js-joda/timezone` package e.g. to parse and output timezone names and offsets
|
|
64
65
|
|
|
65
66
|
### Node
|
|
66
67
|
|
|
@@ -74,13 +75,13 @@ Install joda using npm
|
|
|
74
75
|
npm install @js-joda/locale
|
|
75
76
|
```
|
|
76
77
|
|
|
77
|
-
To enable js-joda
|
|
78
|
+
To enable @js-joda/locale you will only need to require it, requiring it automatically registers the locale extensions in the base `js-joda`
|
|
78
79
|
Note: the `Locale` class is exported by `@js-joda/locale` so in order to use it, you will need to extract it from there.
|
|
79
80
|
|
|
80
81
|
```javascript
|
|
81
82
|
require('@js-joda/locale_<locale>')
|
|
82
83
|
```
|
|
83
|
-
since
|
|
84
|
+
since `@js-joda/locale` requires `@js-joda/timezone` it will also need to be provided, as shown
|
|
84
85
|
in the following examples
|
|
85
86
|
|
|
86
87
|
### es5
|
|
@@ -151,7 +152,7 @@ In `package.json` file define which parts of cldr-data to download and install
|
|
|
151
152
|
...
|
|
152
153
|
```
|
|
153
154
|
(data-coverage `core` only downloads data for the most popular languages / locales, while the urls-filter defines
|
|
154
|
-
which parts of cldr-data are required for
|
|
155
|
+
which parts of cldr-data are required for `@js-joda/locale` to work)
|
|
155
156
|
|
|
156
157
|
In e.g. webpack.config.js, define which parts/locales of the cldr-data files should end up in the final package
|
|
157
158
|
|
|
@@ -179,7 +180,7 @@ or (as we do for our prebuilt packages) use the CldrDataIgnorePlugin, provided i
|
|
|
179
180
|
|
|
180
181
|
```
|
|
181
182
|
where modulesDir is the absolute path to `node_modules` and `locales` is an array of locales to use as they can be defined
|
|
182
|
-
for the prebuilt packages. This will only load the absolutely required files for js-joda
|
|
183
|
+
for the prebuilt packages. This will only load the absolutely required files for @js-joda/locale, it is what we use internally
|
|
183
184
|
for the prebuilt packages and to build packages for our karma tests as well.
|
|
184
185
|
|
|
185
186
|
Depending on your usecase it might also be necessary to define a "faked" cldr-data module that loads
|
|
@@ -196,7 +197,7 @@ cldr-data load uses modules not available in browser (e.g. `fs`)
|
|
|
196
197
|
|
|
197
198
|
```
|
|
198
199
|
|
|
199
|
-
These should be the minimum required parts for js-joda
|
|
200
|
+
These should be the minimum required parts for @js-joda/locale
|
|
200
201
|
|
|
201
202
|
see the [karma.conf.js](karma.conf.js)
|
|
202
203
|
|
|
@@ -224,10 +225,10 @@ Week Information
|
|
|
224
225
|
- `c` for localized day-of-week
|
|
225
226
|
|
|
226
227
|
some of these are only partially localized, e.g. `Q` only if three or more `Q` are used, one or two `Q` also
|
|
227
|
-
work with plain
|
|
228
|
+
work with plain `@js-joda/core` without using `@js-joda/locale`
|
|
228
229
|
|
|
229
230
|
## License
|
|
230
231
|
|
|
231
|
-
* js-joda
|
|
232
|
+
* @js-joda/locale is released under the [BSD 3-clause license](LICENSE)
|
|
232
233
|
* The author of joda time and the lead architect of the JSR-310 is Stephen Colebourne.
|
|
233
234
|
|
package/dist/js-joda-locale.d.ts
CHANGED
|
@@ -19,11 +19,18 @@ export namespace Locale {
|
|
|
19
19
|
const FRANCE: Locale;
|
|
20
20
|
const GERMAN: Locale;
|
|
21
21
|
const GERMANY: Locale;
|
|
22
|
+
const KOREAN: Locale;
|
|
23
|
+
const JAPANESE: Locale;
|
|
24
|
+
const JAPAN: Locale;
|
|
22
25
|
}
|
|
23
26
|
|
|
24
27
|
import * as core from '@js-joda/core';
|
|
25
28
|
|
|
26
29
|
declare module '@js-joda/core' {
|
|
30
|
+
namespace DateTimeFormatter {
|
|
31
|
+
export const RFC_1123_DATE_TIME: DateTimeFormatter;
|
|
32
|
+
}
|
|
33
|
+
|
|
27
34
|
export interface DateTimeFormatter {
|
|
28
35
|
withLocale(locale: Locale): DateTimeFormatter;
|
|
29
36
|
locale(): Locale | null;
|