@weni/unnnic-system 3.35.2-alpha.2 → 3.35.2-alpha.3
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/dist/components/DateFilter/DateFilter.vue.mjs +25 -29
- package/dist/components/InputDatePicker/InputDatePicker.vue.mjs +1 -1
- package/dist/components/InputDatePicker/InputDatePicker.vue2.mjs +38 -32
- package/dist/components/InputDatePicker/InputDatePicker2.css +1 -1
- package/dist/index.d.ts +18 -0
- package/dist/node_modules/date-fns/_lib/addLeadingZeros.mjs +7 -0
- package/dist/node_modules/date-fns/_lib/defaultOptions.mjs +7 -0
- package/dist/node_modules/date-fns/_lib/format/formatters.mjs +515 -0
- package/dist/node_modules/date-fns/_lib/format/lightFormatters.mjs +59 -0
- package/dist/node_modules/date-fns/_lib/format/longFormatters.mjs +52 -0
- package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.mjs +18 -0
- package/dist/node_modules/date-fns/_lib/normalizeDates.mjs +11 -0
- package/dist/node_modules/date-fns/_lib/protectedTokens.mjs +20 -0
- package/dist/node_modules/date-fns/addDays.mjs +9 -0
- package/dist/node_modules/date-fns/constants.mjs +9 -0
- package/dist/node_modules/date-fns/constructFrom.mjs +7 -0
- package/dist/node_modules/date-fns/differenceInCalendarDays.mjs +15 -0
- package/dist/node_modules/date-fns/format.mjs +58 -0
- package/dist/node_modules/date-fns/getDayOfYear.mjs +10 -0
- package/dist/node_modules/date-fns/getDefaultOptions.mjs +7 -0
- package/dist/node_modules/date-fns/getISODay.mjs +8 -0
- package/dist/node_modules/date-fns/getISOWeek.mjs +11 -0
- package/dist/node_modules/date-fns/getISOWeekYear.mjs +14 -0
- package/dist/node_modules/date-fns/getWeek.mjs +11 -0
- package/dist/node_modules/date-fns/getWeekYear.mjs +16 -0
- package/dist/node_modules/date-fns/isDate.mjs +6 -0
- package/dist/node_modules/date-fns/isValid.mjs +8 -0
- package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.mjs +9 -0
- package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.mjs +18 -0
- package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.mjs +31 -0
- package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.mjs +15 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.mjs +70 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.mjs +33 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.mjs +11 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/localize.mjs +155 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/match.mjs +110 -0
- package/dist/node_modules/date-fns/locale/en-US.mjs +20 -0
- package/dist/node_modules/date-fns/parse/_lib/Parser.mjs +22 -0
- package/dist/node_modules/date-fns/parse/_lib/Setter.mjs +41 -0
- package/dist/node_modules/date-fns/parse/_lib/constants.mjs +49 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.mjs +49 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/AMPMParser.mjs +49 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/DateParser.mjs +61 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.mjs +51 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/DayParser.mjs +45 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.mjs +49 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/EraParser.mjs +30 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.mjs +21 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.mjs +22 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.mjs +32 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.mjs +32 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.mjs +33 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.mjs +33 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/ISODayParser.mjs +99 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.mjs +48 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.mjs +48 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.mjs +49 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.mjs +40 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.mjs +74 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.mjs +48 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.mjs +69 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/MinuteParser.mjs +32 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/MonthParser.mjs +71 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/QuarterParser.mjs +70 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/SecondParser.mjs +32 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.mjs +74 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.mjs +71 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.mjs +70 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.mjs +22 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.mjs +22 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers/YearParser.mjs +49 -0
- package/dist/node_modules/date-fns/parse/_lib/parsers.mjs +67 -0
- package/dist/node_modules/date-fns/parse/_lib/utils.mjs +103 -0
- package/dist/node_modules/date-fns/parse.mjs +88 -0
- package/dist/node_modules/date-fns/setDay.mjs +11 -0
- package/dist/node_modules/date-fns/setISODay.mjs +10 -0
- package/dist/node_modules/date-fns/setISOWeek.mjs +9 -0
- package/dist/node_modules/date-fns/setWeek.mjs +9 -0
- package/dist/node_modules/date-fns/startOfDay.mjs +8 -0
- package/dist/node_modules/date-fns/startOfISOWeek.mjs +7 -0
- package/dist/node_modules/date-fns/startOfISOWeekYear.mjs +10 -0
- package/dist/node_modules/date-fns/startOfWeek.mjs +10 -0
- package/dist/node_modules/date-fns/startOfWeekYear.mjs +12 -0
- package/dist/node_modules/date-fns/startOfYear.mjs +8 -0
- package/dist/node_modules/date-fns/toDate.mjs +7 -0
- package/dist/node_modules/date-fns/transpose.mjs +17 -0
- package/dist/style.css +1 -1
- package/dist/unnnic.umd.js +19 -19
- package/dist/utils/formatDate.mjs +30 -0
- package/package.json +2 -1
- package/src/components/DateFilter/DateFilter.vue +12 -9
- package/src/components/DateFilter/__test__/DateFilter.spec.js +41 -0
- package/src/components/InputDatePicker/InputDatePicker.vue +26 -14
- package/src/components/InputDatePicker/__test__/InputDatePicker.spec.js +112 -0
- package/src/components/InputDatePicker/__test__/formatDate.spec.ts +75 -0
- package/src/stories/DateFilter.stories.js +1 -0
- package/src/stories/InputDatePicker.stories.js +3 -0
- package/src/utils/formatDate.ts +76 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
var d = Object.defineProperty;
|
|
2
|
+
var f = (o, t, r) => t in o ? d(o, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : o[t] = r;
|
|
3
|
+
var s = (o, t, r) => f(o, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { setISODay as u } from "../../../setISODay.mjs";
|
|
5
|
+
import { Parser as y } from "../Parser.mjs";
|
|
6
|
+
import { mapValue as n, parseNDigits as c } from "../utils.mjs";
|
|
7
|
+
class b extends y {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
s(this, "priority", 90);
|
|
11
|
+
s(this, "incompatibleTokens", [
|
|
12
|
+
"y",
|
|
13
|
+
"Y",
|
|
14
|
+
"u",
|
|
15
|
+
"q",
|
|
16
|
+
"Q",
|
|
17
|
+
"M",
|
|
18
|
+
"L",
|
|
19
|
+
"w",
|
|
20
|
+
"d",
|
|
21
|
+
"D",
|
|
22
|
+
"E",
|
|
23
|
+
"e",
|
|
24
|
+
"c",
|
|
25
|
+
"t",
|
|
26
|
+
"T"
|
|
27
|
+
]);
|
|
28
|
+
}
|
|
29
|
+
parse(r, e, i) {
|
|
30
|
+
const a = (w) => w === 0 ? 7 : w;
|
|
31
|
+
switch (e) {
|
|
32
|
+
case "i":
|
|
33
|
+
case "ii":
|
|
34
|
+
return c(e.length, r);
|
|
35
|
+
case "io":
|
|
36
|
+
return i.ordinalNumber(r, { unit: "day" });
|
|
37
|
+
case "iii":
|
|
38
|
+
return n(
|
|
39
|
+
i.day(r, {
|
|
40
|
+
width: "abbreviated",
|
|
41
|
+
context: "formatting"
|
|
42
|
+
}) || i.day(r, {
|
|
43
|
+
width: "short",
|
|
44
|
+
context: "formatting"
|
|
45
|
+
}) || i.day(r, {
|
|
46
|
+
width: "narrow",
|
|
47
|
+
context: "formatting"
|
|
48
|
+
}),
|
|
49
|
+
a
|
|
50
|
+
);
|
|
51
|
+
case "iiiii":
|
|
52
|
+
return n(
|
|
53
|
+
i.day(r, {
|
|
54
|
+
width: "narrow",
|
|
55
|
+
context: "formatting"
|
|
56
|
+
}),
|
|
57
|
+
a
|
|
58
|
+
);
|
|
59
|
+
case "iiiiii":
|
|
60
|
+
return n(
|
|
61
|
+
i.day(r, {
|
|
62
|
+
width: "short",
|
|
63
|
+
context: "formatting"
|
|
64
|
+
}) || i.day(r, {
|
|
65
|
+
width: "narrow",
|
|
66
|
+
context: "formatting"
|
|
67
|
+
}),
|
|
68
|
+
a
|
|
69
|
+
);
|
|
70
|
+
case "iiii":
|
|
71
|
+
default:
|
|
72
|
+
return n(
|
|
73
|
+
i.day(r, {
|
|
74
|
+
width: "wide",
|
|
75
|
+
context: "formatting"
|
|
76
|
+
}) || i.day(r, {
|
|
77
|
+
width: "abbreviated",
|
|
78
|
+
context: "formatting"
|
|
79
|
+
}) || i.day(r, {
|
|
80
|
+
width: "short",
|
|
81
|
+
context: "formatting"
|
|
82
|
+
}) || i.day(r, {
|
|
83
|
+
width: "narrow",
|
|
84
|
+
context: "formatting"
|
|
85
|
+
}),
|
|
86
|
+
a
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
validate(r, e) {
|
|
91
|
+
return e >= 1 && e <= 7;
|
|
92
|
+
}
|
|
93
|
+
set(r, e, i) {
|
|
94
|
+
return r = u(r, i), r.setHours(0, 0, 0, 0), r;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
export {
|
|
98
|
+
b as ISODayParser
|
|
99
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
var x = Object.defineProperty;
|
|
2
|
+
var c = (s, r, e) => r in s ? x(s, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[r] = e;
|
|
3
|
+
var i = (s, r, e) => c(s, typeof r != "symbol" ? r + "" : r, e);
|
|
4
|
+
import { constructFrom as a } from "../../../constructFrom.mjs";
|
|
5
|
+
import { getTimezoneOffsetInMilliseconds as p } from "../../../_lib/getTimezoneOffsetInMilliseconds.mjs";
|
|
6
|
+
import { timezonePatterns as t } from "../constants.mjs";
|
|
7
|
+
import { Parser as u } from "../Parser.mjs";
|
|
8
|
+
import { parseTimezonePattern as o } from "../utils.mjs";
|
|
9
|
+
class P extends u {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
i(this, "priority", 10);
|
|
13
|
+
i(this, "incompatibleTokens", ["t", "T", "X"]);
|
|
14
|
+
}
|
|
15
|
+
parse(e, n) {
|
|
16
|
+
switch (n) {
|
|
17
|
+
case "x":
|
|
18
|
+
return o(
|
|
19
|
+
t.basicOptionalMinutes,
|
|
20
|
+
e
|
|
21
|
+
);
|
|
22
|
+
case "xx":
|
|
23
|
+
return o(t.basic, e);
|
|
24
|
+
case "xxxx":
|
|
25
|
+
return o(
|
|
26
|
+
t.basicOptionalSeconds,
|
|
27
|
+
e
|
|
28
|
+
);
|
|
29
|
+
case "xxxxx":
|
|
30
|
+
return o(
|
|
31
|
+
t.extendedOptionalSeconds,
|
|
32
|
+
e
|
|
33
|
+
);
|
|
34
|
+
case "xxx":
|
|
35
|
+
default:
|
|
36
|
+
return o(t.extended, e);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
set(e, n, m) {
|
|
40
|
+
return n.timestampIsSet ? e : a(
|
|
41
|
+
e,
|
|
42
|
+
e.getTime() - p(e) - m
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
P as ISOTimezoneParser
|
|
48
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
var c = Object.defineProperty;
|
|
2
|
+
var X = (t, r, e) => r in t ? c(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
|
|
3
|
+
var n = (t, r, e) => X(t, typeof r != "symbol" ? r + "" : r, e);
|
|
4
|
+
import { constructFrom as a } from "../../../constructFrom.mjs";
|
|
5
|
+
import { getTimezoneOffsetInMilliseconds as p } from "../../../_lib/getTimezoneOffsetInMilliseconds.mjs";
|
|
6
|
+
import { timezonePatterns as s } from "../constants.mjs";
|
|
7
|
+
import { Parser as u } from "../Parser.mjs";
|
|
8
|
+
import { parseTimezonePattern as o } from "../utils.mjs";
|
|
9
|
+
class z extends u {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
n(this, "priority", 10);
|
|
13
|
+
n(this, "incompatibleTokens", ["t", "T", "x"]);
|
|
14
|
+
}
|
|
15
|
+
parse(e, i) {
|
|
16
|
+
switch (i) {
|
|
17
|
+
case "X":
|
|
18
|
+
return o(
|
|
19
|
+
s.basicOptionalMinutes,
|
|
20
|
+
e
|
|
21
|
+
);
|
|
22
|
+
case "XX":
|
|
23
|
+
return o(s.basic, e);
|
|
24
|
+
case "XXXX":
|
|
25
|
+
return o(
|
|
26
|
+
s.basicOptionalSeconds,
|
|
27
|
+
e
|
|
28
|
+
);
|
|
29
|
+
case "XXXXX":
|
|
30
|
+
return o(
|
|
31
|
+
s.extendedOptionalSeconds,
|
|
32
|
+
e
|
|
33
|
+
);
|
|
34
|
+
case "XXX":
|
|
35
|
+
default:
|
|
36
|
+
return o(s.extended, e);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
set(e, i, m) {
|
|
40
|
+
return i.timestampIsSet ? e : a(
|
|
41
|
+
e,
|
|
42
|
+
e.getTime() - p(e) - m
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
z as ISOTimezoneWithZParser
|
|
48
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var o = Object.defineProperty;
|
|
2
|
+
var m = (t, r, e) => r in t ? o(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
|
|
3
|
+
var i = (t, r, e) => m(t, typeof r != "symbol" ? r + "" : r, e);
|
|
4
|
+
import { setISOWeek as n } from "../../../setISOWeek.mjs";
|
|
5
|
+
import { startOfISOWeek as p } from "../../../startOfISOWeek.mjs";
|
|
6
|
+
import { numericPatterns as u } from "../constants.mjs";
|
|
7
|
+
import { Parser as c } from "../Parser.mjs";
|
|
8
|
+
import { parseNDigits as f, parseNumericPattern as l } from "../utils.mjs";
|
|
9
|
+
class N extends c {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
i(this, "priority", 100);
|
|
13
|
+
i(this, "incompatibleTokens", [
|
|
14
|
+
"y",
|
|
15
|
+
"Y",
|
|
16
|
+
"u",
|
|
17
|
+
"q",
|
|
18
|
+
"Q",
|
|
19
|
+
"M",
|
|
20
|
+
"L",
|
|
21
|
+
"w",
|
|
22
|
+
"d",
|
|
23
|
+
"D",
|
|
24
|
+
"e",
|
|
25
|
+
"c",
|
|
26
|
+
"t",
|
|
27
|
+
"T"
|
|
28
|
+
]);
|
|
29
|
+
}
|
|
30
|
+
parse(e, s, a) {
|
|
31
|
+
switch (s) {
|
|
32
|
+
case "I":
|
|
33
|
+
return l(u.week, e);
|
|
34
|
+
case "Io":
|
|
35
|
+
return a.ordinalNumber(e, { unit: "week" });
|
|
36
|
+
default:
|
|
37
|
+
return f(s.length, e);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
validate(e, s) {
|
|
41
|
+
return s >= 1 && s <= 53;
|
|
42
|
+
}
|
|
43
|
+
set(e, s, a) {
|
|
44
|
+
return p(n(e, a));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
N as ISOWeekParser
|
|
49
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
var f = Object.defineProperty;
|
|
2
|
+
var p = (t, e, r) => e in t ? f(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var i = (t, e, r) => p(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { startOfISOWeek as n } from "../../../startOfISOWeek.mjs";
|
|
5
|
+
import { constructFrom as u } from "../../../constructFrom.mjs";
|
|
6
|
+
import { Parser as c } from "../Parser.mjs";
|
|
7
|
+
import { parseNDigitsSigned as a } from "../utils.mjs";
|
|
8
|
+
class W extends c {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
i(this, "priority", 130);
|
|
12
|
+
i(this, "incompatibleTokens", [
|
|
13
|
+
"G",
|
|
14
|
+
"y",
|
|
15
|
+
"Y",
|
|
16
|
+
"u",
|
|
17
|
+
"Q",
|
|
18
|
+
"q",
|
|
19
|
+
"M",
|
|
20
|
+
"L",
|
|
21
|
+
"w",
|
|
22
|
+
"d",
|
|
23
|
+
"D",
|
|
24
|
+
"e",
|
|
25
|
+
"c",
|
|
26
|
+
"t",
|
|
27
|
+
"T"
|
|
28
|
+
]);
|
|
29
|
+
}
|
|
30
|
+
parse(r, s) {
|
|
31
|
+
return s === "R" ? a(4, r) : a(s.length, r);
|
|
32
|
+
}
|
|
33
|
+
set(r, s, m) {
|
|
34
|
+
const o = u(r, 0);
|
|
35
|
+
return o.setFullYear(m, 0, 4), o.setHours(0, 0, 0, 0), n(o);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
W as ISOWeekYearParser
|
|
40
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
var y = Object.defineProperty;
|
|
2
|
+
var c = (o, r, e) => r in o ? y(o, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[r] = e;
|
|
3
|
+
var s = (o, r, e) => c(o, typeof r != "symbol" ? r + "" : r, e);
|
|
4
|
+
import { setDay as u } from "../../../setDay.mjs";
|
|
5
|
+
import { Parser as l } from "../Parser.mjs";
|
|
6
|
+
import { mapValue as d, parseNDigits as x } from "../utils.mjs";
|
|
7
|
+
class D extends l {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
s(this, "priority", 90);
|
|
11
|
+
s(this, "incompatibleTokens", [
|
|
12
|
+
"y",
|
|
13
|
+
"R",
|
|
14
|
+
"u",
|
|
15
|
+
"q",
|
|
16
|
+
"Q",
|
|
17
|
+
"M",
|
|
18
|
+
"L",
|
|
19
|
+
"I",
|
|
20
|
+
"d",
|
|
21
|
+
"D",
|
|
22
|
+
"E",
|
|
23
|
+
"i",
|
|
24
|
+
"c",
|
|
25
|
+
"t",
|
|
26
|
+
"T"
|
|
27
|
+
]);
|
|
28
|
+
}
|
|
29
|
+
parse(e, a, t, n) {
|
|
30
|
+
const i = (w) => {
|
|
31
|
+
const f = Math.floor((w - 1) / 7) * 7;
|
|
32
|
+
return (w + n.weekStartsOn + 6) % 7 + f;
|
|
33
|
+
};
|
|
34
|
+
switch (a) {
|
|
35
|
+
case "e":
|
|
36
|
+
case "ee":
|
|
37
|
+
return d(x(a.length, e), i);
|
|
38
|
+
case "eo":
|
|
39
|
+
return d(
|
|
40
|
+
t.ordinalNumber(e, {
|
|
41
|
+
unit: "day"
|
|
42
|
+
}),
|
|
43
|
+
i
|
|
44
|
+
);
|
|
45
|
+
case "eee":
|
|
46
|
+
return t.day(e, {
|
|
47
|
+
width: "abbreviated",
|
|
48
|
+
context: "formatting"
|
|
49
|
+
}) || t.day(e, { width: "short", context: "formatting" }) || t.day(e, { width: "narrow", context: "formatting" });
|
|
50
|
+
case "eeeee":
|
|
51
|
+
return t.day(e, {
|
|
52
|
+
width: "narrow",
|
|
53
|
+
context: "formatting"
|
|
54
|
+
});
|
|
55
|
+
case "eeeeee":
|
|
56
|
+
return t.day(e, { width: "short", context: "formatting" }) || t.day(e, { width: "narrow", context: "formatting" });
|
|
57
|
+
case "eeee":
|
|
58
|
+
default:
|
|
59
|
+
return t.day(e, { width: "wide", context: "formatting" }) || t.day(e, {
|
|
60
|
+
width: "abbreviated",
|
|
61
|
+
context: "formatting"
|
|
62
|
+
}) || t.day(e, { width: "short", context: "formatting" }) || t.day(e, { width: "narrow", context: "formatting" });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
validate(e, a) {
|
|
66
|
+
return a >= 0 && a <= 6;
|
|
67
|
+
}
|
|
68
|
+
set(e, a, t, n) {
|
|
69
|
+
return e = u(e, t, n), e.setHours(0, 0, 0, 0), e;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
export {
|
|
73
|
+
D as LocalDayParser
|
|
74
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
var o = Object.defineProperty;
|
|
2
|
+
var n = (t, e, r) => e in t ? o(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var i = (t, e, r) => n(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { setWeek as p } from "../../../setWeek.mjs";
|
|
5
|
+
import { startOfWeek as u } from "../../../startOfWeek.mjs";
|
|
6
|
+
import { numericPatterns as c } from "../constants.mjs";
|
|
7
|
+
import { Parser as f } from "../Parser.mjs";
|
|
8
|
+
import { parseNDigits as l, parseNumericPattern as k } from "../utils.mjs";
|
|
9
|
+
class h extends f {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
i(this, "priority", 100);
|
|
13
|
+
i(this, "incompatibleTokens", [
|
|
14
|
+
"y",
|
|
15
|
+
"R",
|
|
16
|
+
"u",
|
|
17
|
+
"q",
|
|
18
|
+
"Q",
|
|
19
|
+
"M",
|
|
20
|
+
"L",
|
|
21
|
+
"I",
|
|
22
|
+
"d",
|
|
23
|
+
"D",
|
|
24
|
+
"i",
|
|
25
|
+
"t",
|
|
26
|
+
"T"
|
|
27
|
+
]);
|
|
28
|
+
}
|
|
29
|
+
parse(r, s, a) {
|
|
30
|
+
switch (s) {
|
|
31
|
+
case "w":
|
|
32
|
+
return k(c.week, r);
|
|
33
|
+
case "wo":
|
|
34
|
+
return a.ordinalNumber(r, { unit: "week" });
|
|
35
|
+
default:
|
|
36
|
+
return l(s.length, r);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
validate(r, s) {
|
|
40
|
+
return s >= 1 && s <= 53;
|
|
41
|
+
}
|
|
42
|
+
set(r, s, a, m) {
|
|
43
|
+
return u(p(r, a, m), m);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
h as LocalWeekParser
|
|
48
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
var D = Object.defineProperty;
|
|
2
|
+
var f = (t, i, r) => i in t ? D(t, i, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[i] = r;
|
|
3
|
+
var n = (t, i, r) => f(t, typeof i != "symbol" ? i + "" : i, r);
|
|
4
|
+
import { getWeekYear as y } from "../../../getWeekYear.mjs";
|
|
5
|
+
import { startOfWeek as m } from "../../../startOfWeek.mjs";
|
|
6
|
+
import { Parser as T } from "../Parser.mjs";
|
|
7
|
+
import { mapValue as Y, parseNDigits as u, normalizeTwoDigitYear as p } from "../utils.mjs";
|
|
8
|
+
class C extends T {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
n(this, "priority", 130);
|
|
12
|
+
n(this, "incompatibleTokens", [
|
|
13
|
+
"y",
|
|
14
|
+
"R",
|
|
15
|
+
"u",
|
|
16
|
+
"Q",
|
|
17
|
+
"q",
|
|
18
|
+
"M",
|
|
19
|
+
"L",
|
|
20
|
+
"I",
|
|
21
|
+
"d",
|
|
22
|
+
"D",
|
|
23
|
+
"i",
|
|
24
|
+
"t",
|
|
25
|
+
"T"
|
|
26
|
+
]);
|
|
27
|
+
}
|
|
28
|
+
parse(r, e, s) {
|
|
29
|
+
const a = (o) => ({
|
|
30
|
+
year: o,
|
|
31
|
+
isTwoDigitYear: e === "YY"
|
|
32
|
+
});
|
|
33
|
+
switch (e) {
|
|
34
|
+
case "Y":
|
|
35
|
+
return Y(u(4, r), a);
|
|
36
|
+
case "Yo":
|
|
37
|
+
return Y(
|
|
38
|
+
s.ordinalNumber(r, {
|
|
39
|
+
unit: "year"
|
|
40
|
+
}),
|
|
41
|
+
a
|
|
42
|
+
);
|
|
43
|
+
default:
|
|
44
|
+
return Y(u(e.length, r), a);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
validate(r, e) {
|
|
48
|
+
return e.isTwoDigitYear || e.year > 0;
|
|
49
|
+
}
|
|
50
|
+
set(r, e, s, a) {
|
|
51
|
+
const o = y(r, a);
|
|
52
|
+
if (s.isTwoDigitYear) {
|
|
53
|
+
const l = p(
|
|
54
|
+
s.year,
|
|
55
|
+
o
|
|
56
|
+
);
|
|
57
|
+
return r.setFullYear(
|
|
58
|
+
l,
|
|
59
|
+
0,
|
|
60
|
+
a.firstWeekContainsDate
|
|
61
|
+
), r.setHours(0, 0, 0, 0), m(r, a);
|
|
62
|
+
}
|
|
63
|
+
const c = !("era" in e) || e.era === 1 ? s.year : 1 - s.year;
|
|
64
|
+
return r.setFullYear(c, 0, a.firstWeekContainsDate), r.setHours(0, 0, 0, 0), m(r, a);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export {
|
|
68
|
+
C as LocalWeekYearParser
|
|
69
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var m = Object.defineProperty;
|
|
2
|
+
var a = (t, e, r) => e in t ? m(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var n = (t, e, r) => a(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { numericPatterns as u } from "../constants.mjs";
|
|
5
|
+
import { Parser as o } from "../Parser.mjs";
|
|
6
|
+
import { parseNDigits as p, parseNumericPattern as c } from "../utils.mjs";
|
|
7
|
+
class b extends o {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
n(this, "priority", 60);
|
|
11
|
+
n(this, "incompatibleTokens", ["t", "T"]);
|
|
12
|
+
}
|
|
13
|
+
parse(r, s, i) {
|
|
14
|
+
switch (s) {
|
|
15
|
+
case "m":
|
|
16
|
+
return c(u.minute, r);
|
|
17
|
+
case "mo":
|
|
18
|
+
return i.ordinalNumber(r, { unit: "minute" });
|
|
19
|
+
default:
|
|
20
|
+
return p(s.length, r);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
validate(r, s) {
|
|
24
|
+
return s >= 0 && s <= 59;
|
|
25
|
+
}
|
|
26
|
+
set(r, s, i) {
|
|
27
|
+
return r.setMinutes(i, 0, 0), r;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
b as MinuteParser
|
|
32
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
var M = Object.defineProperty;
|
|
2
|
+
var u = (e, o, t) => o in e ? M(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
|
|
3
|
+
var i = (e, o, t) => u(e, typeof o != "symbol" ? o + "" : o, t);
|
|
4
|
+
import { numericPatterns as c } from "../constants.mjs";
|
|
5
|
+
import { Parser as w } from "../Parser.mjs";
|
|
6
|
+
import { mapValue as a, parseNDigits as f, parseNumericPattern as h } from "../utils.mjs";
|
|
7
|
+
class d extends w {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
i(this, "incompatibleTokens", [
|
|
11
|
+
"Y",
|
|
12
|
+
"R",
|
|
13
|
+
"q",
|
|
14
|
+
"Q",
|
|
15
|
+
"L",
|
|
16
|
+
"w",
|
|
17
|
+
"I",
|
|
18
|
+
"D",
|
|
19
|
+
"i",
|
|
20
|
+
"e",
|
|
21
|
+
"c",
|
|
22
|
+
"t",
|
|
23
|
+
"T"
|
|
24
|
+
]);
|
|
25
|
+
i(this, "priority", 110);
|
|
26
|
+
}
|
|
27
|
+
parse(t, n, r) {
|
|
28
|
+
const s = (m) => m - 1;
|
|
29
|
+
switch (n) {
|
|
30
|
+
case "M":
|
|
31
|
+
return a(
|
|
32
|
+
h(c.month, t),
|
|
33
|
+
s
|
|
34
|
+
);
|
|
35
|
+
case "MM":
|
|
36
|
+
return a(f(2, t), s);
|
|
37
|
+
case "Mo":
|
|
38
|
+
return a(
|
|
39
|
+
r.ordinalNumber(t, {
|
|
40
|
+
unit: "month"
|
|
41
|
+
}),
|
|
42
|
+
s
|
|
43
|
+
);
|
|
44
|
+
case "MMM":
|
|
45
|
+
return r.month(t, {
|
|
46
|
+
width: "abbreviated",
|
|
47
|
+
context: "formatting"
|
|
48
|
+
}) || r.month(t, { width: "narrow", context: "formatting" });
|
|
49
|
+
case "MMMMM":
|
|
50
|
+
return r.month(t, {
|
|
51
|
+
width: "narrow",
|
|
52
|
+
context: "formatting"
|
|
53
|
+
});
|
|
54
|
+
case "MMMM":
|
|
55
|
+
default:
|
|
56
|
+
return r.month(t, { width: "wide", context: "formatting" }) || r.month(t, {
|
|
57
|
+
width: "abbreviated",
|
|
58
|
+
context: "formatting"
|
|
59
|
+
}) || r.month(t, { width: "narrow", context: "formatting" });
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
validate(t, n) {
|
|
63
|
+
return n >= 0 && n <= 11;
|
|
64
|
+
}
|
|
65
|
+
set(t, n, r) {
|
|
66
|
+
return t.setMonth(r, 1), t.setHours(0, 0, 0, 0), t;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
d as MonthParser
|
|
71
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
var n = Object.defineProperty;
|
|
2
|
+
var s = (o, e, r) => e in o ? n(o, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : o[e] = r;
|
|
3
|
+
var i = (o, e, r) => s(o, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { Parser as u } from "../Parser.mjs";
|
|
5
|
+
import { parseNDigits as Q } from "../utils.mjs";
|
|
6
|
+
class q extends u {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
i(this, "priority", 120);
|
|
10
|
+
i(this, "incompatibleTokens", [
|
|
11
|
+
"Y",
|
|
12
|
+
"R",
|
|
13
|
+
"q",
|
|
14
|
+
"M",
|
|
15
|
+
"L",
|
|
16
|
+
"w",
|
|
17
|
+
"I",
|
|
18
|
+
"d",
|
|
19
|
+
"D",
|
|
20
|
+
"i",
|
|
21
|
+
"e",
|
|
22
|
+
"c",
|
|
23
|
+
"t",
|
|
24
|
+
"T"
|
|
25
|
+
]);
|
|
26
|
+
}
|
|
27
|
+
parse(r, a, t) {
|
|
28
|
+
switch (a) {
|
|
29
|
+
case "Q":
|
|
30
|
+
case "QQ":
|
|
31
|
+
return Q(a.length, r);
|
|
32
|
+
case "Qo":
|
|
33
|
+
return t.ordinalNumber(r, { unit: "quarter" });
|
|
34
|
+
case "QQQ":
|
|
35
|
+
return t.quarter(r, {
|
|
36
|
+
width: "abbreviated",
|
|
37
|
+
context: "formatting"
|
|
38
|
+
}) || t.quarter(r, {
|
|
39
|
+
width: "narrow",
|
|
40
|
+
context: "formatting"
|
|
41
|
+
});
|
|
42
|
+
case "QQQQQ":
|
|
43
|
+
return t.quarter(r, {
|
|
44
|
+
width: "narrow",
|
|
45
|
+
context: "formatting"
|
|
46
|
+
});
|
|
47
|
+
case "QQQQ":
|
|
48
|
+
default:
|
|
49
|
+
return t.quarter(r, {
|
|
50
|
+
width: "wide",
|
|
51
|
+
context: "formatting"
|
|
52
|
+
}) || t.quarter(r, {
|
|
53
|
+
width: "abbreviated",
|
|
54
|
+
context: "formatting"
|
|
55
|
+
}) || t.quarter(r, {
|
|
56
|
+
width: "narrow",
|
|
57
|
+
context: "formatting"
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
validate(r, a) {
|
|
62
|
+
return a >= 1 && a <= 4;
|
|
63
|
+
}
|
|
64
|
+
set(r, a, t) {
|
|
65
|
+
return r.setMonth((t - 1) * 3, 1), r.setHours(0, 0, 0, 0), r;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
q as QuarterParser
|
|
70
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var a = Object.defineProperty;
|
|
2
|
+
var i = (s, e, r) => e in s ? a(s, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : s[e] = r;
|
|
3
|
+
var o = (s, e, r) => i(s, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { numericPatterns as c } from "../constants.mjs";
|
|
5
|
+
import { Parser as m } from "../Parser.mjs";
|
|
6
|
+
import { parseNDigits as p, parseNumericPattern as u } from "../utils.mjs";
|
|
7
|
+
class N extends m {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
o(this, "priority", 50);
|
|
11
|
+
o(this, "incompatibleTokens", ["t", "T"]);
|
|
12
|
+
}
|
|
13
|
+
parse(r, t, n) {
|
|
14
|
+
switch (t) {
|
|
15
|
+
case "s":
|
|
16
|
+
return u(c.second, r);
|
|
17
|
+
case "so":
|
|
18
|
+
return n.ordinalNumber(r, { unit: "second" });
|
|
19
|
+
default:
|
|
20
|
+
return p(t.length, r);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
validate(r, t) {
|
|
24
|
+
return t >= 0 && t <= 59;
|
|
25
|
+
}
|
|
26
|
+
set(r, t, n) {
|
|
27
|
+
return r.setSeconds(n, 0), r;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
N as SecondParser
|
|
32
|
+
};
|