@formatjs/intl 2.3.4 → 2.4.0
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/lib/src/dateTime.js +2 -2
- package/package.json +9 -9
- package/src/dateTime.js +2 -2
package/lib/src/dateTime.js
CHANGED
|
@@ -93,7 +93,7 @@ export function formatDateToParts(config, getDateTimeFormat) {
|
|
|
93
93
|
var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;
|
|
94
94
|
var date = typeof value === 'string' ? new Date(value || 0) : value;
|
|
95
95
|
try {
|
|
96
|
-
return getFormatter(config, 'date', getDateTimeFormat, options).formatToParts(date);
|
|
96
|
+
return getFormatter(config, 'date', getDateTimeFormat, options).formatToParts(date); // TODO: remove this when https://github.com/microsoft/TypeScript/pull/50402 is merged
|
|
97
97
|
}
|
|
98
98
|
catch (e) {
|
|
99
99
|
config.onError(new IntlError(IntlErrorCode.FORMAT_ERROR, 'Error formatting date.', e));
|
|
@@ -108,7 +108,7 @@ export function formatTimeToParts(config, getDateTimeFormat) {
|
|
|
108
108
|
var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;
|
|
109
109
|
var date = typeof value === 'string' ? new Date(value || 0) : value;
|
|
110
110
|
try {
|
|
111
|
-
return getFormatter(config, 'time', getDateTimeFormat, options).formatToParts(date);
|
|
111
|
+
return getFormatter(config, 'time', getDateTimeFormat, options).formatToParts(date); // TODO: remove this when https://github.com/microsoft/TypeScript/pull/50402 is merged
|
|
112
112
|
}
|
|
113
113
|
catch (e) {
|
|
114
114
|
config.onError(new IntlError(IntlErrorCode.FORMAT_ERROR, 'Error formatting time.', e));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formatjs/intl",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "Internationalize JS apps. This library provides an API to format dates, numbers, and strings, including pluralization and handling translations.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"intl",
|
|
@@ -29,20 +29,20 @@
|
|
|
29
29
|
"module": "lib/index.js",
|
|
30
30
|
"sideEffects": false,
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@formatjs/ecma402-abstract": "1.
|
|
32
|
+
"@formatjs/ecma402-abstract": "1.12.0",
|
|
33
33
|
"@formatjs/fast-memoize": "1.2.6",
|
|
34
|
-
"@formatjs/icu-messageformat-parser": "2.1.
|
|
35
|
-
"@formatjs/intl-displaynames": "6.1.
|
|
36
|
-
"@formatjs/intl-listformat": "7.1.
|
|
37
|
-
"intl-messageformat": "10.1.
|
|
34
|
+
"@formatjs/icu-messageformat-parser": "2.1.7",
|
|
35
|
+
"@formatjs/intl-displaynames": "6.1.2",
|
|
36
|
+
"@formatjs/intl-listformat": "7.1.2",
|
|
37
|
+
"intl-messageformat": "10.1.4",
|
|
38
38
|
"tslib": "2.4.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@formatjs/intl-datetimeformat": "6.
|
|
42
|
-
"@formatjs/intl-numberformat": "8.1.
|
|
41
|
+
"@formatjs/intl-datetimeformat": "6.2.0",
|
|
42
|
+
"@formatjs/intl-numberformat": "8.1.3"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"typescript": "^4.
|
|
45
|
+
"typescript": "^4.7"
|
|
46
46
|
},
|
|
47
47
|
"peerDependenciesMeta": {
|
|
48
48
|
"typescript": {
|
package/src/dateTime.js
CHANGED
|
@@ -100,7 +100,7 @@ function formatDateToParts(config, getDateTimeFormat) {
|
|
|
100
100
|
var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;
|
|
101
101
|
var date = typeof value === 'string' ? new Date(value || 0) : value;
|
|
102
102
|
try {
|
|
103
|
-
return getFormatter(config, 'date', getDateTimeFormat, options).formatToParts(date);
|
|
103
|
+
return getFormatter(config, 'date', getDateTimeFormat, options).formatToParts(date); // TODO: remove this when https://github.com/microsoft/TypeScript/pull/50402 is merged
|
|
104
104
|
}
|
|
105
105
|
catch (e) {
|
|
106
106
|
config.onError(new error_1.IntlError(error_1.IntlErrorCode.FORMAT_ERROR, 'Error formatting date.', e));
|
|
@@ -116,7 +116,7 @@ function formatTimeToParts(config, getDateTimeFormat) {
|
|
|
116
116
|
var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;
|
|
117
117
|
var date = typeof value === 'string' ? new Date(value || 0) : value;
|
|
118
118
|
try {
|
|
119
|
-
return getFormatter(config, 'time', getDateTimeFormat, options).formatToParts(date);
|
|
119
|
+
return getFormatter(config, 'time', getDateTimeFormat, options).formatToParts(date); // TODO: remove this when https://github.com/microsoft/TypeScript/pull/50402 is merged
|
|
120
120
|
}
|
|
121
121
|
catch (e) {
|
|
122
122
|
config.onError(new error_1.IntlError(error_1.IntlErrorCode.FORMAT_ERROR, 'Error formatting time.', e));
|