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
package/locales/x-pseudo.d.ts
DELETED
package/locales/yo.d.ts
DELETED
package/locales/zh-cn.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import "../chunks/DqhiVwLi.js";
|
|
2
|
-
import "../chunks/MtjcOKi-.js";
|
|
3
|
-
import { Locale } from "../chunks/St35qgL0.js";
|
|
4
|
-
|
|
5
|
-
//#region src/locales/zh-cn.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* Chinese (China) [zh-CN]
|
|
8
|
-
*/
|
|
9
|
-
declare const localeZhCn: Locale;
|
|
10
|
-
//#endregion
|
|
11
|
-
export { localeZhCn as default };
|
package/locales/zh-cn.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import "../chunks/Y32qdU_5.js";
|
|
2
|
-
import "../chunks/Cb5SvF6r.js";
|
|
3
|
-
import "../chunks/DjY7KvwG.js";
|
|
4
|
-
import "../chunks/tfkJ5D3p.js";
|
|
5
|
-
import { cloneLocale, setLocaleProperty } from "../chunks/CoBtJ4c1.js";
|
|
6
|
-
import { zh_default } from "../chunks/BXRGSAJG.js";
|
|
7
|
-
|
|
8
|
-
//#region src/locales/zh-cn.ts
|
|
9
|
-
const localeZhCn = cloneLocale(zh_default);
|
|
10
|
-
setLocaleProperty(localeZhCn, "name", "zh-CN");
|
|
11
|
-
var zh_cn_default = localeZhCn;
|
|
12
|
-
|
|
13
|
-
//#endregion
|
|
14
|
-
export { zh_cn_default as default };
|
package/locales/zh-hk.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import "../chunks/DqhiVwLi.js";
|
|
2
|
-
import "../chunks/MtjcOKi-.js";
|
|
3
|
-
import { Locale } from "../chunks/St35qgL0.js";
|
|
4
|
-
|
|
5
|
-
//#region src/locales/zh-hk.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* Chinese (Hong Kong) [zh-HK]
|
|
8
|
-
*/
|
|
9
|
-
declare const localeZhHk: Locale;
|
|
10
|
-
//#endregion
|
|
11
|
-
export { localeZhHk as default };
|
package/locales/zh-hk.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import "../chunks/Y32qdU_5.js";
|
|
2
|
-
import "../chunks/Cb5SvF6r.js";
|
|
3
|
-
import "../chunks/DjY7KvwG.js";
|
|
4
|
-
import "../chunks/tfkJ5D3p.js";
|
|
5
|
-
import { cloneLocale, setLocaleProperty } from "../chunks/CoBtJ4c1.js";
|
|
6
|
-
import { zh_default } from "../chunks/BXRGSAJG.js";
|
|
7
|
-
|
|
8
|
-
//#region src/locales/zh-hk.ts
|
|
9
|
-
const calendar = {
|
|
10
|
-
sameDay: "[今天]LT",
|
|
11
|
-
nextDay: "[明天]LT",
|
|
12
|
-
nextWeek: "[下]ddddLT",
|
|
13
|
-
lastDay: "[昨天]LT",
|
|
14
|
-
lastWeek: "[上]ddddLT",
|
|
15
|
-
sameElse: "L"
|
|
16
|
-
};
|
|
17
|
-
const localeZhHk = cloneLocale(zh_default);
|
|
18
|
-
setLocaleProperty(localeZhHk, "name", "zh-HK");
|
|
19
|
-
setLocaleProperty(localeZhHk, "calendar", calendar);
|
|
20
|
-
var zh_hk_default = localeZhHk;
|
|
21
|
-
|
|
22
|
-
//#endregion
|
|
23
|
-
export { zh_hk_default as default };
|
package/locales/zh-mo.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import "../chunks/DqhiVwLi.js";
|
|
2
|
-
import "../chunks/MtjcOKi-.js";
|
|
3
|
-
import { Locale } from "../chunks/St35qgL0.js";
|
|
4
|
-
|
|
5
|
-
//#region src/locales/zh-mo.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* Chinese (Macau) [zh-MO]
|
|
8
|
-
*/
|
|
9
|
-
declare const localeZhHk: Locale;
|
|
10
|
-
//#endregion
|
|
11
|
-
export { localeZhHk as default };
|
package/locales/zh-mo.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import "../chunks/Y32qdU_5.js";
|
|
2
|
-
import "../chunks/Cb5SvF6r.js";
|
|
3
|
-
import "../chunks/DjY7KvwG.js";
|
|
4
|
-
import "../chunks/tfkJ5D3p.js";
|
|
5
|
-
import { cloneLocale, setLocaleProperty } from "../chunks/CoBtJ4c1.js";
|
|
6
|
-
import { zh_default } from "../chunks/BXRGSAJG.js";
|
|
7
|
-
|
|
8
|
-
//#region src/locales/zh-mo.ts
|
|
9
|
-
const calendar = {
|
|
10
|
-
sameDay: "[今天]LT",
|
|
11
|
-
nextDay: "[明天]LT",
|
|
12
|
-
nextWeek: "[下]ddddLT",
|
|
13
|
-
lastDay: "[昨天]LT",
|
|
14
|
-
lastWeek: "[上]ddddLT",
|
|
15
|
-
sameElse: "L"
|
|
16
|
-
};
|
|
17
|
-
const localeZhHk = cloneLocale(zh_default);
|
|
18
|
-
setLocaleProperty(localeZhHk, "name", "zh-MO");
|
|
19
|
-
setLocaleProperty(localeZhHk, "calendar", calendar);
|
|
20
|
-
var zh_mo_default = localeZhHk;
|
|
21
|
-
|
|
22
|
-
//#endregion
|
|
23
|
-
export { zh_mo_default as default };
|
package/locales/zh-tw.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import "../chunks/DqhiVwLi.js";
|
|
2
|
-
import "../chunks/MtjcOKi-.js";
|
|
3
|
-
import { Locale } from "../chunks/St35qgL0.js";
|
|
4
|
-
|
|
5
|
-
//#region src/locales/zh-tw.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* Chinese (Taiwan) [zh-TW]
|
|
8
|
-
*/
|
|
9
|
-
declare const localeZhTw: Locale;
|
|
10
|
-
//#endregion
|
|
11
|
-
export { localeZhTw as default };
|
package/locales/zh-tw.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import "../chunks/Y32qdU_5.js";
|
|
2
|
-
import "../chunks/Cb5SvF6r.js";
|
|
3
|
-
import "../chunks/DjY7KvwG.js";
|
|
4
|
-
import "../chunks/tfkJ5D3p.js";
|
|
5
|
-
import { cloneLocale, setLocaleProperty } from "../chunks/CoBtJ4c1.js";
|
|
6
|
-
import { zh_default } from "../chunks/BXRGSAJG.js";
|
|
7
|
-
|
|
8
|
-
//#region src/locales/zh-tw.ts
|
|
9
|
-
const calendar = {
|
|
10
|
-
sameDay: "[今天] LT",
|
|
11
|
-
nextDay: "[明天] LT",
|
|
12
|
-
nextWeek: "[下]dddd LT",
|
|
13
|
-
lastDay: "[昨天] LT",
|
|
14
|
-
lastWeek: "[上]dddd LT",
|
|
15
|
-
sameElse: "L"
|
|
16
|
-
};
|
|
17
|
-
const localeZhTw = cloneLocale(zh_default);
|
|
18
|
-
setLocaleProperty(localeZhTw, "name", "zh-TW");
|
|
19
|
-
setLocaleProperty(localeZhTw, "calendar", calendar);
|
|
20
|
-
var zh_tw_default = localeZhTw;
|
|
21
|
-
|
|
22
|
-
//#endregion
|
|
23
|
-
export { zh_tw_default as default };
|
package/locales/zh.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import "../../chunks/DqhiVwLi.js";
|
|
2
|
-
import "../../chunks/MtjcOKi-.js";
|
|
3
|
-
import { Calendar, CalendarPartial, CalendarSpecVal, CalendarSpecValFunction, DayNames, DayNamesStandaloneFormat, Locale, LocaleFormatKeys, MonthNames, MonthNamesFunction, MonthNamesStandaloneFormat, RelativeTimeElementFunction, RelativeTimeKeys, cloneLocale, localePlugin, setLocaleProperty } from "../../chunks/St35qgL0.js";
|
|
4
|
-
export { Calendar, CalendarPartial, CalendarSpecVal, CalendarSpecValFunction, DayNames, DayNamesStandaloneFormat, Locale, LocaleFormatKeys, MonthNames, MonthNamesFunction, MonthNamesStandaloneFormat, RelativeTimeElementFunction, RelativeTimeKeys, cloneLocale, localePlugin as default, setLocaleProperty };
|
package/plugins/locale/index.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import "../../chunks/Y32qdU_5.js";
|
|
2
|
-
import "../../chunks/Cb5SvF6r.js";
|
|
3
|
-
import "../../chunks/DjY7KvwG.js";
|
|
4
|
-
import "../../chunks/tfkJ5D3p.js";
|
|
5
|
-
import { cloneLocale, locale_default, setLocaleProperty } from "../../chunks/CoBtJ4c1.js";
|
|
6
|
-
|
|
7
|
-
export { cloneLocale, locale_default as default, setLocaleProperty };
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { DateType, EsDayPlugin } from "../../chunks/DqhiVwLi.js";
|
|
2
|
-
import "../../chunks/MtjcOKi-.js";
|
|
3
|
-
import { RelativeTimeKeys } from "../../chunks/St35qgL0.js";
|
|
4
|
-
|
|
5
|
-
//#region src/common/constants.d.ts
|
|
6
|
-
|
|
7
|
-
declare const _default: {
|
|
8
|
-
SECONDS_A_MINUTE: number;
|
|
9
|
-
SECONDS_A_HOUR: number;
|
|
10
|
-
SECONDS_A_DAY: number;
|
|
11
|
-
SECONDS_A_WEEK: number;
|
|
12
|
-
MILLISECONDS_A_SECOND: number;
|
|
13
|
-
MILLISECONDS_A_MINUTE: number;
|
|
14
|
-
MILLISECONDS_A_HOUR: number;
|
|
15
|
-
MILLISECONDS_A_DAY: number;
|
|
16
|
-
MILLISECONDS_A_WEEK: number;
|
|
17
|
-
INDEX_SUNDAY: number;
|
|
18
|
-
INDEX_MONDAY: number;
|
|
19
|
-
INDEX_WEDNESDAY: number;
|
|
20
|
-
INDEX_THURSDAY: number;
|
|
21
|
-
MS: "millisecond";
|
|
22
|
-
SECOND: "second";
|
|
23
|
-
MIN: "minute";
|
|
24
|
-
HOUR: "hour";
|
|
25
|
-
DAY: "day";
|
|
26
|
-
WEEK: "week";
|
|
27
|
-
ISOWEEK: "isoWeek";
|
|
28
|
-
MONTH: "month";
|
|
29
|
-
QUARTER: "quarter";
|
|
30
|
-
YEAR: "year";
|
|
31
|
-
DAY_OF_MONTH: "date";
|
|
32
|
-
FORMAT_DEFAULT: string;
|
|
33
|
-
INVALID_DATE: Date;
|
|
34
|
-
INVALID_DATE_STRING: string;
|
|
35
|
-
REGEX_PARSE_DEFAULT: RegExp;
|
|
36
|
-
};
|
|
37
|
-
//#endregion
|
|
38
|
-
//#region src/plugins/relativeTime/index.d.ts
|
|
39
|
-
|
|
40
|
-
declare module 'esday' {
|
|
41
|
-
interface EsDay {
|
|
42
|
-
to: (referenceDate: DateType, withoutSuffix?: boolean) => string;
|
|
43
|
-
from: (referenceDate: DateType, withoutSuffix?: boolean) => string;
|
|
44
|
-
toNow: (withoutSuffix?: boolean) => string;
|
|
45
|
-
fromNow: (withoutSuffix?: boolean) => string;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
type ThresholdUnit = typeof _default.SECOND | typeof _default.MIN | typeof _default.HOUR | typeof _default.DAY | typeof _default.MONTH | typeof _default.YEAR;
|
|
49
|
-
type Threshold = {
|
|
50
|
-
key: RelativeTimeKeys;
|
|
51
|
-
thresholdValue?: number;
|
|
52
|
-
thresholdUnit?: ThresholdUnit;
|
|
53
|
-
};
|
|
54
|
-
declare const relativeTimePlugin: EsDayPlugin<{
|
|
55
|
-
thresholds?: Threshold[];
|
|
56
|
-
rounding?: (valueToRound: number) => number;
|
|
57
|
-
}>;
|
|
58
|
-
//#endregion
|
|
59
|
-
export { Threshold, ThresholdUnit, relativeTimePlugin as default };
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import { constants_default } from "../../chunks/Y32qdU_5.js";
|
|
2
|
-
import { createInstanceFromExist } from "../../chunks/DXHbH1CI.js";
|
|
3
|
-
|
|
4
|
-
//#region src/plugins/relativeTime/index.ts
|
|
5
|
-
const relativeTimePlugin = (options, dayClass, dayFactory) => {
|
|
6
|
-
const proto = dayClass.prototype;
|
|
7
|
-
const defaultRelativeTimeDef = {
|
|
8
|
-
future: "in %s",
|
|
9
|
-
past: "%s ago",
|
|
10
|
-
s: "a few seconds",
|
|
11
|
-
ss: "%d seconds",
|
|
12
|
-
m: "a minute",
|
|
13
|
-
mm: "%d minutes",
|
|
14
|
-
h: "an hour",
|
|
15
|
-
hh: "%d hours",
|
|
16
|
-
d: "a day",
|
|
17
|
-
dd: "%d days",
|
|
18
|
-
M: "a month",
|
|
19
|
-
MM: "%d months",
|
|
20
|
-
y: "a year",
|
|
21
|
-
yy: "%d years"
|
|
22
|
-
};
|
|
23
|
-
const thresholds = options.thresholds ?? [
|
|
24
|
-
{
|
|
25
|
-
key: "s",
|
|
26
|
-
thresholdValue: 44,
|
|
27
|
-
thresholdUnit: constants_default.SECOND
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
key: "ss",
|
|
31
|
-
thresholdValue: 43,
|
|
32
|
-
thresholdUnit: constants_default.SECOND
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
key: "m",
|
|
36
|
-
thresholdValue: 89,
|
|
37
|
-
thresholdUnit: constants_default.SECOND
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
key: "mm",
|
|
41
|
-
thresholdValue: 44,
|
|
42
|
-
thresholdUnit: constants_default.MIN
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
key: "h",
|
|
46
|
-
thresholdValue: 89,
|
|
47
|
-
thresholdUnit: constants_default.MIN
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
key: "hh",
|
|
51
|
-
thresholdValue: 21,
|
|
52
|
-
thresholdUnit: constants_default.HOUR
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
key: "d",
|
|
56
|
-
thresholdValue: 35,
|
|
57
|
-
thresholdUnit: constants_default.HOUR
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
key: "dd",
|
|
61
|
-
thresholdValue: 25,
|
|
62
|
-
thresholdUnit: constants_default.DAY
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
key: "M",
|
|
66
|
-
thresholdValue: 45,
|
|
67
|
-
thresholdUnit: constants_default.DAY
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
key: "MM",
|
|
71
|
-
thresholdValue: 10,
|
|
72
|
-
thresholdUnit: constants_default.MONTH
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
key: "y",
|
|
76
|
-
thresholdValue: 17,
|
|
77
|
-
thresholdUnit: constants_default.MONTH
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
key: "yy",
|
|
81
|
-
thresholdUnit: constants_default.YEAR
|
|
82
|
-
}
|
|
83
|
-
];
|
|
84
|
-
const rounding = options.rounding ?? Math.round;
|
|
85
|
-
/**
|
|
86
|
-
* Calculate the difference between instance and referenceDate in given units
|
|
87
|
-
* as fractional value for 'from' and 'to'
|
|
88
|
-
* @param instance - date to calculate difference for
|
|
89
|
-
* @param referenceDate - base date for calculating the difference
|
|
90
|
-
* @param unit - unit of the difference
|
|
91
|
-
* @param isFrom - difference for 'from'?
|
|
92
|
-
* @returns difference as float
|
|
93
|
-
*/
|
|
94
|
-
function differenceInUnits(instance, referenceDate, unit, isFrom) {
|
|
95
|
-
return isFrom ? referenceDate.diff(instance, unit, true) : instance.diff(referenceDate, unit, true);
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Format instance date as relative to reference date as
|
|
99
|
-
* human readable length of time.
|
|
100
|
-
* @param reference - date the output relates to
|
|
101
|
-
* @param withoutSuffix - format without 'in ---' or '... ago'
|
|
102
|
-
* @param this - date to format
|
|
103
|
-
* @param isFrom - format as 'from' or 'fromNow'
|
|
104
|
-
* @returns difference formatted as human string (e.g. 5 days ago)
|
|
105
|
-
*/
|
|
106
|
-
function fromToBase(reference, withoutSuffix, isFrom) {
|
|
107
|
-
const referenceDate = dayFactory(reference);
|
|
108
|
-
if (!(this.isValid() && referenceDate.isValid())) return constants_default.INVALID_DATE_STRING;
|
|
109
|
-
const locale = this.localeObject?.();
|
|
110
|
-
const relativeTimeDef = locale?.relativeTime ?? defaultRelativeTimeDef;
|
|
111
|
-
let diffAsUnit = 0;
|
|
112
|
-
let out = "";
|
|
113
|
-
let isFuture = false;
|
|
114
|
-
for (let i = 0; i < thresholds.length; i++) {
|
|
115
|
-
const threshold = thresholds[i];
|
|
116
|
-
const thresholdUnit = threshold.thresholdUnit ?? constants_default.SECOND;
|
|
117
|
-
diffAsUnit = differenceInUnits(this, referenceDate, thresholdUnit, isFrom);
|
|
118
|
-
const absoluteDiff = rounding(Math.abs(diffAsUnit));
|
|
119
|
-
isFuture = diffAsUnit > 0;
|
|
120
|
-
if (absoluteDiff <= (threshold.thresholdValue ?? Number.POSITIVE_INFINITY)) {
|
|
121
|
-
const thresholdKey = threshold.key;
|
|
122
|
-
const formatUnit = thresholdKey.slice(0, 1);
|
|
123
|
-
const outputDiff = differenceInUnits(this, referenceDate, formatUnit, isFrom);
|
|
124
|
-
const outputDiffAbs = rounding(Math.abs(outputDiff));
|
|
125
|
-
const format = relativeTimeDef[thresholdKey];
|
|
126
|
-
out = typeof format === "string" ? format.replace("%d", `${outputDiffAbs}`) : format(outputDiffAbs, withoutSuffix, thresholdKey, isFuture);
|
|
127
|
-
const postFormat = locale?.postFormat;
|
|
128
|
-
if (postFormat) out = postFormat(out);
|
|
129
|
-
break;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
if (withoutSuffix) return out;
|
|
133
|
-
const suffix = isFuture ? relativeTimeDef.future : relativeTimeDef.past;
|
|
134
|
-
return typeof suffix === "function" ? suffix(out, withoutSuffix, isFuture ? "future" : "past", isFuture) : suffix.replace("%s", out);
|
|
135
|
-
}
|
|
136
|
-
proto.to = function(referenceDate, withoutSuffix) {
|
|
137
|
-
return fromToBase.call(this, referenceDate, withoutSuffix ?? false, true);
|
|
138
|
-
};
|
|
139
|
-
proto.from = function(referenceDate, withoutSuffix) {
|
|
140
|
-
return fromToBase.call(this, referenceDate, withoutSuffix ?? false, false);
|
|
141
|
-
};
|
|
142
|
-
proto.toNow = function(withoutSuffix) {
|
|
143
|
-
const now = createInstanceFromExist(/* @__PURE__ */ new Date(), this);
|
|
144
|
-
return this.to(now, withoutSuffix);
|
|
145
|
-
};
|
|
146
|
-
proto.fromNow = function(withoutSuffix) {
|
|
147
|
-
const now = createInstanceFromExist(/* @__PURE__ */ new Date(), this);
|
|
148
|
-
return this.from(now, withoutSuffix);
|
|
149
|
-
};
|
|
150
|
-
};
|
|
151
|
-
var relativeTime_default = relativeTimePlugin;
|
|
152
|
-
|
|
153
|
-
//#endregion
|
|
154
|
-
export { relativeTime_default as default };
|