react-intl 7.0.4 → 7.1.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.
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FormatDateTimeRangeOptions } from '@formatjs/intl';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
interface Props extends
|
|
3
|
+
interface Props extends FormatDateTimeRangeOptions {
|
|
4
4
|
from: Parameters<Intl.DateTimeFormat['formatRange']>[0];
|
|
5
5
|
to: Parameters<Intl.DateTimeFormat['formatRange']>[1];
|
|
6
6
|
children?(value: React.ReactNode): React.ReactElement | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-intl",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.1.1",
|
|
4
4
|
"description": "Internationalize React apps. This library provides React components and an API to format dates, numbers, and strings, including pluralization and handling translations.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"intl",
|
|
@@ -129,16 +129,16 @@
|
|
|
129
129
|
"sideEffects": false,
|
|
130
130
|
"dependencies": {
|
|
131
131
|
"@types/hoist-non-react-statics": "3",
|
|
132
|
-
"@types/react": "16 || 17 || 18
|
|
132
|
+
"@types/react": "16 || 17 || 18",
|
|
133
133
|
"hoist-non-react-statics": "3",
|
|
134
134
|
"tslib": "2",
|
|
135
|
-
"
|
|
136
|
-
"@formatjs/
|
|
137
|
-
"@formatjs/
|
|
138
|
-
"
|
|
135
|
+
"@formatjs/ecma402-abstract": "2.3.2",
|
|
136
|
+
"@formatjs/intl": "3.1.1",
|
|
137
|
+
"@formatjs/icu-messageformat-parser": "2.10.0",
|
|
138
|
+
"intl-messageformat": "10.7.12"
|
|
139
139
|
},
|
|
140
140
|
"peerDependencies": {
|
|
141
|
-
"react": "^16.6.0 || 17 || 18
|
|
141
|
+
"react": "^16.6.0 || 17 || 18",
|
|
142
142
|
"typescript": "5"
|
|
143
143
|
},
|
|
144
144
|
"peerDependenciesMeta": {
|
package/react-intl.iife.js
CHANGED
|
@@ -4127,14 +4127,14 @@ var ReactIntl = (() => {
|
|
|
4127
4127
|
_a2[_i - 2] = arguments[_i];
|
|
4128
4128
|
}
|
|
4129
4129
|
var from = _a2[0], to = _a2[1], _b = _a2[2], options = _b === void 0 ? {} : _b;
|
|
4130
|
-
var
|
|
4131
|
-
var
|
|
4130
|
+
var fromDate = typeof from === "string" ? new Date(from || 0) : from;
|
|
4131
|
+
var toDate = typeof to === "string" ? new Date(to || 0) : to;
|
|
4132
4132
|
try {
|
|
4133
|
-
return
|
|
4133
|
+
return getFormatter(config, "dateTimeRange", getDateTimeFormat, options).formatRange(fromDate, toDate);
|
|
4134
4134
|
} catch (e) {
|
|
4135
|
-
onError(new IntlFormatError("Error formatting date time range.", config.locale, e));
|
|
4135
|
+
config.onError(new IntlFormatError("Error formatting date time range.", config.locale, e));
|
|
4136
4136
|
}
|
|
4137
|
-
return String(
|
|
4137
|
+
return String(fromDate);
|
|
4138
4138
|
}
|
|
4139
4139
|
function formatDateToParts(config, getDateTimeFormat) {
|
|
4140
4140
|
var _a2 = [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FormatDateTimeRangeOptions } from '@formatjs/intl';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
interface Props extends
|
|
3
|
+
interface Props extends FormatDateTimeRangeOptions {
|
|
4
4
|
from: Parameters<Intl.DateTimeFormat['formatRange']>[0];
|
|
5
5
|
to: Parameters<Intl.DateTimeFormat['formatRange']>[1];
|
|
6
6
|
children?(value: React.ReactNode): React.ReactElement | null;
|