@formatjs/intl-datetimeformat
Version:
Intl.DateTimeFormat polyfill
15 lines (14 loc) • 505 B
JavaScript
import { PartitionDateTimeRangePattern } from './PartitionDateTimeRangePattern';
export function FormatDateTimeRangeToParts(dtf, x, y, implDetails) {
var parts = PartitionDateTimeRangePattern(dtf, x, y, implDetails);
var result = new Array(0);
for (var _i = 0, parts_1 = parts; _i < parts_1.length; _i++) {
var part = parts_1[_i];
result.push({
type: part.type,
value: part.value,
source: part.source,
});
}
return result;
}