esday 0.4.1 → 0.5.0
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 +8 -0
- package/LICENSE +21 -0
- package/README.md +20 -2
- package/chunks/B5f9poqo.js +120 -0
- package/chunks/BDssPbM_.js +106 -0
- package/chunks/BRRrAbUl.js +56 -0
- package/chunks/BXRGSAJG.js +128 -0
- package/chunks/BeVgU2nj.js +188 -0
- package/chunks/BtmEtAW3.js +43 -0
- package/chunks/CQ57zhVp.js +106 -0
- package/chunks/CQJ0-ZuR.js +106 -0
- package/chunks/CWqzr5E5.js +108 -0
- package/chunks/Cb5SvF6r.js +25 -0
- package/chunks/Cg4ZI9v8.js +180 -0
- package/chunks/CoBtJ4c1.js +144 -0
- package/chunks/D009Z-ld.js +109 -0
- package/chunks/DMtTiWuY.js +127 -0
- package/chunks/DXHbH1CI.js +9 -0
- package/chunks/Dixb5KKs.js +116 -0
- package/chunks/DjY7KvwG.js +28 -0
- package/chunks/DqhiVwLi.d.ts +203 -0
- package/chunks/GjKpN6U-.js +135 -0
- package/chunks/MtjcOKi-.d.ts +6 -0
- package/chunks/St35qgL0.d.ts +103 -0
- package/chunks/Y32qdU_5.js +62 -0
- package/chunks/br7kModF.js +110 -0
- package/chunks/l2Rxo2H0.js +106 -0
- package/chunks/tfkJ5D3p.js +115 -0
- package/index.d.ts +3 -6
- package/index.js +556 -293
- package/locales/af.d.ts +8 -0
- package/locales/af.js +106 -0
- package/locales/am.d.ts +8 -0
- package/locales/am.js +106 -0
- package/locales/ar-dz.d.ts +11 -0
- package/locales/ar-dz.js +32 -0
- package/locales/ar-iq.d.ts +11 -0
- package/locales/ar-iq.js +14 -0
- package/locales/ar-kw.d.ts +11 -0
- package/locales/ar-kw.js +28 -0
- package/locales/ar-ly.d.ts +11 -0
- package/locales/ar-ly.js +14 -0
- package/locales/ar-ma.d.ts +11 -0
- package/locales/ar-ma.js +29 -0
- package/locales/ar-sa.d.ts +11 -0
- package/locales/ar-sa.js +29 -0
- package/locales/ar-tn.d.ts +11 -0
- package/locales/ar-tn.js +29 -0
- package/locales/ar.d.ts +8 -0
- package/locales/ar.js +3 -0
- package/locales/az.d.ts +8 -0
- package/locales/az.js +106 -0
- package/locales/be.d.ts +8 -0
- package/locales/be.js +140 -0
- package/locales/bg.d.ts +8 -0
- package/locales/bg.js +125 -0
- package/locales/bi.d.ts +8 -0
- package/locales/bi.js +106 -0
- package/locales/bm.d.ts +8 -0
- package/locales/bm.js +106 -0
- package/locales/bn-bd.d.ts +11 -0
- package/locales/bn-bd.js +24 -0
- package/locales/bn.d.ts +8 -0
- package/locales/bn.js +3 -0
- package/locales/bo.d.ts +8 -0
- package/locales/bo.js +106 -0
- package/locales/br.d.ts +8 -0
- package/locales/br.js +179 -0
- package/locales/bs.d.ts +8 -0
- package/locales/bs.js +128 -0
- package/locales/ca.d.ts +8 -0
- package/locales/ca.js +143 -0
- package/locales/cs.d.ts +8 -0
- package/locales/cs.js +182 -0
- package/locales/cv.d.ts +8 -0
- package/locales/cv.js +106 -0
- package/locales/cy.d.ts +8 -0
- package/locales/cy.js +106 -0
- package/locales/da.d.ts +8 -0
- package/locales/da.js +106 -0
- package/locales/de-at.d.ts +11 -0
- package/locales/de-at.js +44 -0
- package/locales/de-ch.d.ts +11 -0
- package/locales/de-ch.js +14 -0
- package/locales/de.d.ts +8 -0
- package/locales/de.js +3 -0
- package/locales/dv.d.ts +8 -0
- package/locales/dv.js +106 -0
- package/locales/el.d.ts +8 -0
- package/locales/el.js +115 -0
- package/locales/en-au.d.ts +11 -0
- package/locales/en-au.js +27 -0
- package/locales/en-ca.d.ts +11 -0
- package/locales/en-ca.js +27 -0
- package/locales/en-gb.d.ts +13 -0
- package/locales/en-gb.js +28 -0
- package/locales/en-ie.d.ts +11 -0
- package/locales/en-ie.js +26 -0
- package/locales/en-il.d.ts +11 -0
- package/locales/en-il.js +28 -0
- package/locales/en-in.d.ts +11 -0
- package/locales/en-in.js +26 -0
- package/locales/en-nz.d.ts +11 -0
- package/locales/en-nz.js +28 -0
- package/locales/en-sg.d.ts +11 -0
- package/locales/en-sg.js +28 -0
- package/locales/en-tt.d.ts +11 -0
- package/locales/en-tt.js +28 -0
- package/locales/en-us.d.ts +11 -0
- package/locales/en-us.js +13 -0
- package/locales/en.d.ts +7 -5
- package/locales/en.js +3 -1
- package/locales/eo.d.ts +8 -0
- package/locales/eo.js +106 -0
- package/locales/es-do.d.ts +11 -0
- package/locales/es-do.js +27 -0
- package/locales/es-mx.d.ts +11 -0
- package/locales/es-mx.js +15 -0
- package/locales/es-pr.d.ts +11 -0
- package/locales/es-pr.js +18 -0
- package/locales/es-us.d.ts +11 -0
- package/locales/es-us.js +14 -0
- package/locales/es.d.ts +8 -0
- package/locales/es.js +3 -0
- package/locales/et.d.ts +8 -0
- package/locales/et.js +142 -0
- package/locales/eu.d.ts +8 -0
- package/locales/eu.js +106 -0
- package/locales/fa.d.ts +8 -0
- package/locales/fa.js +106 -0
- package/locales/fi.d.ts +8 -0
- package/locales/fi.js +165 -0
- package/locales/fil.d.ts +8 -0
- package/locales/fil.js +106 -0
- package/locales/fo.d.ts +8 -0
- package/locales/fo.js +106 -0
- package/locales/fr-ca.d.ts +11 -0
- package/locales/fr-ca.js +18 -0
- package/locales/fr-ch.d.ts +11 -0
- package/locales/fr-ch.js +18 -0
- package/locales/fr.d.ts +8 -0
- package/locales/fr.js +3 -0
- package/locales/fy.d.ts +8 -0
- package/locales/fy.js +106 -0
- package/locales/ga.d.ts +8 -0
- package/locales/ga.js +106 -0
- package/locales/gd.d.ts +8 -0
- package/locales/gd.js +106 -0
- package/locales/gl.d.ts +8 -0
- package/locales/gl.js +116 -0
- package/locales/gom-deva.d.ts +8 -0
- package/locales/gom-deva.js +146 -0
- package/locales/gom-latn.d.ts +8 -0
- package/locales/gom-latn.js +146 -0
- package/locales/gu.d.ts +8 -0
- package/locales/gu.js +106 -0
- package/locales/he.d.ts +8 -0
- package/locales/he.js +129 -0
- package/locales/hi.d.ts +8 -0
- package/locales/hi.js +125 -0
- package/locales/hr.d.ts +8 -0
- package/locales/hr.js +189 -0
- package/locales/ht.d.ts +8 -0
- package/locales/ht.js +106 -0
- package/locales/hu.d.ts +8 -0
- package/locales/hu.js +140 -0
- package/locales/hy-am.d.ts +8 -0
- package/locales/hy-am.js +127 -0
- package/locales/id.d.ts +8 -0
- package/locales/id.js +106 -0
- package/locales/is.d.ts +8 -0
- package/locales/is.js +155 -0
- package/locales/it-ch.d.ts +11 -0
- package/locales/it-ch.js +32 -0
- package/locales/it.d.ts +8 -0
- package/locales/it.js +3 -0
- package/locales/ja.d.ts +15 -0
- package/locales/ja.js +109 -0
- package/locales/jv.d.ts +8 -0
- package/locales/jv.js +106 -0
- package/locales/ka.d.ts +8 -0
- package/locales/ka.js +126 -0
- package/locales/kk.d.ts +8 -0
- package/locales/kk.js +106 -0
- package/locales/km.d.ts +8 -0
- package/locales/km.js +106 -0
- package/locales/kn.d.ts +8 -0
- package/locales/kn.js +106 -0
- package/locales/ko.d.ts +8 -0
- package/locales/ko.js +105 -0
- package/locales/ku.d.ts +8 -0
- package/locales/ku.js +119 -0
- package/locales/ky.d.ts +8 -0
- package/locales/ky.js +106 -0
- package/locales/lb.d.ts +8 -0
- package/locales/lb.js +166 -0
- package/locales/lo.d.ts +8 -0
- package/locales/lo.js +105 -0
- package/locales/lt.d.ts +8 -0
- package/locales/lt.js +106 -0
- package/locales/lv.d.ts +8 -0
- package/locales/lv.js +106 -0
- package/locales/me.d.ts +8 -0
- package/locales/me.js +129 -0
- package/locales/mi.d.ts +8 -0
- package/locales/mi.js +106 -0
- package/locales/mk.d.ts +8 -0
- package/locales/mk.js +117 -0
- package/locales/ml.d.ts +8 -0
- package/locales/ml.js +109 -0
- package/locales/mn.d.ts +8 -0
- package/locales/mn.js +106 -0
- package/locales/mr.d.ts +8 -0
- package/locales/mr.js +215 -0
- package/locales/ms-my.d.ts +11 -0
- package/locales/ms-my.js +14 -0
- package/locales/ms.d.ts +8 -0
- package/locales/ms.js +3 -0
- package/locales/mt.d.ts +8 -0
- package/locales/mt.js +106 -0
- package/locales/my.d.ts +8 -0
- package/locales/my.js +132 -0
- package/locales/nb.d.ts +8 -0
- package/locales/nb.js +106 -0
- package/locales/ne.d.ts +8 -0
- package/locales/ne.js +106 -0
- package/locales/nl-be.d.ts +11 -0
- package/locales/nl-be.js +18 -0
- package/locales/nl.d.ts +8 -0
- package/locales/nl.js +3 -0
- package/locales/nn.d.ts +8 -0
- package/locales/nn.js +106 -0
- package/locales/oc-lnc.d.ts +8 -0
- package/locales/oc-lnc.js +126 -0
- package/locales/pa-in.d.ts +8 -0
- package/locales/pa-in.js +123 -0
- package/locales/pl.d.ts +8 -0
- package/locales/pl.js +159 -0
- package/locales/pt-br.d.ts +11 -0
- package/locales/pt-br.js +53 -0
- package/locales/pt.d.ts +8 -0
- package/locales/pt.js +3 -0
- package/locales/rn.d.ts +8 -0
- package/locales/rn.js +106 -0
- package/locales/ro.d.ts +8 -0
- package/locales/ro.js +106 -0
- package/locales/ru.d.ts +15 -0
- package/locales/ru.js +236 -0
- package/locales/rw.d.ts +8 -0
- package/locales/rw.js +106 -0
- package/locales/sd.d.ts +8 -0
- package/locales/sd.js +106 -0
- package/locales/se.d.ts +8 -0
- package/locales/se.js +106 -0
- package/locales/si.d.ts +8 -0
- package/locales/si.js +106 -0
- package/locales/sk.d.ts +8 -0
- package/locales/sk.js +162 -0
- package/locales/sl.d.ts +8 -0
- package/locales/sl.js +171 -0
- package/locales/sq.d.ts +8 -0
- package/locales/sq.js +106 -0
- package/locales/sr-cyrl.d.ts +11 -0
- package/locales/sr-cyrl.js +173 -0
- package/locales/sr.d.ts +8 -0
- package/locales/sr.js +3 -0
- package/locales/ss.d.ts +8 -0
- package/locales/ss.js +108 -0
- package/locales/sv-fi.d.ts +11 -0
- package/locales/sv-fi.js +27 -0
- package/locales/sv.d.ts +8 -0
- package/locales/sv.js +3 -0
- package/locales/sw.d.ts +8 -0
- package/locales/sw.js +106 -0
- package/locales/ta.d.ts +8 -0
- package/locales/ta.js +137 -0
- package/locales/te.d.ts +8 -0
- package/locales/te.js +109 -0
- package/locales/tet.d.ts +8 -0
- package/locales/tet.js +110 -0
- package/locales/tg.d.ts +8 -0
- package/locales/tg.js +128 -0
- package/locales/th.d.ts +8 -0
- package/locales/th.js +106 -0
- package/locales/tk.d.ts +8 -0
- package/locales/tk.js +134 -0
- package/locales/tl-ph.d.ts +8 -0
- package/locales/tl-ph.js +106 -0
- package/locales/tlh.d.ts +8 -0
- package/locales/tlh.js +152 -0
- package/locales/tr.d.ts +8 -0
- package/locales/tr.js +134 -0
- package/locales/tzl.d.ts +8 -0
- package/locales/tzl.js +123 -0
- package/locales/tzm-latn.d.ts +11 -0
- package/locales/tzm-latn.js +68 -0
- package/locales/tzm.d.ts +8 -0
- package/locales/tzm.js +3 -0
- package/locales/ug-cn.d.ts +8 -0
- package/locales/ug-cn.js +111 -0
- package/locales/uk.d.ts +8 -0
- package/locales/uk.js +194 -0
- package/locales/ur.d.ts +8 -0
- package/locales/ur.js +108 -0
- package/locales/uz-latn.d.ts +11 -0
- package/locales/uz-latn.js +68 -0
- package/locales/uz.d.ts +8 -0
- package/locales/uz.js +3 -0
- package/locales/vi.d.ts +8 -0
- package/locales/vi.js +106 -0
- package/locales/x-pseudo.d.ts +8 -0
- package/locales/x-pseudo.js +110 -0
- package/locales/yo.d.ts +8 -0
- package/locales/yo.js +106 -0
- package/locales/zh-cn.d.ts +11 -0
- package/locales/zh-cn.js +14 -0
- package/locales/zh-hk.d.ts +11 -0
- package/locales/zh-hk.js +23 -0
- package/locales/zh-mo.d.ts +11 -0
- package/locales/zh-mo.js +23 -0
- package/locales/zh-tw.d.ts +11 -0
- package/locales/zh-tw.js +23 -0
- package/locales/zh.d.ts +13 -4
- package/locales/zh.js +2 -63
- package/package.json +51 -25
- package/plugins/advancedFormat/index.d.ts +8 -0
- package/plugins/advancedFormat/index.js +20 -0
- package/plugins/advancedParse/index.d.ts +8 -0
- package/plugins/advancedParse/index.js +406 -0
- package/plugins/calendar/index.d.ts +14 -0
- package/plugins/calendar/index.js +33 -0
- package/plugins/dayOfYear/index.d.ts +13 -0
- package/plugins/dayOfYear/index.js +12 -0
- package/plugins/isBetween/index.d.ts +23 -0
- package/plugins/isBetween/index.js +16 -0
- package/plugins/isLeapYear/index.d.ts +12 -0
- package/plugins/isLeapYear/index.js +11 -0
- package/plugins/isSameOrAfter/index.d.ts +12 -0
- package/plugins/isSameOrAfter/index.js +10 -0
- package/plugins/isSameOrBefore/index.d.ts +12 -0
- package/plugins/isSameOrBefore/index.js +10 -0
- package/plugins/isToday/index.d.ts +8 -6
- package/plugins/isToday/index.js +10 -6
- package/plugins/isTomorrow/index.d.ts +12 -0
- package/plugins/isTomorrow/index.js +14 -0
- package/plugins/isYesterday/index.d.ts +12 -0
- package/plugins/isYesterday/index.js +14 -0
- package/plugins/isoWeek/index.d.ts +21 -0
- package/plugins/isoWeek/index.js +240 -0
- package/plugins/locale/index.d.ts +4 -75
- package/plugins/locale/index.js +6 -69
- package/plugins/localeData/index.d.ts +8 -0
- package/plugins/localeData/index.js +148 -0
- package/plugins/localizedFormat/index.d.ts +8 -0
- package/plugins/localizedFormat/index.js +88 -0
- package/plugins/localizedParse/index.d.ts +8 -0
- package/plugins/localizedParse/index.js +199 -0
- package/plugins/minMax/index.d.ts +13 -0
- package/plugins/minMax/index.js +22 -0
- package/plugins/objectSupport/index.d.ts +8 -0
- package/plugins/objectSupport/index.js +104 -0
- package/plugins/pluralGetSet/index.d.ts +20 -0
- package/plugins/pluralGetSet/index.js +16 -0
- package/plugins/quarterOfYear/index.d.ts +16 -0
- package/plugins/quarterOfYear/index.js +58 -0
- package/plugins/relativeTime/index.d.ts +59 -0
- package/plugins/relativeTime/index.js +154 -0
- package/plugins/toArray/index.d.ts +12 -0
- package/plugins/toArray/index.js +18 -0
- package/plugins/toObject/index.d.ts +20 -0
- package/plugins/toObject/index.js +18 -0
- package/plugins/utc/index.d.ts +14 -17
- package/plugins/utc/index.js +191 -37
- package/plugins/week/index.d.ts +21 -0
- package/plugins/week/index.js +360 -0
- package/EsDay-KXQgnL1r.d.ts +0 -89
- package/chunk-MLKGABMK.js +0 -7
- package/chunk-NUV73YDM.js +0 -60
- package/chunk-SQBPUYUY.js +0 -140
- package/plugins/customParseFormat/index.d.ts +0 -5
- package/plugins/customParseFormat/index.js +0 -159
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { isString } from '../../chunk-SQBPUYUY.js';
|
|
2
|
-
|
|
3
|
-
// src/plugins/customParseFormat/index.ts
|
|
4
|
-
var formattingTokens = /(\[[^[]*\])|([-_:/.,()\s]+)|([AaQz]|YYYY|YY?|ww?|MM?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|ZZ?)/g;
|
|
5
|
-
var match1 = /\d/;
|
|
6
|
-
var match2 = /\d{2}/;
|
|
7
|
-
var match3 = /\d{3}/;
|
|
8
|
-
var match4 = /\d{4}/;
|
|
9
|
-
var match1to2 = /\d\d?/;
|
|
10
|
-
var matchSigned = /[+-]?\d+/;
|
|
11
|
-
var matchOffset = /[+-]\d\d:?(\d\d)?|Z/;
|
|
12
|
-
function parseTwoDigitYear(input) {
|
|
13
|
-
const year = +input;
|
|
14
|
-
return year + (year > 68 ? 1900 : 2e3);
|
|
15
|
-
}
|
|
16
|
-
function offsetFromString(offset) {
|
|
17
|
-
if (!offset)
|
|
18
|
-
return 0;
|
|
19
|
-
if (offset === "Z")
|
|
20
|
-
return 0;
|
|
21
|
-
const parts = offset.match(/([+-]|\d\d)/g);
|
|
22
|
-
if (!parts)
|
|
23
|
-
return 0;
|
|
24
|
-
const minutes = +parts[1] * 60 + (+parts[2] || 0);
|
|
25
|
-
return parts[0] === "+" ? -minutes : minutes;
|
|
26
|
-
}
|
|
27
|
-
function addInput(property) {
|
|
28
|
-
return function(input) {
|
|
29
|
-
this[property] = +input;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
var expressions = {
|
|
33
|
-
A: [match1, function() {
|
|
34
|
-
this.afternoon = true;
|
|
35
|
-
}],
|
|
36
|
-
a: [match1, function() {
|
|
37
|
-
this.afternoon = true;
|
|
38
|
-
}],
|
|
39
|
-
Q: [match1, function(input) {
|
|
40
|
-
this.month = (Number.parseInt(input, 10) - 1) * 3 + 1;
|
|
41
|
-
}],
|
|
42
|
-
S: [match1, function(input) {
|
|
43
|
-
this.milliseconds = +input * 100;
|
|
44
|
-
}],
|
|
45
|
-
SS: [match2, function(input) {
|
|
46
|
-
this.milliseconds = +input * 10;
|
|
47
|
-
}],
|
|
48
|
-
SSS: [match3, function(input) {
|
|
49
|
-
this.milliseconds = +input;
|
|
50
|
-
}],
|
|
51
|
-
s: [match1to2, addInput("seconds")],
|
|
52
|
-
ss: [match1to2, addInput("seconds")],
|
|
53
|
-
m: [match1to2, addInput("minutes")],
|
|
54
|
-
mm: [match1to2, addInput("minutes")],
|
|
55
|
-
H: [match1to2, addInput("hours")],
|
|
56
|
-
h: [match1to2, addInput("hours")],
|
|
57
|
-
HH: [match1to2, addInput("hours")],
|
|
58
|
-
hh: [match1to2, addInput("hours")],
|
|
59
|
-
D: [match1to2, addInput("day")],
|
|
60
|
-
DD: [match2, addInput("day")],
|
|
61
|
-
Do: [match1to2, function(input) {
|
|
62
|
-
this.day = Number.parseInt(input.match(/\d+/)?.[0] || "0", 10);
|
|
63
|
-
}],
|
|
64
|
-
w: [match1to2, addInput("week")],
|
|
65
|
-
ww: [match2, addInput("week")],
|
|
66
|
-
M: [match1to2, addInput("month")],
|
|
67
|
-
MM: [match2, addInput("month")],
|
|
68
|
-
Y: [matchSigned, addInput("year")],
|
|
69
|
-
YY: [match2, function(input) {
|
|
70
|
-
this.year = parseTwoDigitYear(input);
|
|
71
|
-
}],
|
|
72
|
-
YYYY: [match4, addInput("year")],
|
|
73
|
-
Z: [matchOffset, function(input) {
|
|
74
|
-
this.zone = { offset: offsetFromString(input) };
|
|
75
|
-
}],
|
|
76
|
-
ZZ: [matchOffset, function(input) {
|
|
77
|
-
this.zone = { offset: offsetFromString(input) };
|
|
78
|
-
}]
|
|
79
|
-
};
|
|
80
|
-
function correctHours(time) {
|
|
81
|
-
if (time.afternoon !== void 0) {
|
|
82
|
-
if (time.hours !== void 0) {
|
|
83
|
-
if (time.afternoon) {
|
|
84
|
-
if (time.hours < 12)
|
|
85
|
-
time.hours += 12;
|
|
86
|
-
} else if (time.hours === 12) {
|
|
87
|
-
time.hours = 0;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
delete time.afternoon;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
function makeParser(format) {
|
|
94
|
-
const array = format.match(formattingTokens) || [];
|
|
95
|
-
const { length } = array;
|
|
96
|
-
for (let i = 0; i < length; i += 1) {
|
|
97
|
-
const token = array[i];
|
|
98
|
-
const parseTo = expressions[token];
|
|
99
|
-
const regex = parseTo && parseTo[0];
|
|
100
|
-
const parser = parseTo && parseTo[1];
|
|
101
|
-
if (parser) {
|
|
102
|
-
array[i] = { regex, parser };
|
|
103
|
-
} else {
|
|
104
|
-
array[i] = token.replace(/^\[|\]$/g, "");
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
return function(input) {
|
|
108
|
-
const time = {};
|
|
109
|
-
for (let i = 0, start = 0; i < length; i += 1) {
|
|
110
|
-
const token = array[i];
|
|
111
|
-
if (typeof token === "string") {
|
|
112
|
-
start += token.length;
|
|
113
|
-
} else {
|
|
114
|
-
const { regex, parser } = token;
|
|
115
|
-
const part = input.slice(start);
|
|
116
|
-
const match = regex.exec(part);
|
|
117
|
-
const value = match[0];
|
|
118
|
-
parser.call(time, value);
|
|
119
|
-
input = input.replace(value, "");
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
correctHours(time);
|
|
123
|
-
return time;
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
function parseFormattedInput(input, format, utc) {
|
|
127
|
-
try {
|
|
128
|
-
const parser = makeParser(format);
|
|
129
|
-
const { year, month, day, hours, minutes, seconds, milliseconds, zone } = parser(input);
|
|
130
|
-
if (utc) {
|
|
131
|
-
return new Date(Date.UTC(year || 0, (month || 1) - 1, day || 1, hours || 0, minutes || 0, seconds || 0, milliseconds || 0));
|
|
132
|
-
}
|
|
133
|
-
if (zone) {
|
|
134
|
-
const offsetMs = (zone.offset || 0) * 6e4;
|
|
135
|
-
return new Date(Date.UTC(year || 0, (month || 1) - 1, day || 1, hours || 0, minutes || 0, seconds || 0, milliseconds || 0) - offsetMs);
|
|
136
|
-
}
|
|
137
|
-
return new Date(year || 0, (month || 1) - 1, day || 1, hours || 0, minutes || 0, seconds || 0, milliseconds || 0);
|
|
138
|
-
} catch {
|
|
139
|
-
return new Date(Number.NaN);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
var customParseFormatPlugin = (_, dayTsClass) => {
|
|
143
|
-
const oldParse = dayTsClass.prototype["parse"];
|
|
144
|
-
dayTsClass.prototype["parse"] = function(d) {
|
|
145
|
-
const format = this["$conf"].args_1;
|
|
146
|
-
if (isString(d) && isString(format)) {
|
|
147
|
-
const date = parseFormattedInput(d, format, !!this["$conf"].utc);
|
|
148
|
-
if (Number.isNaN(date.getTime())) {
|
|
149
|
-
this["$d"] = /* @__PURE__ */ new Date("");
|
|
150
|
-
} else {
|
|
151
|
-
this["$d"] = date;
|
|
152
|
-
}
|
|
153
|
-
} else {
|
|
154
|
-
oldParse.call(this, d);
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
export { customParseFormatPlugin };
|