UNPKG

@dialpad/dialtone

Version:

Dialpad's Dialtone design system monorepo

55 lines (54 loc) 1.33 kB
import { DialtoneLocalization as e } from "../../localization/index.js"; //#region components/datepicker/formatUtils.js function t(t, n = null) { return new Intl.DateTimeFormat(n || e.getPreferredLocale(), { weekday: "long", year: "numeric", month: "long", day: "numeric" }).format(t); } function n(t, n = null) { return new Intl.DateTimeFormat(n || e.getPreferredLocale(), { year: "numeric", month: "long", day: "numeric" }).format(t); } function r(t, n = null, r = !0) { let i = r ? { weekday: "short", year: "numeric", month: "short", day: "numeric" } : { year: "numeric", month: "short", day: "numeric" }; return new Intl.DateTimeFormat(n || e.getPreferredLocale(), i).format(t); } function i(t, n = null, r = !1) { let i = r ? "short" : "long"; return new Intl.DateTimeFormat(n || e.getPreferredLocale(), { month: i, day: "numeric" }).format(t); } function a(t, n = null) { return new Intl.DateTimeFormat(n || e.getPreferredLocale(), { year: "2-digit", month: "2-digit", day: "2-digit" }).format(t); } var o = { formatLong: t, formatMedium: n, formatShort: r, formatNoYear: i, formatNumerical: a }; //#endregion export { o as default, t as formatLong, n as formatMedium, i as formatNoYear, a as formatNumerical, r as formatShort }; //# sourceMappingURL=formatUtils.js.map