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
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { constants_default } from "../../chunks/
|
|
2
|
-
import { isUndefined } from "../../chunks/
|
|
3
|
-
import { createInstanceFromExist } from "../../chunks/
|
|
4
|
-
import { padStart } from "../../chunks/
|
|
1
|
+
import { p as constants_default } from "../../chunks/BkjWOpMU.js";
|
|
2
|
+
import { a as isUndefined } from "../../chunks/v_QBn7Xm.js";
|
|
3
|
+
import { t as createInstanceFromExist } from "../../chunks/Shk32pTP.js";
|
|
4
|
+
import { n as padStart } from "../../chunks/CdvTtmWL.js";
|
|
5
5
|
|
|
6
6
|
//#region src/plugins/isoWeek/index.ts
|
|
7
7
|
const weekStart = constants_default.INDEX_MONDAY;
|
|
@@ -43,8 +43,7 @@ function addIsoWeekProperty(property) {
|
|
|
43
43
|
* @returns converted 4-digit year
|
|
44
44
|
*/
|
|
45
45
|
function parseTwoDigitYear(input) {
|
|
46
|
-
const
|
|
47
|
-
const year = +inputLimited;
|
|
46
|
+
const year = +input.slice(0, 2);
|
|
48
47
|
return year + (year > 68 ? 1900 : 2e3);
|
|
49
48
|
}
|
|
50
49
|
/**
|
|
@@ -71,8 +70,7 @@ const isoWeekPlugin = (_, dayClass, dayFactory) => {
|
|
|
71
70
|
if (!(Number.isNaN(parsedDate.valueOf()) || isUndefined(parsedElements.isoWeek)) && isUndefined(parsedElements.date)) {
|
|
72
71
|
const newEsday = createInstanceFromExist(parsedDate, this);
|
|
73
72
|
const parsedIsoWeek = parsedElements.isoWeek;
|
|
74
|
-
|
|
75
|
-
modifiedDate = modifiedEsday.toDate();
|
|
73
|
+
modifiedDate = newEsday.isoWeek(parsedIsoWeek).isoWeekday(weekStart).toDate();
|
|
76
74
|
}
|
|
77
75
|
return modifiedDate;
|
|
78
76
|
}
|
|
@@ -89,8 +87,7 @@ const isoWeekPlugin = (_, dayClass, dayFactory) => {
|
|
|
89
87
|
if (!(Number.isNaN(parsedDate.valueOf()) || isUndefined(parsedElements.isoWeekday)) && isUndefined(parsedElements.month)) {
|
|
90
88
|
const newEsday = createInstanceFromExist(parsedDate, this);
|
|
91
89
|
const newIsoWeekday = parsedElements.isoWeekday;
|
|
92
|
-
|
|
93
|
-
modifiedDate = modifiedEsday.toDate();
|
|
90
|
+
modifiedDate = newEsday.isoWeekday(newIsoWeekday).toDate();
|
|
94
91
|
}
|
|
95
92
|
return modifiedDate;
|
|
96
93
|
}
|
|
@@ -111,10 +108,7 @@ const isoWeekPlugin = (_, dayClass, dayFactory) => {
|
|
|
111
108
|
let modifiedEsday = newEsday.isoWeekYear(parsedIsoWeekYear);
|
|
112
109
|
modifiedEsday = modifiedEsday.year(parsedIsoWeekYear).isoWeek(1).isoWeekday(1);
|
|
113
110
|
modifiedDate = modifiedEsday.toDate();
|
|
114
|
-
} else if (!isUndefined(parsedElements.isoWeek))
|
|
115
|
-
const modifiedEsday = newEsday.isoWeekYear(parsedIsoWeekYear);
|
|
116
|
-
modifiedDate = modifiedEsday.toDate();
|
|
117
|
-
}
|
|
111
|
+
} else if (!isUndefined(parsedElements.isoWeek)) modifiedDate = newEsday.isoWeekYear(parsedIsoWeekYear).toDate();
|
|
118
112
|
}
|
|
119
113
|
return modifiedDate;
|
|
120
114
|
}
|
|
@@ -131,8 +125,7 @@ const isoWeekPlugin = (_, dayClass, dayFactory) => {
|
|
|
131
125
|
return this.add((newIsoWeek - this.isoWeek()) * 7, constants_default.DAY).isoWeekday(currentWeekday).hour(h, m, s, ms);
|
|
132
126
|
}
|
|
133
127
|
let yearStartDate = this.month(0, yearStart).hour(0, 0, 0, 0);
|
|
134
|
-
const
|
|
135
|
-
const diffToWeekStart = (7 + yearStartWeekday - weekStart) % 7;
|
|
128
|
+
const diffToWeekStart = (7 + yearStartDate.day() - weekStart) % 7;
|
|
136
129
|
yearStartDate = yearStartDate.subtract(diffToWeekStart, constants_default.DAY);
|
|
137
130
|
if (this.valueOf() < yearStartDate.valueOf()) return this.subtract(1, constants_default.YEAR).isoWeeksInYear();
|
|
138
131
|
return this.diff(yearStartDate, constants_default.WEEK) + 1;
|
|
@@ -185,21 +178,17 @@ const isoWeekPlugin = (_, dayClass, dayFactory) => {
|
|
|
185
178
|
};
|
|
186
179
|
const oldEndOf = proto.endOf;
|
|
187
180
|
proto.endOf = function(units) {
|
|
188
|
-
if (units === constants_default.ISOWEEK)
|
|
189
|
-
const weekEnd = 7;
|
|
190
|
-
return this.date(this.date() + (weekEnd - this.isoWeekday())).endOf(constants_default.DAY);
|
|
191
|
-
}
|
|
181
|
+
if (units === constants_default.ISOWEEK) return this.date(this.date() + (7 - this.isoWeekday())).endOf(constants_default.DAY);
|
|
192
182
|
return oldEndOf.call(this, units);
|
|
193
183
|
};
|
|
194
|
-
|
|
184
|
+
dayFactory.addFormatTokenDefinitions({
|
|
195
185
|
W: (sourceDate) => sourceDate.isoWeek().toString(),
|
|
196
186
|
WW: (sourceDate) => padStart(sourceDate.isoWeek(), 2, "0"),
|
|
197
187
|
Wo: (sourceDate) => toOrdinal(sourceDate, sourceDate.isoWeek()),
|
|
198
188
|
E: (sourceDate) => sourceDate.isoWeekday().toString(),
|
|
199
189
|
GG: (sourceDate) => padStart(sourceDate.isoWeekYear(), 2, "0").slice(-2),
|
|
200
190
|
GGGG: (sourceDate) => padStart(sourceDate.isoWeekYear(), 4, "0")
|
|
201
|
-
};
|
|
202
|
-
dayFactory.addFormatTokenDefinitions(additionalTokens);
|
|
191
|
+
});
|
|
203
192
|
const parseTokensDefinitions = {
|
|
204
193
|
W: [
|
|
205
194
|
match1to2,
|
|
@@ -234,7 +223,6 @@ const isoWeekPlugin = (_, dayClass, dayFactory) => {
|
|
|
234
223
|
};
|
|
235
224
|
dayFactory.addParseTokenDefinitions?.(parseTokensDefinitions);
|
|
236
225
|
};
|
|
237
|
-
var isoWeek_default = isoWeekPlugin;
|
|
238
226
|
|
|
239
227
|
//#endregion
|
|
240
|
-
export {
|
|
228
|
+
export { isoWeekPlugin as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { o as EsDayPlugin, t as EsDay } from "../../chunks/CODi8AFH.js";
|
|
2
2
|
|
|
3
3
|
//#region src/plugins/locale/types.d.ts
|
|
4
4
|
type ReadonlyTuple<T, N extends number, R extends readonly T[] = []> = R['length'] extends N ? R : ReadonlyTuple<T, N, readonly [T, ...R]>;
|
|
@@ -46,8 +46,8 @@ interface Calendar {
|
|
|
46
46
|
sameElse: CalendarSpecVal;
|
|
47
47
|
}
|
|
48
48
|
type CalendarPartial = Partial<Calendar>;
|
|
49
|
-
type
|
|
50
|
-
type
|
|
49
|
+
type RelativeTimeKeys = 'future' | 'past' | 's' | 'ss' | 'm' | 'mm' | 'h' | 'hh' | 'd' | 'dd' | 'w' | 'ww' | 'M' | 'MM' | 'y' | 'yy';
|
|
50
|
+
type RelativeTimeElementFunction = (timeValue: string | number, withoutSuffix: boolean, token: RelativeTimeKeys, isFuture: boolean) => string;
|
|
51
51
|
interface Locale {
|
|
52
52
|
/**
|
|
53
53
|
* Name of the locale
|
|
@@ -70,6 +70,7 @@ interface Locale {
|
|
|
70
70
|
readonly weekdaysMin: DayNames;
|
|
71
71
|
readonly months: MonthNames | MonthNamesStandaloneFormat | MonthNamesFunction;
|
|
72
72
|
readonly monthsShort: MonthNames | MonthNamesStandaloneFormat | MonthNamesFunction;
|
|
73
|
+
readonly dayOfMonthOrdinalParse: RegExp;
|
|
73
74
|
readonly ordinal: (number: number, period?: string) => string;
|
|
74
75
|
readonly weekStart: number;
|
|
75
76
|
readonly yearStart: number;
|
|
@@ -100,4 +101,4 @@ declare function setLocaleProperty(targetLocale: Locale, propName: string, newVa
|
|
|
100
101
|
declare function cloneLocale(source: Locale): Locale;
|
|
101
102
|
declare const localePlugin: EsDayPlugin<{}>;
|
|
102
103
|
//#endregion
|
|
103
|
-
export { Calendar, CalendarPartial, CalendarSpecVal, CalendarSpecValFunction, DayNames, DayNamesStandaloneFormat, Locale, LocaleFormatKeys, MonthNames, MonthNamesFunction, MonthNamesStandaloneFormat, RelativeTimeElementFunction, RelativeTimeKeys, cloneLocale, localePlugin, setLocaleProperty };
|
|
104
|
+
export { Calendar, CalendarPartial, CalendarSpecVal, CalendarSpecValFunction, DayNames, DayNamesStandaloneFormat, Locale, LocaleFormatKeys, MonthNames, MonthNamesFunction, MonthNamesStandaloneFormat, RelativeTimeElementFunction, RelativeTimeKeys, cloneLocale, localePlugin as default, setLocaleProperty };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { constants_default } from "
|
|
2
|
-
import { undefinedOr } from "
|
|
3
|
-
import { normalizeUnit } from "
|
|
4
|
-
import
|
|
1
|
+
import { p as constants_default } from "../../chunks/BkjWOpMU.js";
|
|
2
|
+
import { s as undefinedOr } from "../../chunks/v_QBn7Xm.js";
|
|
3
|
+
import { t as normalizeUnit } from "../../chunks/AyQQ6US-.js";
|
|
4
|
+
import localeEn from "../../locales/en.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/plugins/locale/index.ts
|
|
7
7
|
const LocaleStore = /* @__PURE__ */ new Map();
|
|
8
8
|
let $localeGlobal = "en";
|
|
9
9
|
function getLocale(name) {
|
|
10
|
-
return LocaleStore.get(name) ||
|
|
10
|
+
return LocaleStore.get(name) || localeEn;
|
|
11
11
|
}
|
|
12
12
|
function registerLocale(locale, rename) {
|
|
13
13
|
LocaleStore.set(rename || locale.name, locale);
|
|
@@ -16,9 +16,8 @@ function unregisterLocale(name) {
|
|
|
16
16
|
LocaleStore.delete(name);
|
|
17
17
|
}
|
|
18
18
|
function updateLocale(localeName, locale) {
|
|
19
|
-
const existingLocale = getLocale(localeName);
|
|
20
19
|
const updatedLocale = {
|
|
21
|
-
...
|
|
20
|
+
...getLocale(localeName),
|
|
22
21
|
...locale
|
|
23
22
|
};
|
|
24
23
|
LocaleStore.set(localeName, updatedLocale);
|
|
@@ -57,6 +56,7 @@ function cloneObject(sourceObject) {
|
|
|
57
56
|
const result = {};
|
|
58
57
|
for (const [key, sourceValue] of Object.entries(sourceObject)) if (typeof sourceValue === "string" || typeof sourceValue === "number" || typeof sourceValue === "function") setObjectProperty(result, key, sourceValue);
|
|
59
58
|
else if (Array.isArray(sourceValue)) setObjectProperty(result, key, structuredClone(sourceValue));
|
|
59
|
+
else if (sourceValue instanceof RegExp) setObjectProperty(result, key, new RegExp(sourceValue.source, sourceValue.flags));
|
|
60
60
|
else if (typeof sourceValue === "object") setObjectProperty(result, key, cloneObject(sourceValue));
|
|
61
61
|
return result;
|
|
62
62
|
}
|
|
@@ -72,8 +72,8 @@ function cloneLocale(source) {
|
|
|
72
72
|
return cloneObject(source);
|
|
73
73
|
}
|
|
74
74
|
function getSetPrivateLocaleName(inst, newLocaleName) {
|
|
75
|
-
if (newLocaleName) inst["$conf"]["
|
|
76
|
-
return inst["$conf"]["
|
|
75
|
+
if (newLocaleName) inst["$conf"]["localeName"] = newLocaleName;
|
|
76
|
+
return inst["$conf"]["localeName"] || "";
|
|
77
77
|
}
|
|
78
78
|
const localePlugin = (_, dayClass, dayFactory) => {
|
|
79
79
|
dayClass.prototype.localeObject = function() {
|
|
@@ -93,8 +93,8 @@ const localePlugin = (_, dayClass, dayFactory) => {
|
|
|
93
93
|
};
|
|
94
94
|
const oldParse = dayClass.prototype["$parse"];
|
|
95
95
|
dayClass.prototype["$parse"] = function(d) {
|
|
96
|
-
oldParse.call(this, d);
|
|
97
96
|
getSetPrivateLocaleName(this, $localeGlobal);
|
|
97
|
+
oldParse.call(this, d);
|
|
98
98
|
};
|
|
99
99
|
const oldStartOf = dayClass.prototype["startOf"];
|
|
100
100
|
const oldEndOf = dayClass.prototype["endOf"];
|
|
@@ -110,12 +110,10 @@ const localePlugin = (_, dayClass, dayFactory) => {
|
|
|
110
110
|
return inst;
|
|
111
111
|
};
|
|
112
112
|
dayClass.prototype["startOf"] = function(unit) {
|
|
113
|
-
|
|
114
|
-
return fixDiff(inst, this, unit);
|
|
113
|
+
return fixDiff(oldStartOf.call(this, unit), this, unit);
|
|
115
114
|
};
|
|
116
115
|
dayClass.prototype["endOf"] = function(unit) {
|
|
117
|
-
|
|
118
|
-
return fixDiff(inst, this, unit, true);
|
|
116
|
+
return fixDiff(oldEndOf.call(this, unit), this, unit, true);
|
|
119
117
|
};
|
|
120
118
|
dayFactory.locale = (localeName) => {
|
|
121
119
|
if (localeName === void 0) return $localeGlobal;
|
|
@@ -138,7 +136,6 @@ const localePlugin = (_, dayClass, dayFactory) => {
|
|
|
138
136
|
return dayFactory;
|
|
139
137
|
};
|
|
140
138
|
};
|
|
141
|
-
var locale_default = localePlugin;
|
|
142
139
|
|
|
143
140
|
//#endregion
|
|
144
|
-
export { cloneLocale,
|
|
141
|
+
export { cloneLocale, localePlugin as default, setLocaleProperty };
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
+
import { t as esday } from "../../chunks/CXWzCl3n.js";
|
|
2
|
+
|
|
1
3
|
//#region src/plugins/localeData/index.ts
|
|
2
4
|
/**
|
|
5
|
+
* LocaleData plugin
|
|
6
|
+
*
|
|
7
|
+
* This plugin adds 'method1', 'method2' and formatting and parsing tokens to EsDay
|
|
8
|
+
*
|
|
9
|
+
* This plugin requires the 'Locale' plugin. For using the 'weekdays' function to
|
|
10
|
+
* format a date, the plugin 'Week' is required too.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
3
13
|
* Get list of month names or format a date as month (short or long month name).
|
|
4
14
|
* @param locale - locale to use
|
|
5
15
|
* @param propName - name of the property to extract
|
|
@@ -69,8 +79,7 @@ const getMonths = (locale, propName, date, format) => {
|
|
|
69
79
|
* @returns full format of abbreviated date-time format
|
|
70
80
|
*/
|
|
71
81
|
const getLongDateFormat = (locale, format) => {
|
|
72
|
-
|
|
73
|
-
return formatsArray[format] ?? "";
|
|
82
|
+
return locale.formats[format] ?? "";
|
|
74
83
|
};
|
|
75
84
|
/**
|
|
76
85
|
* Get a locale dependant format for relative dates.
|
|
@@ -85,8 +94,10 @@ const getCalendar = (locale, key, date, now) => {
|
|
|
85
94
|
const defaultKey = "sameElse";
|
|
86
95
|
const calendarArray = locale.calendar;
|
|
87
96
|
const calendarEntry = calendarArray[key ?? defaultKey] ?? calendarArray[defaultKey];
|
|
97
|
+
const nowDate = now ?? esday();
|
|
88
98
|
if (typeof calendarEntry === "function") {
|
|
89
|
-
|
|
99
|
+
/* istanbul ignore else -- @preserve */
|
|
100
|
+
if (date !== void 0) result = calendarEntry.call(date, nowDate);
|
|
90
101
|
} else result = calendarEntry;
|
|
91
102
|
return result;
|
|
92
103
|
};
|
|
@@ -101,8 +112,7 @@ const getCalendar = (locale, key, date, now) => {
|
|
|
101
112
|
*/
|
|
102
113
|
const getRelativeTime = (locale, timeValue, withoutSuffix, token, isFuture) => {
|
|
103
114
|
let result = "";
|
|
104
|
-
const
|
|
105
|
-
const relativeTimeEntry = relativeTimeArray[token];
|
|
115
|
+
const relativeTimeEntry = locale.relativeTime[token];
|
|
106
116
|
if (typeof relativeTimeEntry === "function") result = relativeTimeEntry(timeValue, withoutSuffix, token, isFuture);
|
|
107
117
|
else result = relativeTimeEntry.replace(/%d/i, timeValue.toString());
|
|
108
118
|
return result;
|
|
@@ -129,12 +139,10 @@ const createLocaleDataObject = (locale) => {
|
|
|
129
139
|
const localeDataPlugin = (_, dayClass, dayFactory) => {
|
|
130
140
|
const proto = dayClass.prototype;
|
|
131
141
|
proto.localeData = function() {
|
|
132
|
-
|
|
133
|
-
return createLocaleDataObject(locale);
|
|
142
|
+
return createLocaleDataObject(this.localeObject());
|
|
134
143
|
};
|
|
135
144
|
dayFactory.localeData = (localeName) => {
|
|
136
|
-
|
|
137
|
-
return createLocaleDataObject(locale);
|
|
145
|
+
return createLocaleDataObject(localeName !== void 0 ? dayFactory.getLocale(localeName) : dayFactory.getLocale(dayFactory.locale()));
|
|
138
146
|
};
|
|
139
147
|
dayFactory.months = () => getMonths(dayFactory.getLocale(dayFactory.locale()), "months");
|
|
140
148
|
dayFactory.monthsShort = () => getMonths(dayFactory.getLocale(dayFactory.locale()), "monthsShort");
|
|
@@ -142,7 +150,6 @@ const localeDataPlugin = (_, dayClass, dayFactory) => {
|
|
|
142
150
|
dayFactory.weekdaysShort = () => getWeekdays(dayFactory.getLocale(dayFactory.locale()), "weekdaysShort");
|
|
143
151
|
dayFactory.weekdaysMin = () => getWeekdays(dayFactory.getLocale(dayFactory.locale()), "weekdaysMin");
|
|
144
152
|
};
|
|
145
|
-
var localeData_default = localeDataPlugin;
|
|
146
153
|
|
|
147
154
|
//#endregion
|
|
148
|
-
export {
|
|
155
|
+
export { localeDataPlugin as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { padNumberWithLeadingZeros } from "../../chunks/
|
|
1
|
+
import { i as isString, t as isArray } from "../../chunks/v_QBn7Xm.js";
|
|
2
|
+
import { t as padNumberWithLeadingZeros } from "../../chunks/CdvTtmWL.js";
|
|
3
3
|
|
|
4
4
|
//#region src/plugins/localizedFormat/index.ts
|
|
5
5
|
/**
|
|
@@ -11,9 +11,7 @@ function addWeekday() {
|
|
|
11
11
|
return function weekdayFormatter(sourceDate, format) {
|
|
12
12
|
const weekdays = sourceDate.localeObject().weekdays;
|
|
13
13
|
if (isArray(weekdays)) return weekdays[sourceDate.day()];
|
|
14
|
-
|
|
15
|
-
const useFormatProperty = parseForUseFormat?.test(format);
|
|
16
|
-
if (useFormatProperty) return weekdays.format[sourceDate.day()];
|
|
14
|
+
if (weekdays.isFormat?.test(format)) return weekdays.format[sourceDate.day()];
|
|
17
15
|
return weekdays.standalone[sourceDate.day()];
|
|
18
16
|
};
|
|
19
17
|
}
|
|
@@ -29,9 +27,7 @@ function addMonth(property) {
|
|
|
29
27
|
const months = sourceDate.localeObject()[property];
|
|
30
28
|
if (isArray(months)) return months[sourceDate.month()];
|
|
31
29
|
if (typeof months === "function") return months(sourceDate, format);
|
|
32
|
-
|
|
33
|
-
const useFormatProperty = parseForUseFormat.test(format);
|
|
34
|
-
if (useFormatProperty) return months.format[sourceDate.month()];
|
|
30
|
+
if ((months.isFormat ?? MONTHS_IN_FORMAT).test(format)) return months.format[sourceDate.month()];
|
|
35
31
|
return months.standalone[sourceDate.month()];
|
|
36
32
|
};
|
|
37
33
|
}
|
|
@@ -82,7 +78,6 @@ const localizedFormatPlugin = (_, dayClass, dayFactory) => {
|
|
|
82
78
|
return this.localeObject?.().postFormat?.(formattedValue) ?? formattedValue;
|
|
83
79
|
};
|
|
84
80
|
};
|
|
85
|
-
var localizedFormat_default = localizedFormatPlugin;
|
|
86
81
|
|
|
87
82
|
//#endregion
|
|
88
|
-
export {
|
|
83
|
+
export { localizedFormatPlugin as default };
|
|
@@ -1,18 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as isUndefined, i as isString, t as isArray } from "../../chunks/v_QBn7Xm.js";
|
|
2
2
|
|
|
3
3
|
//#region src/plugins/localizedParse/index.ts
|
|
4
4
|
const match2 = /\d{2}/;
|
|
5
5
|
const match1to2 = /\d\d?/;
|
|
6
6
|
const matchWord = /\d*[^-_:/,()\s\d]+/;
|
|
7
|
+
const matchDayOfMonthOrdinalDefault = /\d{1,2}/;
|
|
8
|
+
/**
|
|
9
|
+
* Update parsing patterns that depend on the locale (e.g. 'Do')
|
|
10
|
+
* @param patterns - parseTokensDefinitions
|
|
11
|
+
* @param locale - locale to use
|
|
12
|
+
*/
|
|
13
|
+
const updateParsingPatternsFromLocale = (patterns, locale) => {
|
|
14
|
+
const dayOfMonthOrdinalPattern = locale.dayOfMonthOrdinalParse;
|
|
15
|
+
patterns.Do[0] = dayOfMonthOrdinalPattern;
|
|
16
|
+
patterns.Do[1] = dayOfMonthOrdinalPattern;
|
|
17
|
+
};
|
|
7
18
|
/**
|
|
8
19
|
* Add 'input' to parsedElements as 'hours'.
|
|
9
20
|
* @param parsedElements - object containing the components of a parsed date
|
|
10
21
|
* @param input - parsed component of a date, to be transformed and inserted in parsedElements
|
|
11
22
|
* @param options - parsing options e.g. containing the locale to use
|
|
12
23
|
*/
|
|
13
|
-
|
|
24
|
+
const addHour = (parsedElements, input, _parseOptions) => {
|
|
14
25
|
parsedElements["hours"] = +input;
|
|
15
|
-
}
|
|
26
|
+
};
|
|
16
27
|
/**
|
|
17
28
|
* Convert parsed string to boolean 'afternoon'
|
|
18
29
|
* @param locale - Locale to use
|
|
@@ -20,7 +31,7 @@ function addHour(parsedElements, input, _parseOptions) {
|
|
|
20
31
|
* @param isLowerCase - should this be a lowercase meridiem string?
|
|
21
32
|
* @returns is input an 'afternoon' string for given locale
|
|
22
33
|
*/
|
|
23
|
-
|
|
34
|
+
const meridiemMatch = (locale, input, isLowerCase) => {
|
|
24
35
|
let isAfternoon = false;
|
|
25
36
|
const { meridiem } = locale;
|
|
26
37
|
if (meridiem) {
|
|
@@ -30,7 +41,7 @@ function meridiemMatch(locale, input, isLowerCase) {
|
|
|
30
41
|
}
|
|
31
42
|
} else isAfternoon = input === (isLowerCase ? "pm" : "PM");
|
|
32
43
|
return isAfternoon;
|
|
33
|
-
}
|
|
44
|
+
};
|
|
34
45
|
/**
|
|
35
46
|
* Create a function that will parse the input string as meridiem string and
|
|
36
47
|
* add it to the given 'parsedElements' containing the date&time components.
|
|
@@ -38,14 +49,12 @@ function meridiemMatch(locale, input, isLowerCase) {
|
|
|
38
49
|
* @param esday - global esday object (to get locale by its name)
|
|
39
50
|
* @returns function that will add the given value to date&time component as 'afternoon'
|
|
40
51
|
*/
|
|
41
|
-
|
|
52
|
+
const addAfternoon = (isLowerCase, esday) => {
|
|
42
53
|
return function meridiemUpdater(parsedElements, input, parseOptions) {
|
|
43
54
|
const localeName = parseOptions["locale"];
|
|
44
|
-
|
|
45
|
-
const meridiem = meridiemMatch(locale, input, isLowerCase);
|
|
46
|
-
if (!isUndefined(meridiem)) parsedElements.afternoon = meridiem;
|
|
55
|
+
parsedElements.afternoon = meridiemMatch(esday.getLocale(localeName), input, isLowerCase);
|
|
47
56
|
};
|
|
48
|
-
}
|
|
57
|
+
};
|
|
49
58
|
/**
|
|
50
59
|
* Parse day of month as ordinal number.
|
|
51
60
|
* Create a function that will parse the input string as day of month as ordinal
|
|
@@ -53,7 +62,7 @@ function addAfternoon(isLowerCase, esday) {
|
|
|
53
62
|
* @param esday - global esday object (to get locale by its name)
|
|
54
63
|
* @returns function that will add the given value to date&time component as 'afternoon'
|
|
55
64
|
*/
|
|
56
|
-
|
|
65
|
+
const addDayOfMonthOrdinal = (esday) => {
|
|
57
66
|
return function monthOrdinalUpdater(parsedElements, input, parseOptions) {
|
|
58
67
|
const localeName = parseOptions["locale"];
|
|
59
68
|
const { ordinal } = esday.getLocale(localeName);
|
|
@@ -61,11 +70,11 @@ function addDayOfMonthOrdinal(esday) {
|
|
|
61
70
|
const splittedInput = input.match(/^[^\d]*(\d+)[^\d]*$/);
|
|
62
71
|
if (splittedInput !== null) {
|
|
63
72
|
dateValue = +splittedInput[1];
|
|
64
|
-
const dateAsOrdinal = ordinal?.(dateValue);
|
|
73
|
+
const dateAsOrdinal = ordinal?.(dateValue, "d");
|
|
65
74
|
if (dateAsOrdinal === void 0 || dateAsOrdinal === input) parsedElements.date = dateValue;
|
|
66
75
|
}
|
|
67
76
|
};
|
|
68
|
-
}
|
|
77
|
+
};
|
|
69
78
|
/**
|
|
70
79
|
* Create a function that will convert the value from the input string
|
|
71
80
|
* to a month number and add it to the given 'parsedElements' containing
|
|
@@ -74,7 +83,7 @@ function addDayOfMonthOrdinal(esday) {
|
|
|
74
83
|
* @param esday - global esday object (to get locale by its name)
|
|
75
84
|
* @returns function that will add the given value to date&time component
|
|
76
85
|
*/
|
|
77
|
-
|
|
86
|
+
const addMonth = (property, esday) => {
|
|
78
87
|
return function monthUpdater(parsedElements, input, parseOptions) {
|
|
79
88
|
const localeName = parseOptions["locale"];
|
|
80
89
|
const months = esday.getLocale(localeName)[property];
|
|
@@ -84,7 +93,7 @@ function addMonth(property, esday) {
|
|
|
84
93
|
const matchIndex = monthNames.indexOf(input) + 1;
|
|
85
94
|
parsedElements.month = matchIndex % 12 || matchIndex;
|
|
86
95
|
};
|
|
87
|
-
}
|
|
96
|
+
};
|
|
88
97
|
/**
|
|
89
98
|
* Replace locale dependent token in given format with values from locale definition
|
|
90
99
|
* e.g. 'LTS' with 'h:mm:ss A'
|
|
@@ -92,13 +101,13 @@ function addMonth(property, esday) {
|
|
|
92
101
|
* @param currentLocale - Locale to use
|
|
93
102
|
* @returns format with locale dependent tokens replaced
|
|
94
103
|
*/
|
|
95
|
-
|
|
104
|
+
const replaceLocaleTokens = (format, currentLocale) => {
|
|
96
105
|
const localFormattingTokens = /(\[[^[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;
|
|
97
106
|
function replaceLongDateFormatTokens(input) {
|
|
98
107
|
return currentLocale.formats[input] ?? input;
|
|
99
108
|
}
|
|
100
109
|
return format.replace(localFormattingTokens, replaceLongDateFormatTokens);
|
|
101
|
-
}
|
|
110
|
+
};
|
|
102
111
|
const localizedParsePlugin = (_, dayClass, dayFactory) => {
|
|
103
112
|
const proto = dayClass.prototype;
|
|
104
113
|
/**
|
|
@@ -155,8 +164,8 @@ const localizedParsePlugin = (_, dayClass, dayFactory) => {
|
|
|
155
164
|
_postParseMeridiem
|
|
156
165
|
],
|
|
157
166
|
Do: [
|
|
158
|
-
|
|
159
|
-
|
|
167
|
+
matchDayOfMonthOrdinalDefault,
|
|
168
|
+
matchDayOfMonthOrdinalDefault,
|
|
160
169
|
addDayOfMonthOrdinal(dayFactory)
|
|
161
170
|
],
|
|
162
171
|
MMM: [
|
|
@@ -180,7 +189,11 @@ const localizedParsePlugin = (_, dayClass, dayFactory) => {
|
|
|
180
189
|
const format = this["$conf"].args_1;
|
|
181
190
|
let currentLocale = this.localeObject?.();
|
|
182
191
|
const arg2 = this["$conf"].args_2;
|
|
183
|
-
if (!isUndefined(arg2) && typeof arg2 === "string")
|
|
192
|
+
if (!isUndefined(arg2) && typeof arg2 === "string") {
|
|
193
|
+
currentLocale = dayFactory.getLocale(arg2);
|
|
194
|
+
this["$conf"].localeName = arg2;
|
|
195
|
+
}
|
|
196
|
+
updateParsingPatternsFromLocale(parseTokensDefinitions, currentLocale);
|
|
184
197
|
const parseOptions = this["$conf"].parseOptions ?? {};
|
|
185
198
|
parseOptions.locale = currentLocale.name;
|
|
186
199
|
this["$conf"].parseOptions = parseOptions;
|
|
@@ -191,9 +204,14 @@ const localizedParsePlugin = (_, dayClass, dayFactory) => {
|
|
|
191
204
|
let newDate = d;
|
|
192
205
|
if (currentLocale.preParse !== void 0) newDate = currentLocale.preParse(d);
|
|
193
206
|
oldParse.call(this, newDate);
|
|
207
|
+
if (this["$conf"].parseOptions !== void 0) {
|
|
208
|
+
/* istanbul ignore else -- @preserve */
|
|
209
|
+
if (this["$conf"].parseOptions?.locale !== void 0) delete this["$conf"].parseOptions.locale;
|
|
210
|
+
/* istanbul ignore else -- @preserve */
|
|
211
|
+
if (Object.keys(this["$conf"].parseOptions).length === 0) delete this["$conf"].parseOptions;
|
|
212
|
+
}
|
|
194
213
|
};
|
|
195
214
|
};
|
|
196
|
-
var localizedParse_default = localizedParsePlugin;
|
|
197
215
|
|
|
198
216
|
//#endregion
|
|
199
|
-
export {
|
|
217
|
+
export { localizedParsePlugin as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isArray } from "../../chunks/
|
|
1
|
+
import { t as isArray } from "../../chunks/v_QBn7Xm.js";
|
|
2
2
|
|
|
3
3
|
//#region src/plugins/minMax/index.ts
|
|
4
4
|
const minMaxPlugin = (_, _dayClass, dayFactory) => {
|
|
@@ -16,7 +16,6 @@ const minMaxPlugin = (_, _dayClass, dayFactory) => {
|
|
|
16
16
|
dayFactory.max = (...dates) => sortBy("isAfter", dates);
|
|
17
17
|
dayFactory.min = (...dates) => sortBy("isBefore", dates);
|
|
18
18
|
};
|
|
19
|
-
var minMax_default = minMaxPlugin;
|
|
20
19
|
|
|
21
20
|
//#endregion
|
|
22
|
-
export {
|
|
21
|
+
export { minMaxPlugin as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { constants_default } from "../../chunks/
|
|
2
|
-
import { isEmptyObject, isObject } from "../../chunks/
|
|
3
|
-
import { normalizeUnitWithPlurals } from "../../chunks/
|
|
4
|
-
import { createInstanceFromExist } from "../../chunks/
|
|
1
|
+
import { p as constants_default } from "../../chunks/BkjWOpMU.js";
|
|
2
|
+
import { n as isEmptyObject, r as isObject } from "../../chunks/v_QBn7Xm.js";
|
|
3
|
+
import { n as normalizeUnitWithPlurals } from "../../chunks/AyQQ6US-.js";
|
|
4
|
+
import { t as createInstanceFromExist } from "../../chunks/Shk32pTP.js";
|
|
5
5
|
|
|
6
6
|
//#region src/plugins/objectSupport/index.ts
|
|
7
7
|
const objectSupportPlugin = (_, dayClass, _dayFactory) => {
|
|
@@ -22,36 +22,32 @@ const objectSupportPlugin = (_, dayClass, _dayFactory) => {
|
|
|
22
22
|
];
|
|
23
23
|
const dateIncludesYear = dateKeys.includes("y") || dateKeys.includes(constants_default.YEAR) || dateKeys.includes(`${constants_default.YEAR}s`);
|
|
24
24
|
const dateIncludesMonth = dateKeys.includes("M") || dateKeys.includes(constants_default.MONTH) || dateKeys.includes(`${constants_default.MONTH}s`);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
case constants_default.MS:
|
|
50
|
-
dateArrayTuple[6] = Number(date[stringKey]);
|
|
51
|
-
break;
|
|
52
|
-
}
|
|
25
|
+
if ((dateKeys.includes("D") || dateKeys.includes(constants_default.DAY_OF_MONTH) || dateKeys.includes(`${constants_default.DAY_OF_MONTH}s`) || dateKeys.includes("d") || dateKeys.includes(constants_default.DAY) || dateKeys.includes(`${constants_default.DAY}s`)) && !dateIncludesMonth && !dateIncludesYear) dateArrayTuple[1] = now.month() + 1;
|
|
26
|
+
for (const stringKey of dateKeys) switch (normalizeUnitWithPlurals(stringKey)) {
|
|
27
|
+
case constants_default.YEAR:
|
|
28
|
+
dateArrayTuple[0] = Number(date[stringKey]);
|
|
29
|
+
break;
|
|
30
|
+
case constants_default.MONTH:
|
|
31
|
+
dateArrayTuple[1] = Number(date[stringKey]) + 1;
|
|
32
|
+
break;
|
|
33
|
+
case constants_default.DAY:
|
|
34
|
+
case constants_default.DAY_OF_MONTH:
|
|
35
|
+
dateArrayTuple[2] = Number(date[stringKey]);
|
|
36
|
+
break;
|
|
37
|
+
case constants_default.HOUR:
|
|
38
|
+
dateArrayTuple[3] = Number(date[stringKey]);
|
|
39
|
+
break;
|
|
40
|
+
case constants_default.MIN:
|
|
41
|
+
dateArrayTuple[4] = Number(date[stringKey]);
|
|
42
|
+
break;
|
|
43
|
+
case constants_default.SECOND:
|
|
44
|
+
dateArrayTuple[5] = Number(date[stringKey]);
|
|
45
|
+
break;
|
|
46
|
+
case constants_default.MS:
|
|
47
|
+
dateArrayTuple[6] = Number(date[stringKey]);
|
|
48
|
+
break;
|
|
53
49
|
}
|
|
54
|
-
this
|
|
50
|
+
this.$d = this.dateFromDateComponents(...dateArrayTuple);
|
|
55
51
|
} else oldParse.call(this, date);
|
|
56
52
|
};
|
|
57
53
|
const old$set = proto["$set"];
|
|
@@ -63,7 +59,7 @@ const objectSupportPlugin = (_, dayClass, _dayFactory) => {
|
|
|
63
59
|
for (const stringKey of keys) {
|
|
64
60
|
const key = stringKey;
|
|
65
61
|
const valueToSet = valuesToSet[key];
|
|
66
|
-
result =
|
|
62
|
+
if (valueToSet !== void 0) result = result.set(key, valueToSet);
|
|
67
63
|
}
|
|
68
64
|
return result;
|
|
69
65
|
}
|
|
@@ -77,7 +73,7 @@ const objectSupportPlugin = (_, dayClass, _dayFactory) => {
|
|
|
77
73
|
for (const stringKey of keys) {
|
|
78
74
|
const key = stringKey;
|
|
79
75
|
const valueToAdd = value[key];
|
|
80
|
-
result =
|
|
76
|
+
if (valueToAdd !== void 0) result = result.add(valueToAdd, key);
|
|
81
77
|
}
|
|
82
78
|
return result;
|
|
83
79
|
}
|
|
@@ -91,14 +87,13 @@ const objectSupportPlugin = (_, dayClass, _dayFactory) => {
|
|
|
91
87
|
for (const stringKey of keys) {
|
|
92
88
|
const key = stringKey;
|
|
93
89
|
const valueToSubtract = value[key];
|
|
94
|
-
result =
|
|
90
|
+
if (valueToSubtract !== void 0) result = result.subtract(valueToSubtract, key);
|
|
95
91
|
}
|
|
96
92
|
return result;
|
|
97
93
|
}
|
|
98
94
|
return oldSubtract.call(this, value, unit);
|
|
99
95
|
};
|
|
100
96
|
};
|
|
101
|
-
var objectSupport_default = objectSupportPlugin;
|
|
102
97
|
|
|
103
98
|
//#endregion
|
|
104
|
-
export {
|
|
99
|
+
export { objectSupportPlugin as default };
|