1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | var tslib_1 = require("tslib");
|
4 | var React = (0, tslib_1.__importStar)(require("react"));
|
5 | var useIntl_1 = (0, tslib_1.__importDefault)(require("./useIntl"));
|
6 | var FormattedDateTimeRange = function (props) {
|
7 | var intl = (0, useIntl_1.default)();
|
8 | var from = props.from, to = props.to, children = props.children, formatProps = (0, tslib_1.__rest)(props, ["from", "to", "children"]);
|
9 | var formattedValue = intl.formatDateTimeRange(from, to, formatProps);
|
10 | if (typeof children === 'function') {
|
11 | return children(formattedValue);
|
12 | }
|
13 | var Text = intl.textComponent || React.Fragment;
|
14 | return React.createElement(Text, null, formattedValue);
|
15 | };
|
16 | FormattedDateTimeRange.displayName = 'FormattedDateTimeRange';
|
17 | exports.default = FormattedDateTimeRange;
|