@formatjs/intl-datetimeformat 7.1.1 → 7.1.2

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.
Files changed (54) hide show
  1. package/index.d.ts +1 -1
  2. package/index.js +1 -1
  3. package/package.json +5 -5
  4. package/polyfill-force.js +28 -44
  5. package/polyfill.iife.js +2301 -3064
  6. package/polyfill.js +29 -45
  7. package/should-polyfill.js +38 -50
  8. package/src/abstract/BasicFormatMatcher.d.ts +5 -5
  9. package/src/abstract/BasicFormatMatcher.js +87 -103
  10. package/src/abstract/BestFitFormatMatcher.d.ts +12 -12
  11. package/src/abstract/BestFitFormatMatcher.js +102 -108
  12. package/src/abstract/DateTimeStyleFormat.d.ts +2 -2
  13. package/src/abstract/DateTimeStyleFormat.js +47 -62
  14. package/src/abstract/FormatDateTime.d.ts +7 -7
  15. package/src/abstract/FormatDateTime.js +12 -12
  16. package/src/abstract/FormatDateTimePattern.d.ts +11 -11
  17. package/src/abstract/FormatDateTimePattern.js +185 -209
  18. package/src/abstract/FormatDateTimeRange.d.ts +3 -3
  19. package/src/abstract/FormatDateTimeRange.js +9 -8
  20. package/src/abstract/FormatDateTimeRangeToParts.d.ts +4 -4
  21. package/src/abstract/FormatDateTimeRangeToParts.js +14 -12
  22. package/src/abstract/FormatDateTimeToParts.d.ts +9 -9
  23. package/src/abstract/FormatDateTimeToParts.js +17 -18
  24. package/src/abstract/InitializeDateTimeFormat.d.ts +15 -15
  25. package/src/abstract/InitializeDateTimeFormat.js +206 -184
  26. package/src/abstract/PartitionDateTimePattern.d.ts +8 -8
  27. package/src/abstract/PartitionDateTimePattern.js +15 -14
  28. package/src/abstract/PartitionDateTimeRangePattern.d.ts +4 -4
  29. package/src/abstract/PartitionDateTimeRangePattern.js +168 -161
  30. package/src/abstract/ToDateTimeOptions.d.ts +5 -5
  31. package/src/abstract/ToDateTimeOptions.js +68 -60
  32. package/src/abstract/ToLocalTime.d.ts +21 -21
  33. package/src/abstract/ToLocalTime.js +108 -111
  34. package/src/abstract/skeleton.d.ts +8 -8
  35. package/src/abstract/skeleton.js +231 -280
  36. package/src/abstract/utils.d.ts +1 -1
  37. package/src/abstract/utils.js +21 -20
  38. package/src/core.d.ts +17 -17
  39. package/src/core.js +250 -286
  40. package/src/data/all-tz.generated.d.ts +5 -3
  41. package/src/data/all-tz.generated.js +458 -458
  42. package/src/data/links.generated.d.ts +258 -256
  43. package/src/data/links.generated.js +256 -256
  44. package/src/get_internal_slots.d.ts +3 -1
  45. package/src/get_internal_slots.js +8 -7
  46. package/src/packer.d.ts +2 -2
  47. package/src/packer.js +23 -35
  48. package/src/to_locale_string.d.ts +3 -3
  49. package/src/to_locale_string.js +11 -11
  50. package/src/types.d.ts +34 -39
  51. package/src/types.js +1 -1
  52. package/supported-locales.generated.js +572 -572
  53. package/test262-main.d.ts +4 -1
  54. package/test262-main.js +24600 -33141
package/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from './src/core.js';
1
+ export * from "./src/core.js";
package/index.js CHANGED
@@ -1 +1 @@
1
- export * from './src/core.js';
1
+ export * from "./src/core.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@formatjs/intl-datetimeformat",
3
3
  "description": "Intl.DateTimeFormat polyfill",
4
- "version": "7.1.1",
4
+ "version": "7.1.2",
5
5
  "license": "MIT",
6
6
  "author": "Long Ho <holevietlong@gmail.com>",
7
7
  "type": "module",
@@ -18,12 +18,12 @@
18
18
  "dependencies": {
19
19
  "decimal.js": "^10.4.3",
20
20
  "tslib": "^2.8.0",
21
- "@formatjs/ecma402-abstract": "3.0.7",
22
- "@formatjs/intl-localematcher": "0.7.4"
21
+ "@formatjs/intl-localematcher": "0.7.5",
22
+ "@formatjs/ecma402-abstract": "3.0.8"
23
23
  },
24
24
  "devDependencies": {
25
- "@formatjs/intl-getcanonicallocales": "3.1.1",
26
- "@formatjs/intl-locale": "5.1.1"
25
+ "@formatjs/intl-getcanonicallocales": "3.1.2",
26
+ "@formatjs/intl-locale": "5.1.2"
27
27
  },
28
28
  "bugs": "https://github.com/formatjs/formatjs/issues",
29
29
  "homepage": "https://github.com/formatjs/formatjs#readme",
package/polyfill-force.js CHANGED
@@ -1,44 +1,28 @@
1
- import { defineProperty } from '@formatjs/ecma402-abstract';
2
- import { DateTimeFormat } from './index.js';
3
- import { toLocaleDateString as _toLocaleDateString, toLocaleString as _toLocaleString, toLocaleTimeString as _toLocaleTimeString, } from './src/to_locale_string.js';
4
- defineProperty(Intl, 'DateTimeFormat', { value: DateTimeFormat });
5
- defineProperty(Date.prototype, 'toLocaleString', {
6
- value: function toLocaleString(locales, options) {
7
- if (options === void 0) { options = {
8
- dateStyle: 'short',
9
- timeStyle: 'medium',
10
- }; }
11
- try {
12
- return _toLocaleString(this, locales, options);
13
- }
14
- catch (_a) {
15
- return 'Invalid Date';
16
- }
17
- },
18
- });
19
- defineProperty(Date.prototype, 'toLocaleDateString', {
20
- value: function toLocaleDateString(locales, options) {
21
- if (options === void 0) { options = {
22
- dateStyle: 'short',
23
- }; }
24
- try {
25
- return _toLocaleDateString(this, locales, options);
26
- }
27
- catch (_a) {
28
- return 'Invalid Date';
29
- }
30
- },
31
- });
32
- defineProperty(Date.prototype, 'toLocaleTimeString', {
33
- value: function toLocaleTimeString(locales, options) {
34
- if (options === void 0) { options = {
35
- timeStyle: 'medium',
36
- }; }
37
- try {
38
- return _toLocaleTimeString(this, locales, options);
39
- }
40
- catch (_a) {
41
- return 'Invalid Date';
42
- }
43
- },
44
- });
1
+ import { defineProperty } from "@formatjs/ecma402-abstract";
2
+ import { DateTimeFormat } from "./index.js";
3
+ import { toLocaleDateString as _toLocaleDateString, toLocaleString as _toLocaleString, toLocaleTimeString as _toLocaleTimeString } from "./src/to_locale_string.js";
4
+ defineProperty(Intl, "DateTimeFormat", { value: DateTimeFormat });
5
+ defineProperty(Date.prototype, "toLocaleString", { value: function toLocaleString(locales, options = {
6
+ dateStyle: "short",
7
+ timeStyle: "medium"
8
+ }) {
9
+ try {
10
+ return _toLocaleString(this, locales, options);
11
+ } catch {
12
+ return "Invalid Date";
13
+ }
14
+ } });
15
+ defineProperty(Date.prototype, "toLocaleDateString", { value: function toLocaleDateString(locales, options = { dateStyle: "short" }) {
16
+ try {
17
+ return _toLocaleDateString(this, locales, options);
18
+ } catch {
19
+ return "Invalid Date";
20
+ }
21
+ } });
22
+ defineProperty(Date.prototype, "toLocaleTimeString", { value: function toLocaleTimeString(locales, options = { timeStyle: "medium" }) {
23
+ try {
24
+ return _toLocaleTimeString(this, locales, options);
25
+ } catch {
26
+ return "Invalid Date";
27
+ }
28
+ } });