esday 0.5.0 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/LICENSE +21 -21
- package/README.md +63 -51
- package/chunks/AyQQ6US-.js +84 -0
- package/chunks/{Y32qdU_5.js → BkjWOpMU.js} +7 -1
- package/chunks/{MtjcOKi-.d.ts → C5qDMHT5.d.ts} +2 -2
- package/chunks/{DqhiVwLi.d.ts → CODi8AFH.d.ts} +63 -35
- package/{index.js → chunks/CXWzCl3n.js} +91 -183
- package/chunks/{BRRrAbUl.js → CdvTtmWL.js} +2 -2
- package/chunks/{DXHbH1CI.js → Shk32pTP.js} +1 -1
- package/chunks/{Cb5SvF6r.js → v_QBn7Xm.js} +1 -1
- package/chunks/xt8C2lbv.js +38 -0
- package/index.d.mts +3 -0
- package/index.mjs +3 -0
- package/locales/af.d.mts +6 -0
- package/locales/{af.js → af.mjs} +4 -2
- package/locales/am.d.mts +6 -0
- package/locales/{am.js → am.mjs} +4 -2
- package/locales/ar-dz.d.mts +9 -0
- package/locales/{ar-dz.js → ar-dz.mjs} +7 -9
- package/locales/ar-iq.d.mts +9 -0
- package/locales/ar-iq.mjs +12 -0
- package/locales/ar-kw.d.mts +9 -0
- package/locales/{ar-kw.js → ar-kw.mjs} +7 -9
- package/locales/ar-ly.d.mts +9 -0
- package/locales/ar-ly.mjs +12 -0
- package/locales/ar-ma.d.mts +9 -0
- package/locales/{ar-ma.js → ar-ma.mjs} +7 -9
- package/locales/ar-sa.d.mts +9 -0
- package/locales/{ar-sa.js → ar-sa.mjs} +7 -9
- package/locales/ar-tn.d.mts +9 -0
- package/locales/{ar-tn.js → ar-tn.mjs} +7 -9
- package/locales/ar.d.mts +6 -0
- package/{chunks/BeVgU2nj.js → locales/ar.mjs} +12 -2
- package/locales/az.d.mts +6 -0
- package/locales/{az.js → az.mjs} +4 -2
- package/locales/be.d.mts +6 -0
- package/locales/{be.js → be.mjs} +55 -59
- package/locales/bg.d.mts +6 -0
- package/locales/{bg.js → bg.mjs} +4 -2
- package/locales/bi.d.mts +6 -0
- package/locales/{bi.js → bi.mjs} +4 -2
- package/locales/bm.d.mts +6 -0
- package/locales/{bm.js → bm.mjs} +4 -2
- package/locales/bn-bd.d.mts +9 -0
- package/locales/{bn-bd.js → bn-bd.mjs} +7 -9
- package/locales/bn.d.mts +6 -0
- package/{chunks/GjKpN6U-.js → locales/bn.mjs} +4 -2
- package/locales/bo.d.mts +6 -0
- package/locales/{bo.js → bo.mjs} +4 -2
- package/locales/br.d.mts +6 -0
- package/locales/{br.js → br.mjs} +10 -9
- package/locales/bs.d.mts +6 -0
- package/locales/{bs.js → bs.mjs} +4 -2
- package/locales/ca.d.mts +6 -0
- package/locales/{ca.js → ca.mjs} +35 -36
- package/locales/cs.d.mts +6 -0
- package/locales/{cs.js → cs.mjs} +38 -34
- package/locales/cv.d.mts +6 -0
- package/locales/{cv.js → cv.mjs} +4 -2
- package/locales/cy.d.mts +6 -0
- package/locales/{cy.js → cy.mjs} +4 -2
- package/locales/da.d.mts +6 -0
- package/locales/{da.js → da.mjs} +4 -2
- package/locales/de-at.d.mts +9 -0
- package/locales/{de-at.js → de-at.mjs} +7 -9
- package/locales/de-ch.d.mts +9 -0
- package/locales/de-ch.mjs +12 -0
- package/locales/de.d.mts +6 -0
- package/{chunks/DMtTiWuY.js → locales/de.mjs} +6 -2
- package/locales/dv.d.mts +6 -0
- package/locales/{dv.js → dv.mjs} +4 -2
- package/locales/el.d.mts +6 -0
- package/locales/{el.js → el.mjs} +4 -2
- package/locales/en-au.d.mts +9 -0
- package/locales/{en-au.js → en-au.mjs} +7 -8
- package/locales/en-ca.d.mts +9 -0
- package/locales/{en-ca.js → en-ca.mjs} +7 -8
- package/locales/{en-gb.d.ts → en-gb.d.mts} +1 -3
- package/locales/{en-gb.js → en-gb.mjs} +9 -8
- package/locales/en-ie.d.mts +9 -0
- package/locales/{en-ie.js → en-ie.mjs} +7 -8
- package/locales/en-il.d.mts +9 -0
- package/locales/{en-il.js → en-il.mjs} +7 -8
- package/locales/en-in.d.mts +9 -0
- package/locales/{en-in.js → en-in.mjs} +7 -8
- package/locales/en-nz.d.mts +9 -0
- package/locales/{en-nz.js → en-nz.mjs} +7 -8
- package/locales/en-sg.d.mts +9 -0
- package/locales/{en-sg.js → en-sg.mjs} +7 -8
- package/locales/en-tt.d.mts +9 -0
- package/locales/{en-tt.js → en-tt.mjs} +7 -8
- package/locales/en-us.d.mts +9 -0
- package/locales/en-us.mjs +12 -0
- package/locales/en.d.mts +6 -0
- package/{chunks/tfkJ5D3p.js → locales/en.mjs} +4 -2
- package/locales/eo.d.mts +6 -0
- package/locales/{eo.js → eo.mjs} +4 -2
- package/locales/es-do.d.mts +9 -0
- package/locales/{es-do.js → es-do.mjs} +7 -9
- package/locales/es-mx.d.mts +9 -0
- package/locales/es-mx.mjs +13 -0
- package/locales/es-pr.d.mts +9 -0
- package/locales/es-pr.mjs +16 -0
- package/locales/es-us.d.mts +9 -0
- package/locales/es-us.mjs +12 -0
- package/locales/es.d.mts +6 -0
- package/{chunks/Dixb5KKs.js → locales/es.mjs} +4 -2
- package/locales/et.d.mts +6 -0
- package/locales/{et.js → et.mjs} +6 -2
- package/locales/eu.d.mts +6 -0
- package/locales/{eu.js → eu.mjs} +4 -2
- package/locales/fa.d.mts +6 -0
- package/locales/{fa.js → fa.mjs} +4 -2
- package/locales/fi.d.mts +6 -0
- package/locales/{fi.js → fi.mjs} +8 -2
- package/locales/fil.d.mts +6 -0
- package/locales/{fil.js → fil.mjs} +4 -2
- package/locales/fo.d.mts +6 -0
- package/locales/{fo.js → fo.mjs} +4 -2
- package/locales/fr-ca.d.mts +9 -0
- package/locales/fr-ca.mjs +16 -0
- package/locales/fr-ch.d.mts +9 -0
- package/locales/fr-ch.mjs +16 -0
- package/locales/fr.d.mts +6 -0
- package/{chunks/D009Z-ld.js → locales/fr.mjs} +5 -4
- package/locales/fy.d.mts +6 -0
- package/locales/{fy.js → fy.mjs} +4 -2
- package/locales/ga.d.mts +6 -0
- package/locales/{ga.js → ga.mjs} +4 -2
- package/locales/gd.d.mts +6 -0
- package/locales/{gd.js → gd.mjs} +4 -2
- package/locales/gl.d.mts +6 -0
- package/locales/{gl.js → gl.mjs} +4 -2
- package/locales/gom-deva.d.mts +6 -0
- package/locales/{gom-deva.js → gom-deva.mjs} +34 -32
- package/locales/gom-latn.d.mts +6 -0
- package/locales/{gom-latn.js → gom-latn.mjs} +34 -32
- package/locales/gu.d.mts +6 -0
- package/locales/{gu.js → gu.mjs} +4 -2
- package/locales/he.d.mts +6 -0
- package/locales/{he.js → he.mjs} +8 -5
- package/locales/hi.d.mts +6 -0
- package/locales/{hi.js → hi.mjs} +34 -35
- package/locales/hr.d.mts +6 -0
- package/locales/{hr.js → hr.mjs} +10 -4
- package/locales/ht.d.mts +6 -0
- package/locales/{ht.js → ht.mjs} +4 -2
- package/locales/hu.d.mts +6 -0
- package/locales/{hu.js → hu.mjs} +6 -2
- package/locales/hy-am.d.mts +6 -0
- package/locales/{hy-am.js → hy-am.mjs} +34 -35
- package/locales/id.d.mts +6 -0
- package/locales/{id.js → id.mjs} +4 -2
- package/locales/is.d.mts +6 -0
- package/locales/{is.js → is.mjs} +14 -2
- package/locales/it-ch.d.mts +9 -0
- package/locales/{it-ch.js → it-ch.mjs} +4 -9
- package/locales/it.d.mts +6 -0
- package/{chunks/B5f9poqo.js → locales/it.mjs} +25 -24
- package/locales/{ja.d.ts → ja.d.mts} +1 -4
- package/locales/{ja.js → ja.mjs} +4 -2
- package/locales/jv.d.mts +6 -0
- package/locales/{jv.js → jv.mjs} +4 -2
- package/locales/ka.d.mts +6 -0
- package/locales/{ka.js → ka.mjs} +25 -26
- package/locales/kk.d.mts +6 -0
- package/locales/{kk.js → kk.mjs} +4 -2
- package/locales/km.d.mts +6 -0
- package/locales/{km.js → km.mjs} +4 -2
- package/locales/kn.d.mts +6 -0
- package/locales/{kn.js → kn.mjs} +4 -2
- package/locales/ko.d.mts +6 -0
- package/locales/{ko.js → ko.mjs} +5 -3
- package/locales/ku.d.mts +6 -0
- package/locales/{ku.js → ku.mjs} +4 -2
- package/locales/ky.d.mts +6 -0
- package/locales/{ky.js → ky.mjs} +4 -2
- package/locales/lb.d.mts +6 -0
- package/locales/{lb.js → lb.mjs} +5 -2
- package/locales/lo.d.mts +6 -0
- package/locales/{lo.js → lo.mjs} +4 -2
- package/locales/lt.d.mts +6 -0
- package/locales/{lt.js → lt.mjs} +4 -2
- package/locales/lv.d.mts +6 -0
- package/locales/{lv.js → lv.mjs} +4 -2
- package/locales/me.d.mts +6 -0
- package/locales/{me.js → me.mjs} +33 -33
- package/locales/mi.d.mts +6 -0
- package/locales/{mi.js → mi.mjs} +4 -2
- package/locales/mk.d.mts +6 -0
- package/locales/{mk.js → mk.mjs} +4 -2
- package/locales/ml.d.mts +6 -0
- package/locales/{ml.js → ml.mjs} +4 -2
- package/locales/mn.d.mts +6 -0
- package/locales/{mn.js → mn.mjs} +37 -16
- package/locales/mr.d.mts +6 -0
- package/locales/{mr.js → mr.mjs} +16 -2
- package/locales/ms-my.d.mts +9 -0
- package/locales/ms-my.mjs +12 -0
- package/locales/ms.d.mts +6 -0
- package/{chunks/CQ57zhVp.js → locales/ms.mjs} +4 -2
- package/locales/mt.d.mts +6 -0
- package/locales/{mt.js → mt.mjs} +4 -2
- package/locales/my.d.mts +6 -0
- package/locales/{my.js → my.mjs} +4 -2
- package/locales/nb.d.mts +6 -0
- package/locales/{nb.js → nb.mjs} +4 -2
- package/locales/ne.d.mts +6 -0
- package/locales/{ne.js → ne.mjs} +4 -2
- package/locales/nl-be.d.mts +9 -0
- package/locales/nl-be.mjs +16 -0
- package/locales/nl.d.mts +6 -0
- package/{chunks/BDssPbM_.js → locales/nl.mjs} +4 -2
- package/locales/nn.d.mts +6 -0
- package/locales/{nn.js → nn.mjs} +4 -2
- package/locales/oc-lnc.d.mts +6 -0
- package/locales/{oc-lnc.js → oc-lnc.mjs} +35 -36
- package/locales/pa-in.d.mts +6 -0
- package/locales/{pa-in.js → pa-in.mjs} +4 -2
- package/locales/pl.d.mts +6 -0
- package/locales/{pl.js → pl.mjs} +5 -2
- package/locales/pt-br.d.mts +9 -0
- package/locales/{pt-br.js → pt-br.mjs} +7 -9
- package/locales/pt.d.mts +6 -0
- package/{chunks/CWqzr5E5.js → locales/pt.mjs} +4 -2
- package/locales/rn.d.mts +6 -0
- package/locales/{rn.js → rn.mjs} +4 -2
- package/locales/ro.d.mts +6 -0
- package/locales/{ro.js → ro.mjs} +4 -2
- package/locales/{ru.d.ts → ru.d.mts} +1 -4
- package/locales/{ru.js → ru.mjs} +83 -82
- package/locales/rw.d.mts +6 -0
- package/locales/{rw.js → rw.mjs} +4 -2
- package/locales/sd.d.mts +6 -0
- package/locales/{sd.js → sd.mjs} +4 -2
- package/locales/se.d.mts +6 -0
- package/locales/{se.js → se.mjs} +4 -2
- package/locales/si.d.mts +6 -0
- package/locales/{si.js → si.mjs} +4 -2
- package/locales/sk.d.mts +6 -0
- package/locales/{sk.js → sk.mjs} +8 -2
- package/locales/sl.d.mts +6 -0
- package/locales/{sl.js → sl.mjs} +8 -2
- package/locales/sq.d.mts +6 -0
- package/locales/{sq.js → sq.mjs} +4 -2
- package/locales/sr-cyrl.d.mts +9 -0
- package/locales/{sr-cyrl.js → sr-cyrl.mjs} +16 -15
- package/locales/sr.d.mts +6 -0
- package/{chunks/Cg4ZI9v8.js → locales/sr.mjs} +14 -8
- package/locales/ss.d.mts +6 -0
- package/locales/{ss.js → ss.mjs} +4 -2
- package/locales/sv-fi.d.mts +9 -0
- package/locales/{sv-fi.js → sv-fi.mjs} +7 -9
- package/locales/sv.d.mts +6 -0
- package/{chunks/br7kModF.js → locales/sv.mjs} +5 -4
- package/locales/sw.d.mts +6 -0
- package/locales/{sw.js → sw.mjs} +4 -2
- package/locales/ta.d.mts +6 -0
- package/locales/{ta.js → ta.mjs} +4 -2
- package/locales/te.d.mts +6 -0
- package/locales/{te.js → te.mjs} +4 -2
- package/locales/tet.d.mts +6 -0
- package/locales/{tet.js → tet.mjs} +5 -4
- package/locales/tg.d.mts +6 -0
- package/locales/{tg.js → tg.mjs} +34 -35
- package/locales/th.d.mts +6 -0
- package/locales/{th.js → th.mjs} +4 -2
- package/locales/tk.d.mts +6 -0
- package/locales/{tk.js → tk.mjs} +5 -4
- package/locales/tl-ph.d.mts +6 -0
- package/locales/{tl-ph.js → tl-ph.mjs} +4 -2
- package/locales/tlh.d.mts +6 -0
- package/locales/{tlh.js → tlh.mjs} +5 -2
- package/locales/tr.d.mts +6 -0
- package/locales/{tr.js → tr.mjs} +5 -4
- package/locales/tzl.d.mts +6 -0
- package/locales/{tzl.js → tzl.mjs} +4 -2
- package/locales/tzm-latn.d.mts +9 -0
- package/locales/{tzm-latn.js → tzm-latn.mjs} +9 -9
- package/locales/tzm.d.mts +6 -0
- package/{chunks/l2Rxo2H0.js → locales/tzm.mjs} +4 -2
- package/locales/ug-cn.d.mts +6 -0
- package/locales/{ug-cn.js → ug-cn.mjs} +4 -2
- package/locales/uk.d.mts +6 -0
- package/locales/{uk.js → uk.mjs} +37 -32
- package/locales/ur.d.mts +6 -0
- package/locales/{ur.js → ur.mjs} +4 -2
- package/locales/uz-latn.d.mts +9 -0
- package/locales/{uz-latn.js → uz-latn.mjs} +9 -9
- package/locales/uz.d.mts +6 -0
- package/{chunks/CQJ0-ZuR.js → locales/uz.mjs} +4 -2
- package/locales/vi.d.mts +6 -0
- package/locales/{vi.js → vi.mjs} +4 -2
- package/locales/x-pseudo.d.mts +6 -0
- package/locales/{x-pseudo.js → x-pseudo.mjs} +5 -4
- package/locales/yo.d.mts +6 -0
- package/locales/{yo.js → yo.mjs} +4 -2
- package/locales/zh-cn.d.mts +9 -0
- package/locales/zh-cn.mjs +12 -0
- package/locales/zh-hk.d.mts +9 -0
- package/locales/zh-hk.mjs +21 -0
- package/locales/zh-mo.d.mts +9 -0
- package/locales/zh-mo.mjs +21 -0
- package/locales/zh-tw.d.mts +9 -0
- package/locales/zh-tw.mjs +21 -0
- package/locales/{zh.d.ts → zh.d.mts} +1 -4
- package/{chunks/BXRGSAJG.js → locales/zh.mjs} +5 -4
- package/package.json +29 -23
- package/plugins/advancedFormat/index.d.mts +6 -0
- package/plugins/advancedFormat/{index.js → index.mjs} +4 -6
- package/plugins/advancedParse/index.d.mts +6 -0
- package/plugins/advancedParse/{index.js → index.mjs} +21 -20
- package/plugins/calendar/{index.d.ts → index.d.mts} +2 -4
- package/plugins/calendar/{index.js → index.mjs} +1 -2
- package/plugins/dayOfYear/{index.d.ts → index.d.mts} +1 -2
- package/plugins/dayOfYear/{index.js → index.mjs} +1 -2
- package/plugins/duration/index.d.mts +78 -0
- package/plugins/duration/index.mjs +477 -0
- package/plugins/isBetween/{index.d.ts → index.d.mts} +1 -2
- package/plugins/isBetween/{index.js → index.mjs} +2 -3
- package/plugins/isLeapYear/{index.d.ts → index.d.mts} +1 -2
- package/plugins/isLeapYear/{index.js → index.mjs} +1 -2
- package/plugins/isSameOrAfter/{index.d.ts → index.d.mts} +1 -2
- package/plugins/isSameOrAfter/{index.js → index.mjs} +1 -2
- package/plugins/isSameOrBefore/{index.d.ts → index.d.mts} +1 -2
- package/plugins/isSameOrBefore/{index.js → index.mjs} +1 -2
- package/plugins/isToday/{index.d.ts → index.d.mts} +1 -2
- package/plugins/isToday/{index.js → index.mjs} +2 -3
- package/plugins/isTomorrow/{index.d.ts → index.d.mts} +1 -2
- package/plugins/isTomorrow/{index.js → index.mjs} +2 -3
- package/plugins/isYesterday/{index.d.ts → index.d.mts} +1 -2
- package/plugins/isYesterday/{index.js → index.mjs} +2 -3
- package/plugins/isoWeek/{index.d.ts → index.d.mts} +1 -3
- package/plugins/isoWeek/{index.js → index.mjs} +13 -25
- package/{chunks/St35qgL0.d.ts → plugins/locale/index.d.mts} +5 -4
- package/{chunks/CoBtJ4c1.js → plugins/locale/index.mjs} +13 -16
- package/plugins/localeData/index.d.mts +6 -0
- package/plugins/localeData/{index.js → index.mjs} +18 -11
- package/plugins/localizedFormat/index.d.mts +6 -0
- package/plugins/localizedFormat/{index.js → index.mjs} +5 -10
- package/plugins/localizedParse/index.d.mts +6 -0
- package/plugins/localizedParse/{index.js → index.mjs} +40 -22
- package/plugins/minMax/{index.d.ts → index.d.mts} +1 -2
- package/plugins/minMax/{index.js → index.mjs} +2 -3
- package/plugins/objectSupport/index.d.mts +6 -0
- package/plugins/objectSupport/{index.js → index.mjs} +33 -38
- package/plugins/pluralGetSet/{index.d.ts → index.d.mts} +1 -3
- package/plugins/pluralGetSet/{index.js → index.mjs} +1 -2
- package/plugins/quarterOfYear/{index.d.ts → index.d.mts} +1 -3
- package/plugins/quarterOfYear/{index.js → index.mjs} +11 -18
- package/plugins/relativeTime/index.d.mts +47 -0
- package/plugins/relativeTime/index.mjs +187 -0
- package/plugins/timezone/index.d.mts +6 -0
- package/plugins/timezone/index.mjs +456 -0
- package/plugins/toArray/{index.d.ts → index.d.mts} +1 -2
- package/plugins/toArray/{index.js → index.mjs} +1 -2
- package/plugins/toObject/{index.d.ts → index.d.mts} +1 -2
- package/plugins/toObject/{index.js → index.mjs} +1 -2
- package/plugins/utc/{index.d.ts → index.d.mts} +1 -2
- package/plugins/utc/{index.js → index.mjs} +37 -39
- package/plugins/week/{index.d.ts → index.d.mts} +1 -3
- package/plugins/week/{index.js → index.mjs} +17 -27
- package/chunks/BtmEtAW3.js +0 -43
- package/chunks/DjY7KvwG.js +0 -28
- package/index.d.ts +0 -3
- package/locales/af.d.ts +0 -8
- package/locales/am.d.ts +0 -8
- package/locales/ar-dz.d.ts +0 -11
- package/locales/ar-iq.d.ts +0 -11
- package/locales/ar-iq.js +0 -14
- package/locales/ar-kw.d.ts +0 -11
- package/locales/ar-ly.d.ts +0 -11
- package/locales/ar-ly.js +0 -14
- package/locales/ar-ma.d.ts +0 -11
- package/locales/ar-sa.d.ts +0 -11
- package/locales/ar-tn.d.ts +0 -11
- package/locales/ar.d.ts +0 -8
- package/locales/ar.js +0 -3
- package/locales/az.d.ts +0 -8
- package/locales/be.d.ts +0 -8
- package/locales/bg.d.ts +0 -8
- package/locales/bi.d.ts +0 -8
- package/locales/bm.d.ts +0 -8
- package/locales/bn-bd.d.ts +0 -11
- package/locales/bn.d.ts +0 -8
- package/locales/bn.js +0 -3
- package/locales/bo.d.ts +0 -8
- package/locales/br.d.ts +0 -8
- package/locales/bs.d.ts +0 -8
- package/locales/ca.d.ts +0 -8
- package/locales/cs.d.ts +0 -8
- package/locales/cv.d.ts +0 -8
- package/locales/cy.d.ts +0 -8
- package/locales/da.d.ts +0 -8
- package/locales/de-at.d.ts +0 -11
- package/locales/de-ch.d.ts +0 -11
- package/locales/de-ch.js +0 -14
- package/locales/de.d.ts +0 -8
- package/locales/de.js +0 -3
- package/locales/dv.d.ts +0 -8
- package/locales/el.d.ts +0 -8
- package/locales/en-au.d.ts +0 -11
- package/locales/en-ca.d.ts +0 -11
- package/locales/en-ie.d.ts +0 -11
- package/locales/en-il.d.ts +0 -11
- package/locales/en-in.d.ts +0 -11
- package/locales/en-nz.d.ts +0 -11
- package/locales/en-sg.d.ts +0 -11
- package/locales/en-tt.d.ts +0 -11
- package/locales/en-us.d.ts +0 -11
- package/locales/en-us.js +0 -13
- package/locales/en.d.ts +0 -8
- package/locales/en.js +0 -3
- package/locales/eo.d.ts +0 -8
- package/locales/es-do.d.ts +0 -11
- package/locales/es-mx.d.ts +0 -11
- package/locales/es-mx.js +0 -15
- package/locales/es-pr.d.ts +0 -11
- package/locales/es-pr.js +0 -18
- package/locales/es-us.d.ts +0 -11
- package/locales/es-us.js +0 -14
- package/locales/es.d.ts +0 -8
- package/locales/es.js +0 -3
- package/locales/et.d.ts +0 -8
- package/locales/eu.d.ts +0 -8
- package/locales/fa.d.ts +0 -8
- package/locales/fi.d.ts +0 -8
- package/locales/fil.d.ts +0 -8
- package/locales/fo.d.ts +0 -8
- package/locales/fr-ca.d.ts +0 -11
- package/locales/fr-ca.js +0 -18
- package/locales/fr-ch.d.ts +0 -11
- package/locales/fr-ch.js +0 -18
- package/locales/fr.d.ts +0 -8
- package/locales/fr.js +0 -3
- package/locales/fy.d.ts +0 -8
- package/locales/ga.d.ts +0 -8
- package/locales/gd.d.ts +0 -8
- package/locales/gl.d.ts +0 -8
- package/locales/gom-deva.d.ts +0 -8
- package/locales/gom-latn.d.ts +0 -8
- package/locales/gu.d.ts +0 -8
- package/locales/he.d.ts +0 -8
- package/locales/hi.d.ts +0 -8
- package/locales/hr.d.ts +0 -8
- package/locales/ht.d.ts +0 -8
- package/locales/hu.d.ts +0 -8
- package/locales/hy-am.d.ts +0 -8
- package/locales/id.d.ts +0 -8
- package/locales/is.d.ts +0 -8
- package/locales/it-ch.d.ts +0 -11
- package/locales/it.d.ts +0 -8
- package/locales/it.js +0 -3
- package/locales/jv.d.ts +0 -8
- package/locales/ka.d.ts +0 -8
- package/locales/kk.d.ts +0 -8
- package/locales/km.d.ts +0 -8
- package/locales/kn.d.ts +0 -8
- package/locales/ko.d.ts +0 -8
- package/locales/ku.d.ts +0 -8
- package/locales/ky.d.ts +0 -8
- package/locales/lb.d.ts +0 -8
- package/locales/lo.d.ts +0 -8
- package/locales/lt.d.ts +0 -8
- package/locales/lv.d.ts +0 -8
- package/locales/me.d.ts +0 -8
- package/locales/mi.d.ts +0 -8
- package/locales/mk.d.ts +0 -8
- package/locales/ml.d.ts +0 -8
- package/locales/mn.d.ts +0 -8
- package/locales/mr.d.ts +0 -8
- package/locales/ms-my.d.ts +0 -11
- package/locales/ms-my.js +0 -14
- package/locales/ms.d.ts +0 -8
- package/locales/ms.js +0 -3
- package/locales/mt.d.ts +0 -8
- package/locales/my.d.ts +0 -8
- package/locales/nb.d.ts +0 -8
- package/locales/ne.d.ts +0 -8
- package/locales/nl-be.d.ts +0 -11
- package/locales/nl-be.js +0 -18
- package/locales/nl.d.ts +0 -8
- package/locales/nl.js +0 -3
- package/locales/nn.d.ts +0 -8
- package/locales/oc-lnc.d.ts +0 -8
- package/locales/pa-in.d.ts +0 -8
- package/locales/pl.d.ts +0 -8
- package/locales/pt-br.d.ts +0 -11
- package/locales/pt.d.ts +0 -8
- package/locales/pt.js +0 -3
- package/locales/rn.d.ts +0 -8
- package/locales/ro.d.ts +0 -8
- package/locales/rw.d.ts +0 -8
- package/locales/sd.d.ts +0 -8
- package/locales/se.d.ts +0 -8
- package/locales/si.d.ts +0 -8
- package/locales/sk.d.ts +0 -8
- package/locales/sl.d.ts +0 -8
- package/locales/sq.d.ts +0 -8
- package/locales/sr-cyrl.d.ts +0 -11
- package/locales/sr.d.ts +0 -8
- package/locales/sr.js +0 -3
- package/locales/ss.d.ts +0 -8
- package/locales/sv-fi.d.ts +0 -11
- package/locales/sv.d.ts +0 -8
- package/locales/sv.js +0 -3
- package/locales/sw.d.ts +0 -8
- package/locales/ta.d.ts +0 -8
- package/locales/te.d.ts +0 -8
- package/locales/tet.d.ts +0 -8
- package/locales/tg.d.ts +0 -8
- package/locales/th.d.ts +0 -8
- package/locales/tk.d.ts +0 -8
- package/locales/tl-ph.d.ts +0 -8
- package/locales/tlh.d.ts +0 -8
- package/locales/tr.d.ts +0 -8
- package/locales/tzl.d.ts +0 -8
- package/locales/tzm-latn.d.ts +0 -11
- package/locales/tzm.d.ts +0 -8
- package/locales/tzm.js +0 -3
- package/locales/ug-cn.d.ts +0 -8
- package/locales/uk.d.ts +0 -8
- package/locales/ur.d.ts +0 -8
- package/locales/uz-latn.d.ts +0 -11
- package/locales/uz.d.ts +0 -8
- package/locales/uz.js +0 -3
- package/locales/vi.d.ts +0 -8
- package/locales/x-pseudo.d.ts +0 -8
- package/locales/yo.d.ts +0 -8
- package/locales/zh-cn.d.ts +0 -11
- package/locales/zh-cn.js +0 -14
- package/locales/zh-hk.d.ts +0 -11
- package/locales/zh-hk.js +0 -23
- package/locales/zh-mo.d.ts +0 -11
- package/locales/zh-mo.js +0 -23
- package/locales/zh-tw.d.ts +0 -11
- package/locales/zh-tw.js +0 -23
- package/locales/zh.js +0 -3
- package/plugins/advancedFormat/index.d.ts +0 -8
- package/plugins/advancedParse/index.d.ts +0 -8
- package/plugins/locale/index.d.ts +0 -4
- package/plugins/locale/index.js +0 -7
- package/plugins/localeData/index.d.ts +0 -8
- package/plugins/localizedFormat/index.d.ts +0 -8
- package/plugins/localizedParse/index.d.ts +0 -8
- package/plugins/objectSupport/index.d.ts +0 -8
- package/plugins/relativeTime/index.d.ts +0 -59
- package/plugins/relativeTime/index.js +0 -154
|
@@ -0,0 +1,477 @@
|
|
|
1
|
+
import { i as INVALID_DATE_STRING } from "../../chunks/BkjWOpMU.js";
|
|
2
|
+
import { a as isUndefined, r as isObject } from "../../chunks/v_QBn7Xm.js";
|
|
3
|
+
import { n as normalizeUnitWithPlurals, r as normalizeUnitWithPluralsToPlural } from "../../chunks/AyQQ6US-.js";
|
|
4
|
+
import { n as padStart } from "../../chunks/CdvTtmWL.js";
|
|
5
|
+
import { i as _checkPrivateRedeclaration, r as _assertClassBrand, t as esday } from "../../chunks/CXWzCl3n.js";
|
|
6
|
+
|
|
7
|
+
//#region \0@oxc-project+runtime@0.112.0/helpers/classPrivateFieldInitSpec.js
|
|
8
|
+
function _classPrivateFieldInitSpec(e, t, a) {
|
|
9
|
+
_checkPrivateRedeclaration(e, t), t.set(e, a);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region \0@oxc-project+runtime@0.112.0/helpers/classPrivateFieldSet2.js
|
|
14
|
+
function _classPrivateFieldSet2(s, a, r) {
|
|
15
|
+
return s.set(_assertClassBrand(s, a), r), r;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region \0@oxc-project+runtime@0.112.0/helpers/classPrivateFieldGet2.js
|
|
20
|
+
function _classPrivateFieldGet2(s, a) {
|
|
21
|
+
return s.get(_assertClassBrand(s, a));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/plugins/duration/index.ts
|
|
26
|
+
/** = 0:
|
|
27
|
+
* Duration plugin
|
|
28
|
+
*
|
|
29
|
+
* This plugin adds 'duration' and 'isDuration' to the esday factory.
|
|
30
|
+
*
|
|
31
|
+
* To use the humanize method or any of the locale methods, the plugin Locale,
|
|
32
|
+
* a loaded locale and the plugin RelativeTime are required.
|
|
33
|
+
*/
|
|
34
|
+
var _defaultLocale = /* @__PURE__ */ new WeakMap();
|
|
35
|
+
var _localeName = /* @__PURE__ */ new WeakMap();
|
|
36
|
+
var _detailsCache = /* @__PURE__ */ new WeakMap();
|
|
37
|
+
var _timeAsMs = /* @__PURE__ */ new WeakMap();
|
|
38
|
+
var _days = /* @__PURE__ */ new WeakMap();
|
|
39
|
+
var _months = /* @__PURE__ */ new WeakMap();
|
|
40
|
+
var _isValid = /* @__PURE__ */ new WeakMap();
|
|
41
|
+
var DurationImpl = class DurationImpl {
|
|
42
|
+
constructor(value, unit, localeName) {
|
|
43
|
+
_classPrivateFieldInitSpec(this, _defaultLocale, "en");
|
|
44
|
+
_classPrivateFieldInitSpec(this, _localeName, void 0);
|
|
45
|
+
_classPrivateFieldInitSpec(this, _detailsCache, {
|
|
46
|
+
years: 0,
|
|
47
|
+
quarters: 0,
|
|
48
|
+
months: 0,
|
|
49
|
+
weeks: 0,
|
|
50
|
+
days: 0,
|
|
51
|
+
hours: 0,
|
|
52
|
+
minutes: 0,
|
|
53
|
+
seconds: 0,
|
|
54
|
+
milliseconds: 0
|
|
55
|
+
});
|
|
56
|
+
_classPrivateFieldInitSpec(this, _timeAsMs, 0);
|
|
57
|
+
_classPrivateFieldInitSpec(this, _days, 0);
|
|
58
|
+
_classPrivateFieldInitSpec(this, _months, 0);
|
|
59
|
+
_classPrivateFieldInitSpec(this, _isValid, void 0);
|
|
60
|
+
this.absFloor = (number) => number < 0 ? Math.ceil(number) || 0 : Math.floor(number);
|
|
61
|
+
this.absCeil = (number) => number < 0 ? Math.floor(number) : Math.ceil(number);
|
|
62
|
+
this.sign = (number) => Number(number > 0) - Number(number < 0) || +number;
|
|
63
|
+
const numbersOnlyRegex = /^\d+$/gs;
|
|
64
|
+
const iso8601Regex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
|
|
65
|
+
const aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/;
|
|
66
|
+
_classPrivateFieldSet2(_localeName, this, localeName ?? _classPrivateFieldGet2(_defaultLocale, this));
|
|
67
|
+
const normalizedUnit = normalizeUnitWithPluralsToPlural(unit);
|
|
68
|
+
const parsedInputRaw = {};
|
|
69
|
+
const parsedInput = {
|
|
70
|
+
years: 0,
|
|
71
|
+
quarters: 0,
|
|
72
|
+
months: 0,
|
|
73
|
+
weeks: 0,
|
|
74
|
+
days: 0,
|
|
75
|
+
hours: 0,
|
|
76
|
+
minutes: 0,
|
|
77
|
+
seconds: 0,
|
|
78
|
+
milliseconds: 0
|
|
79
|
+
};
|
|
80
|
+
if (value === void 0 || value === null) parsedInputRaw.milliseconds = 0;
|
|
81
|
+
else if (value instanceof DurationImpl) {
|
|
82
|
+
const baseValues = value.durationBase();
|
|
83
|
+
parsedInputRaw.milliseconds = baseValues.milliseconds;
|
|
84
|
+
parsedInputRaw.days = baseValues.days;
|
|
85
|
+
parsedInputRaw.months = baseValues.months;
|
|
86
|
+
} else if (isObject(value)) {
|
|
87
|
+
value = this.normalizeInputObject(value);
|
|
88
|
+
const keys = Object.keys(value);
|
|
89
|
+
for (const stringKey of keys) {
|
|
90
|
+
const key = stringKey;
|
|
91
|
+
parsedInputRaw[key] = +value[key];
|
|
92
|
+
}
|
|
93
|
+
} else if (typeof value === "number") if (isUndefined(normalizedUnit)) parsedInputRaw.milliseconds = value;
|
|
94
|
+
else parsedInputRaw[this.toKeyOfDurationCache(normalizedUnit)] = value;
|
|
95
|
+
else if (typeof value === "string") {
|
|
96
|
+
let parsedIso;
|
|
97
|
+
let parsedAsp;
|
|
98
|
+
if (numbersOnlyRegex.test(value)) if (isUndefined(normalizedUnit)) parsedInputRaw.milliseconds = +value;
|
|
99
|
+
else parsedInputRaw[this.toKeyOfDurationCache(normalizedUnit)] = +value;
|
|
100
|
+
else if (parsedIso = iso8601Regex.exec(value)) {
|
|
101
|
+
const sign = parsedIso[1] === "-" ? -1 : 1;
|
|
102
|
+
const durationDetailsKeys = [
|
|
103
|
+
"years",
|
|
104
|
+
"months",
|
|
105
|
+
"weeks",
|
|
106
|
+
"days",
|
|
107
|
+
"hours",
|
|
108
|
+
"minutes",
|
|
109
|
+
"seconds",
|
|
110
|
+
"milliseconds"
|
|
111
|
+
];
|
|
112
|
+
const durationParts = parsedIso.slice(2);
|
|
113
|
+
for (let i = 0; i < durationParts.length; ++i) if (!isUndefined(durationParts[i]) && Number.isFinite(Number(durationParts[i].replace(",", ".")))) parsedInputRaw[durationDetailsKeys[i]] = Number(durationParts[i].replace(",", ".")) * sign;
|
|
114
|
+
} else if (parsedAsp = aspNetRegex.exec(value)) {
|
|
115
|
+
const sign = parsedAsp[1] === "-" ? -1 : 1;
|
|
116
|
+
const durationParts = parsedAsp.slice(2).map((value, index) => {
|
|
117
|
+
let valueAsNumber = 0;
|
|
118
|
+
if (!isUndefined(value) && Number.isFinite(Number(value))) if (index !== 4) valueAsNumber = this.absFloor(Number(value)) * sign;
|
|
119
|
+
else valueAsNumber = Math.round(Number(value) * 1e3) * sign;
|
|
120
|
+
return valueAsNumber;
|
|
121
|
+
});
|
|
122
|
+
[parsedInputRaw.days, parsedInputRaw.hours, parsedInputRaw.minutes, parsedInputRaw.seconds, parsedInputRaw.milliseconds] = durationParts;
|
|
123
|
+
}
|
|
124
|
+
} else parsedInputRaw.milliseconds = 1;
|
|
125
|
+
_classPrivateFieldSet2(_isValid, this, this.isDurationValid(parsedInputRaw));
|
|
126
|
+
Object.assign(parsedInput, parsedInputRaw);
|
|
127
|
+
this.setTimeDaysMonths(parsedInput);
|
|
128
|
+
this.setDetailsCache();
|
|
129
|
+
}
|
|
130
|
+
isValid() {
|
|
131
|
+
return _classPrivateFieldGet2(_isValid, this);
|
|
132
|
+
}
|
|
133
|
+
clone() {
|
|
134
|
+
return new DurationImpl(this.durationBase(), void 0, _classPrivateFieldGet2(_localeName, this));
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Format Duration as ISO string.
|
|
138
|
+
* For ISO strings we do not use the normal bubbling rules:
|
|
139
|
+
* * milliseconds bubble up until they become hours
|
|
140
|
+
* * days do not bubble at all
|
|
141
|
+
* * months bubble up until they become years
|
|
142
|
+
* This is because there is no context-free conversion between
|
|
143
|
+
* hours and days (think of clock changes) and also not between
|
|
144
|
+
* days and months (28-31 days per month)
|
|
145
|
+
* @returns Duration formatted as ISO string
|
|
146
|
+
*/
|
|
147
|
+
toISOString() {
|
|
148
|
+
if (!this.isValid()) return INVALID_DATE_STRING;
|
|
149
|
+
let seconds = Math.abs(_classPrivateFieldGet2(_timeAsMs, this)) / 1e3;
|
|
150
|
+
const days = Math.abs(_classPrivateFieldGet2(_days, this));
|
|
151
|
+
let months = Math.abs(_classPrivateFieldGet2(_months, this));
|
|
152
|
+
const total = this.asSeconds();
|
|
153
|
+
if (!total) return "P0D";
|
|
154
|
+
let minutes = this.absFloor(seconds / 60);
|
|
155
|
+
const hours = this.absFloor(minutes / 60);
|
|
156
|
+
seconds %= 60;
|
|
157
|
+
minutes %= 60;
|
|
158
|
+
const years = this.absFloor(months / 12);
|
|
159
|
+
months %= 12;
|
|
160
|
+
const s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, "") : "";
|
|
161
|
+
const totalSign = total < 0 ? "-" : "";
|
|
162
|
+
const ymSign = this.sign(_classPrivateFieldGet2(_months, this)) !== this.sign(total) ? "-" : "";
|
|
163
|
+
const daysSign = this.sign(_classPrivateFieldGet2(_days, this)) !== this.sign(total) ? "-" : "";
|
|
164
|
+
const hmsSign = this.sign(_classPrivateFieldGet2(_timeAsMs, this)) !== this.sign(total) ? "-" : "";
|
|
165
|
+
return totalSign + "P" + (years ? `${ymSign}${years}Y` : "") + (months ? `${ymSign}${months}M` : "") + (days ? `${daysSign}${days}D` : "") + (hours || minutes || seconds ? "T" : "") + (hours ? `${hmsSign}${hours}H` : "") + (minutes ? `${hmsSign}${minutes}M` : "") + (seconds ? `${hmsSign}${s}S` : "");
|
|
166
|
+
}
|
|
167
|
+
toString() {
|
|
168
|
+
return this.toISOString();
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Generate a value used by JSON.stringify to serialize Duration object
|
|
172
|
+
* @returns same string as toISOString()
|
|
173
|
+
*/
|
|
174
|
+
toJSON() {
|
|
175
|
+
return this.toISOString();
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Stringify this instance as JSON.
|
|
179
|
+
* Unit 'quarters' and 'weeks' are ignored, as they are only values derived from days / months / years.
|
|
180
|
+
* @returns a string representation of this instance
|
|
181
|
+
*/
|
|
182
|
+
asStringifiedJSON() {
|
|
183
|
+
const { quarters, weeks, ...durationProperties } = _classPrivateFieldGet2(_detailsCache, this);
|
|
184
|
+
return JSON.stringify(durationProperties);
|
|
185
|
+
}
|
|
186
|
+
valueOf() {
|
|
187
|
+
return this.asMilliseconds();
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Format the duration as a comprehensive string.
|
|
191
|
+
* @param formatStr - format to use for formatting
|
|
192
|
+
* @returns formatted duration
|
|
193
|
+
*/
|
|
194
|
+
format(formatStr) {
|
|
195
|
+
const REGEX_FORMAT = /\[([^\]]+)]|YYYY|Y{1,2}|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g;
|
|
196
|
+
const str = formatStr || "YYYY-MM-DDTHH:mm:ss.SSS";
|
|
197
|
+
const matches = {
|
|
198
|
+
Y: _classPrivateFieldGet2(_detailsCache, this).years,
|
|
199
|
+
YY: padStart(_classPrivateFieldGet2(_detailsCache, this).years, 2, "0"),
|
|
200
|
+
YYYY: padStart(_classPrivateFieldGet2(_detailsCache, this).years, 4, "0"),
|
|
201
|
+
M: _classPrivateFieldGet2(_detailsCache, this).months,
|
|
202
|
+
MM: padStart(_classPrivateFieldGet2(_detailsCache, this).months, 2, "0"),
|
|
203
|
+
D: _classPrivateFieldGet2(_detailsCache, this).days,
|
|
204
|
+
DD: padStart(_classPrivateFieldGet2(_detailsCache, this).days, 2, "0"),
|
|
205
|
+
H: _classPrivateFieldGet2(_detailsCache, this).hours,
|
|
206
|
+
HH: padStart(_classPrivateFieldGet2(_detailsCache, this).hours, 2, "0"),
|
|
207
|
+
m: _classPrivateFieldGet2(_detailsCache, this).minutes,
|
|
208
|
+
mm: padStart(_classPrivateFieldGet2(_detailsCache, this).minutes, 2, "0"),
|
|
209
|
+
s: _classPrivateFieldGet2(_detailsCache, this).seconds,
|
|
210
|
+
ss: padStart(_classPrivateFieldGet2(_detailsCache, this).seconds, 2, "0"),
|
|
211
|
+
SSS: padStart(_classPrivateFieldGet2(_detailsCache, this).milliseconds, 3, "0")
|
|
212
|
+
};
|
|
213
|
+
return str.replace(REGEX_FORMAT, (match) => String(matches[match]));
|
|
214
|
+
}
|
|
215
|
+
humanize(p1, thresholds) {
|
|
216
|
+
if (!this.isValid()) return INVALID_DATE_STRING;
|
|
217
|
+
let withSuffix = false;
|
|
218
|
+
if (typeof p1 === "boolean") withSuffix = p1;
|
|
219
|
+
let thresholdsToUse = Object.assign({}, esday.defaultThresholds(), thresholds);
|
|
220
|
+
if (typeof p1 === "object") thresholdsToUse = Object.assign(thresholdsToUse, p1);
|
|
221
|
+
const locale = esday.getLocale(this.locale());
|
|
222
|
+
const diffAsUnits = {
|
|
223
|
+
s: this.asSeconds(),
|
|
224
|
+
m: this.asMinutes(),
|
|
225
|
+
h: this.asHours(),
|
|
226
|
+
d: this.asDays(),
|
|
227
|
+
w: this.asWeeks(),
|
|
228
|
+
M: this.asMonths(),
|
|
229
|
+
y: this.asYears()
|
|
230
|
+
};
|
|
231
|
+
return esday.formatDifference(diffAsUnits, !withSuffix, locale, thresholdsToUse);
|
|
232
|
+
}
|
|
233
|
+
add(input, unit) {
|
|
234
|
+
return this.addDurationImpl(input, unit);
|
|
235
|
+
}
|
|
236
|
+
subtract(input, unit) {
|
|
237
|
+
return this.addDurationImpl(input, unit, true);
|
|
238
|
+
}
|
|
239
|
+
locale(locale) {
|
|
240
|
+
if (isUndefined(locale)) return _classPrivateFieldGet2(_localeName, this);
|
|
241
|
+
return new DurationImpl(this, void 0, locale);
|
|
242
|
+
}
|
|
243
|
+
localeObject() {
|
|
244
|
+
return esday.getLocale(this.locale());
|
|
245
|
+
}
|
|
246
|
+
get(unit) {
|
|
247
|
+
if (this.isValid()) return _classPrivateFieldGet2(_detailsCache, this)[this.toKeyOfDurationCache(unit)];
|
|
248
|
+
else return NaN;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Gets the duration calculated as 'unit' value
|
|
252
|
+
* @param unit - unit to use to calculate the return value
|
|
253
|
+
* @returns duration as unit
|
|
254
|
+
*/
|
|
255
|
+
as(unit) {
|
|
256
|
+
if (!this.isValid()) return NaN;
|
|
257
|
+
let days;
|
|
258
|
+
let months;
|
|
259
|
+
const milliseconds = _classPrivateFieldGet2(_timeAsMs, this);
|
|
260
|
+
const units = normalizeUnitWithPlurals(unit);
|
|
261
|
+
if (units === "month" || units === "quarter" || units === "year") {
|
|
262
|
+
days = _classPrivateFieldGet2(_days, this) + milliseconds / 864e5;
|
|
263
|
+
months = _classPrivateFieldGet2(_months, this) + this.daysToMonths(days);
|
|
264
|
+
switch (units) {
|
|
265
|
+
case "month": return months;
|
|
266
|
+
case "quarter": return months / 3;
|
|
267
|
+
case "year": return months / 12;
|
|
268
|
+
}
|
|
269
|
+
} else {
|
|
270
|
+
days = _classPrivateFieldGet2(_days, this) + Math.round(this.monthsToDays(_classPrivateFieldGet2(_months, this)));
|
|
271
|
+
switch (units) {
|
|
272
|
+
case "week": return days / 7 + milliseconds / 6048e5;
|
|
273
|
+
case "day": return days + milliseconds / 864e5;
|
|
274
|
+
case "hour": return days * 24 + milliseconds / 36e5;
|
|
275
|
+
case "minute": return days * 1440 + milliseconds / 6e4;
|
|
276
|
+
case "second": return days * 86400 + milliseconds / 1e3;
|
|
277
|
+
case "millisecond": return Math.floor(days * 864e5) + milliseconds;
|
|
278
|
+
default: throw new Error(`Unknown unit ${units}`);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
milliseconds() {
|
|
283
|
+
return this.get("milliseconds");
|
|
284
|
+
}
|
|
285
|
+
asMilliseconds() {
|
|
286
|
+
return this.as("milliseconds");
|
|
287
|
+
}
|
|
288
|
+
seconds() {
|
|
289
|
+
return this.get("seconds");
|
|
290
|
+
}
|
|
291
|
+
asSeconds() {
|
|
292
|
+
return this.as("seconds");
|
|
293
|
+
}
|
|
294
|
+
minutes() {
|
|
295
|
+
return this.get("minutes");
|
|
296
|
+
}
|
|
297
|
+
asMinutes() {
|
|
298
|
+
return this.as("minutes");
|
|
299
|
+
}
|
|
300
|
+
hours() {
|
|
301
|
+
return this.get("hours");
|
|
302
|
+
}
|
|
303
|
+
asHours() {
|
|
304
|
+
return this.as("hours");
|
|
305
|
+
}
|
|
306
|
+
days() {
|
|
307
|
+
return this.get("days");
|
|
308
|
+
}
|
|
309
|
+
asDays() {
|
|
310
|
+
return this.as("days");
|
|
311
|
+
}
|
|
312
|
+
weeks() {
|
|
313
|
+
return this.absFloor(this.days() / 7);
|
|
314
|
+
}
|
|
315
|
+
asWeeks() {
|
|
316
|
+
return this.as("weeks");
|
|
317
|
+
}
|
|
318
|
+
months() {
|
|
319
|
+
return this.get("months");
|
|
320
|
+
}
|
|
321
|
+
asMonths() {
|
|
322
|
+
return this.as("months");
|
|
323
|
+
}
|
|
324
|
+
quarters() {
|
|
325
|
+
return this.get("quarters");
|
|
326
|
+
}
|
|
327
|
+
asQuarters() {
|
|
328
|
+
return this.as("quarters");
|
|
329
|
+
}
|
|
330
|
+
years() {
|
|
331
|
+
return this.get("years");
|
|
332
|
+
}
|
|
333
|
+
asYears() {
|
|
334
|
+
return this.as("years");
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Get an object literal with the internal data to recreate a clone of
|
|
338
|
+
* a duration instance (milliseconds, days, months). These values are different
|
|
339
|
+
* from the values returned by e.g. durationInstance.days().
|
|
340
|
+
* @description for use in Duration plugin to generate a Duration object from a Duration object
|
|
341
|
+
* @returns an object literal with the internal data of a duration object
|
|
342
|
+
*/
|
|
343
|
+
durationBase() {
|
|
344
|
+
return {
|
|
345
|
+
milliseconds: _classPrivateFieldGet2(_timeAsMs, this),
|
|
346
|
+
days: _classPrivateFieldGet2(_days, this),
|
|
347
|
+
months: _classPrivateFieldGet2(_months, this)
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
toKeyOfDurationCache(unit) {
|
|
351
|
+
return normalizeUnitWithPluralsToPlural(unit);
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Do the given input values represent a valid duration?
|
|
355
|
+
* @param parsedInput - object containing all values found in input string
|
|
356
|
+
* @returns true=input defines a valid duration
|
|
357
|
+
*/
|
|
358
|
+
isDurationValid(parsedInput) {
|
|
359
|
+
const ordering = [
|
|
360
|
+
"years",
|
|
361
|
+
"quarters",
|
|
362
|
+
"months",
|
|
363
|
+
"weeks",
|
|
364
|
+
"days",
|
|
365
|
+
"hours",
|
|
366
|
+
"minutes",
|
|
367
|
+
"seconds",
|
|
368
|
+
"milliseconds"
|
|
369
|
+
];
|
|
370
|
+
for (const key in parsedInput) {
|
|
371
|
+
const value = parsedInput[key];
|
|
372
|
+
if (ordering.indexOf(key) === -1 || value === null || Number.isNaN(value)) return false;
|
|
373
|
+
}
|
|
374
|
+
let unitHasDecimal = false;
|
|
375
|
+
const orderLen = ordering.length;
|
|
376
|
+
for (let i = 0; i < orderLen; ++i) {
|
|
377
|
+
const value = parsedInput[ordering[i]];
|
|
378
|
+
if (!isUndefined(value)) {
|
|
379
|
+
if (unitHasDecimal) return false;
|
|
380
|
+
if (!Number.isInteger(value)) unitHasDecimal = true;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
return true;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Normalize the keys in the object defining a duration.
|
|
387
|
+
* @param input - object containing duration definition with short, long or plural keys
|
|
388
|
+
* @returns object containing duration definition with plural keys
|
|
389
|
+
*/
|
|
390
|
+
normalizeInputObject(input) {
|
|
391
|
+
const normalizedInput = {};
|
|
392
|
+
let normalizedProp;
|
|
393
|
+
for (const prop in input) {
|
|
394
|
+
normalizedProp = normalizeUnitWithPluralsToPlural(prop);
|
|
395
|
+
if (!isUndefined(normalizedProp)) normalizedInput[normalizedProp] = input[prop];
|
|
396
|
+
}
|
|
397
|
+
return normalizedInput;
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Calculate #timeAsMs, #days and #months from parsed input
|
|
401
|
+
*/
|
|
402
|
+
setTimeDaysMonths(parsedInput) {
|
|
403
|
+
_classPrivateFieldSet2(_timeAsMs, this, parsedInput.milliseconds + parsedInput.seconds * 1e3 + parsedInput.minutes * 1e3 * 60 + parsedInput.hours * 1e3 * 60 * 60);
|
|
404
|
+
_classPrivateFieldSet2(_days, this, parsedInput.days + parsedInput.weeks * 7);
|
|
405
|
+
_classPrivateFieldSet2(_months, this, parsedInput.months + parsedInput.quarters * 3 + parsedInput.years * 12);
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Update cached duration details (seconds, minutes, etc)
|
|
409
|
+
* from #timeAsMs, #days and #months
|
|
410
|
+
*/
|
|
411
|
+
setDetailsCache() {
|
|
412
|
+
let milliseconds = _classPrivateFieldGet2(_timeAsMs, this);
|
|
413
|
+
let days = _classPrivateFieldGet2(_days, this);
|
|
414
|
+
let months = _classPrivateFieldGet2(_months, this);
|
|
415
|
+
if (!(milliseconds >= 0 && days >= 0 && months >= 0 || milliseconds <= 0 && days <= 0 && months <= 0)) {
|
|
416
|
+
milliseconds += this.absCeil(this.monthsToDays(months) + days) * 864e5;
|
|
417
|
+
days = 0;
|
|
418
|
+
months = 0;
|
|
419
|
+
}
|
|
420
|
+
_classPrivateFieldGet2(_detailsCache, this).milliseconds = milliseconds % 1e3;
|
|
421
|
+
const seconds = this.absFloor(milliseconds / 1e3);
|
|
422
|
+
_classPrivateFieldGet2(_detailsCache, this).seconds = seconds % 60;
|
|
423
|
+
const minutes = this.absFloor(seconds / 60);
|
|
424
|
+
_classPrivateFieldGet2(_detailsCache, this).minutes = minutes % 60;
|
|
425
|
+
const hours = this.absFloor(minutes / 60);
|
|
426
|
+
_classPrivateFieldGet2(_detailsCache, this).hours = hours % 24;
|
|
427
|
+
days += this.absFloor(hours / 24);
|
|
428
|
+
const monthsFromDays = this.absFloor(this.daysToMonths(days));
|
|
429
|
+
months += monthsFromDays;
|
|
430
|
+
days -= this.absCeil(this.monthsToDays(monthsFromDays));
|
|
431
|
+
const years = this.absFloor(months / 12);
|
|
432
|
+
months %= 12;
|
|
433
|
+
_classPrivateFieldGet2(_detailsCache, this).days = days;
|
|
434
|
+
_classPrivateFieldGet2(_detailsCache, this).months = months;
|
|
435
|
+
_classPrivateFieldGet2(_detailsCache, this).years = years;
|
|
436
|
+
_classPrivateFieldGet2(_detailsCache, this).weeks = this.absFloor(days / 7);
|
|
437
|
+
_classPrivateFieldGet2(_detailsCache, this).quarters = this.absFloor(_classPrivateFieldGet2(_detailsCache, this).months / 3);
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* Convert days to months taking into account leap year rules:
|
|
441
|
+
* 400 years have exactly 146097 days (no fractional part left)
|
|
442
|
+
* 400 years have exactly 4800 months (12 months a year)
|
|
443
|
+
* @param days - days to convert to months
|
|
444
|
+
* @returns number of months
|
|
445
|
+
*/
|
|
446
|
+
daysToMonths(days) {
|
|
447
|
+
return days * 4800 / 146097;
|
|
448
|
+
}
|
|
449
|
+
monthsToDays(months) {
|
|
450
|
+
return months * 146097 / 4800;
|
|
451
|
+
}
|
|
452
|
+
addDurationImpl(value, unit, isSubtract) {
|
|
453
|
+
let durationToAdd;
|
|
454
|
+
const direction = isSubtract ? -1 : 1;
|
|
455
|
+
if (typeof value === "number") durationToAdd = new DurationImpl(value, unit, this.locale());
|
|
456
|
+
else if (value instanceof DurationImpl) durationToAdd = value;
|
|
457
|
+
else durationToAdd = new DurationImpl(value, void 0, this.locale());
|
|
458
|
+
const valuesToAdd = durationToAdd.durationBase();
|
|
459
|
+
return new DurationImpl({
|
|
460
|
+
milliseconds: _classPrivateFieldGet2(_timeAsMs, this) + direction * valuesToAdd.milliseconds,
|
|
461
|
+
days: _classPrivateFieldGet2(_days, this) + direction * valuesToAdd.days,
|
|
462
|
+
months: _classPrivateFieldGet2(_months, this) + direction * valuesToAdd.months
|
|
463
|
+
}, void 0, this.locale());
|
|
464
|
+
}
|
|
465
|
+
};
|
|
466
|
+
const durationPlugin = (_, _dayClass, dayFactory) => {
|
|
467
|
+
dayFactory.duration = (input, unit) => {
|
|
468
|
+
const locale = dayFactory.locale?.();
|
|
469
|
+
return new DurationImpl(input, unit, locale);
|
|
470
|
+
};
|
|
471
|
+
dayFactory.isDuration = (d) => {
|
|
472
|
+
return d instanceof DurationImpl;
|
|
473
|
+
};
|
|
474
|
+
};
|
|
475
|
+
|
|
476
|
+
//#endregion
|
|
477
|
+
export { durationPlugin as default };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../../chunks/MtjcOKi-.js";
|
|
1
|
+
import { M as UnitType, o as EsDayPlugin, r as DateType } from "../../chunks/CODi8AFH.js";
|
|
3
2
|
|
|
4
3
|
//#region src/plugins/isBetween/index.d.ts
|
|
5
4
|
declare module 'esday' {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { constants_default } from "../../chunks/
|
|
1
|
+
import { p as constants_default } from "../../chunks/BkjWOpMU.js";
|
|
2
2
|
|
|
3
3
|
//#region src/plugins/isBetween/index.ts
|
|
4
4
|
const isBetweenPlugin = (_, dayClass) => {
|
|
@@ -10,7 +10,6 @@ const isBetweenPlugin = (_, dayClass) => {
|
|
|
10
10
|
return isAfterFrom && isBeforeTo;
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
|
-
var isBetween_default = isBetweenPlugin;
|
|
14
13
|
|
|
15
14
|
//#endregion
|
|
16
|
-
export {
|
|
15
|
+
export { isBetweenPlugin as default };
|
|
@@ -5,7 +5,6 @@ const isLeapYearPlugin = (_, dayClass) => {
|
|
|
5
5
|
return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
|
|
6
6
|
};
|
|
7
7
|
};
|
|
8
|
-
var isLeapYear_default = isLeapYearPlugin;
|
|
9
8
|
|
|
10
9
|
//#endregion
|
|
11
|
-
export {
|
|
10
|
+
export { isLeapYearPlugin as default };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../../chunks/MtjcOKi-.js";
|
|
1
|
+
import { M as UnitType, o as EsDayPlugin, r as DateType } from "../../chunks/CODi8AFH.js";
|
|
3
2
|
|
|
4
3
|
//#region src/plugins/isSameOrAfter/index.d.ts
|
|
5
4
|
declare module 'esday' {
|
|
@@ -4,7 +4,6 @@ const isSameOrAfterPlugin = (_, dayClass) => {
|
|
|
4
4
|
return this.isSame(that, unit) || this.isAfter(that, unit);
|
|
5
5
|
};
|
|
6
6
|
};
|
|
7
|
-
var isSameOrAfter_default = isSameOrAfterPlugin;
|
|
8
7
|
|
|
9
8
|
//#endregion
|
|
10
|
-
export {
|
|
9
|
+
export { isSameOrAfterPlugin as default };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../../chunks/MtjcOKi-.js";
|
|
1
|
+
import { M as UnitType, o as EsDayPlugin, r as DateType } from "../../chunks/CODi8AFH.js";
|
|
3
2
|
|
|
4
3
|
//#region src/plugins/isSameOrBefore/index.d.ts
|
|
5
4
|
declare module 'esday' {
|
|
@@ -4,7 +4,6 @@ const isSameOrBeforePlugin = (_, dayClass) => {
|
|
|
4
4
|
return this.isSame(that, unit) || this.isBefore(that, unit);
|
|
5
5
|
};
|
|
6
6
|
};
|
|
7
|
-
var isSameOrBefore_default = isSameOrBeforePlugin;
|
|
8
7
|
|
|
9
8
|
//#endregion
|
|
10
|
-
export {
|
|
9
|
+
export { isSameOrBeforePlugin as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { constants_default } from "../../chunks/
|
|
1
|
+
import { p as constants_default } from "../../chunks/BkjWOpMU.js";
|
|
2
2
|
|
|
3
3
|
//#region src/plugins/isToday/index.ts
|
|
4
4
|
const isTodayPlugin = (_, dayClass) => {
|
|
@@ -6,7 +6,6 @@ const isTodayPlugin = (_, dayClass) => {
|
|
|
6
6
|
return this.isSame(/* @__PURE__ */ new Date(), constants_default.DAY);
|
|
7
7
|
};
|
|
8
8
|
};
|
|
9
|
-
var isToday_default = isTodayPlugin;
|
|
10
9
|
|
|
11
10
|
//#endregion
|
|
12
|
-
export {
|
|
11
|
+
export { isTodayPlugin as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { constants_default } from "../../chunks/
|
|
1
|
+
import { p as constants_default } from "../../chunks/BkjWOpMU.js";
|
|
2
2
|
|
|
3
3
|
//#region src/plugins/isTomorrow/index.ts
|
|
4
4
|
const isTomorrowPlugin = (_, dayClass, d) => {
|
|
@@ -8,7 +8,6 @@ const isTomorrowPlugin = (_, dayClass, d) => {
|
|
|
8
8
|
return this.format(comparisonTemplate) === tomorrow.format(comparisonTemplate);
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
|
-
var isTomorrow_default = isTomorrowPlugin;
|
|
12
11
|
|
|
13
12
|
//#endregion
|
|
14
|
-
export {
|
|
13
|
+
export { isTomorrowPlugin as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { constants_default } from "../../chunks/
|
|
1
|
+
import { p as constants_default } from "../../chunks/BkjWOpMU.js";
|
|
2
2
|
|
|
3
3
|
//#region src/plugins/isYesterday/index.ts
|
|
4
4
|
const isYesterdayPlugin = (_, dayClass, d) => {
|
|
@@ -8,7 +8,6 @@ const isYesterdayPlugin = (_, dayClass, d) => {
|
|
|
8
8
|
return this.format(comparisonTemplate) === yesterday.format(comparisonTemplate);
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
|
-
var isYesterday_default = isYesterdayPlugin;
|
|
12
11
|
|
|
13
12
|
//#endregion
|
|
14
|
-
export {
|
|
13
|
+
export { isYesterdayPlugin as default };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { EsDayPlugin } from "../../chunks/
|
|
2
|
-
import "../../chunks/MtjcOKi-.js";
|
|
1
|
+
import { o as EsDayPlugin } from "../../chunks/CODi8AFH.js";
|
|
3
2
|
|
|
4
3
|
//#region src/plugins/isoWeek/index.d.ts
|
|
5
|
-
|
|
6
4
|
declare module 'esday' {
|
|
7
5
|
interface EsDay {
|
|
8
6
|
isoWeek(): number;
|