@formatjs/intl-datetimeformat
Version:
Intl.DateTimeFormat polyfill
16 lines (15 loc) • 411 B
JavaScript
import "@formatjs/ecma402-abstract";
import { PartitionDateTimePattern } from "./PartitionDateTimePattern.js";
/**
* https://tc39.es/ecma402/#sec-formatdatetime
* @param dtf DateTimeFormat
* @param x
*/
export function FormatDateTime(dtf, x, implDetails) {
const parts = PartitionDateTimePattern(dtf, x, implDetails);
let result = "";
for (const part of parts) {
result += part.value;
}
return result;
}