@dialpad/dialtone
Version:
Dialpad's Dialtone design system monorepo
34 lines (33 loc) • 1.08 kB
JavaScript
function o(t, e = "default") {
return new Intl.DateTimeFormat(e, { weekday: "long", year: "numeric", month: "long", day: "numeric" }).format(t);
}
function a(t, e = "default") {
return new Intl.DateTimeFormat(e, { year: "numeric", month: "long", day: "numeric" }).format(t);
}
function m(t, e = "default", n = !0) {
const r = n ? { weekday: "short", year: "numeric", month: "short", day: "numeric" } : { year: "numeric", month: "short", day: "numeric" };
return new Intl.DateTimeFormat(e, r).format(t);
}
function i(t, e = "default", n = !1) {
const r = n ? "short" : "long";
return new Intl.DateTimeFormat(e, { month: r, day: "numeric" }).format(t);
}
function u(t, e = "default") {
return new Intl.DateTimeFormat(e, { year: "2-digit", month: "2-digit", day: "2-digit" }).format(t);
}
const f = {
formatLong: o,
formatMedium: a,
formatShort: m,
formatNoYear: i,
formatNumerical: u
};
export {
f as default,
o as formatLong,
a as formatMedium,
i as formatNoYear,
u as formatNumerical,
m as formatShort
};
//# sourceMappingURL=formatUtils.js.map