UNPKG

vuux

Version:

Vue3 Nuxt3 Nuxt4 组件库

35 lines (34 loc) 991 B
import { Q as i, MS as h, S as d, MIN as l, H as u, DATE as m, D as M, W as p, Y as S, M as r } from "./constant.mjs"; const c = (t, o, e) => { const n = String(t); return !n || n.length >= o ? t : `${Array(o + 1 - n.length).join(e)}${t}`; }, $ = (t) => { const o = -t.utcOffset(), e = Math.abs(o), n = Math.floor(e / 60), s = e % 60; return `${o <= 0 ? "+" : "-"}${c(n, 2, "0")}:${c(s, 2, "0")}`; }, f = (t, o) => { if (t.date() < o.date()) return -f(o, t); const e = (o.year() - t.year()) * 12 + (o.month() - t.month()), n = t.clone().add(e, r), s = o - n < 0, a = t.clone().add(e + (s ? -1 : 1), r); return +(-(e + (o - n) / (s ? n - a : a - n)) || 0); }, y = (t) => t < 0 ? Math.ceil(t) || 0 : Math.floor(t), D = (t) => ({ M: r, y: S, w: p, d: M, D: m, h: u, m: l, s: d, ms: h, Q: i })[t] || String(t || "").toLowerCase().replace(/s$/, ""), w = (t) => t === void 0, U = { s: c, z: $, m: f, a: y, p: D, u: w }; export { U as default };