UNPKG

koval-ui

Version:

React components collection with minimalistic design. Supports theming, layout, and input validation.

59 lines (58 loc) 1.16 kB
"use client"; import { jsx as h } from "react/jsx-runtime"; import { forwardRef as j, useMemo as y } from "react"; import B from "classnames"; import { useBrowserLocale as F } from "../../internal/locale/useBrowserLocale.js"; import r from "./DateTime.module.css.js"; const I = j( ({ className: t, locale: o, value: e = "", weekday: m, era: s, year: a, month: n, day: c, hour: i, minute: l, second: f, timeZoneName: p, hour12: u, timeZone: d, enableNoWrap: w = !0, ...D }, N) => { const T = F(), x = o || T, L = y(() => new Date(e), [e]), b = new Intl.DateTimeFormat(x, { weekday: m, era: s, year: a, month: n, day: c, hour: i, minute: l, second: f, timeZoneName: p, hour12: u, timeZone: d }).format(L); return e && /* @__PURE__ */ h( "span", { ...D, className: B( r.number, { [r.noWrap]: w }, t ), ref: N, children: b } ); } ); I.displayName = "DateTime"; export { I as DateTime }; //# sourceMappingURL=DateTime.js.map