@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,41 @@
|
|
|
1
|
+
var l = Object.defineProperty;
|
|
2
|
+
var c = (r, e, t) => e in r ? l(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
+
var i = (r, e, t) => c(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { constructFrom as a } from "../../constructFrom.mjs";
|
|
5
|
+
import { transpose as h } from "../../transpose.mjs";
|
|
6
|
+
const p = 10;
|
|
7
|
+
class n {
|
|
8
|
+
constructor() {
|
|
9
|
+
i(this, "subPriority", 0);
|
|
10
|
+
}
|
|
11
|
+
validate(e, t) {
|
|
12
|
+
return !0;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
class I extends n {
|
|
16
|
+
constructor(e, t, s, o, u) {
|
|
17
|
+
super(), this.value = e, this.validateValue = t, this.setValue = s, this.priority = o, u && (this.subPriority = u);
|
|
18
|
+
}
|
|
19
|
+
validate(e, t) {
|
|
20
|
+
return this.validateValue(e, this.value, t);
|
|
21
|
+
}
|
|
22
|
+
set(e, t, s) {
|
|
23
|
+
return this.setValue(e, t, this.value, s);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
class V extends n {
|
|
27
|
+
constructor(t, s) {
|
|
28
|
+
super();
|
|
29
|
+
i(this, "priority", p);
|
|
30
|
+
i(this, "subPriority", -1);
|
|
31
|
+
this.context = t || ((o) => a(s, o));
|
|
32
|
+
}
|
|
33
|
+
set(t, s) {
|
|
34
|
+
return s.timestampIsSet ? t : a(t, h(t, this.context));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
V as DateTimezoneSetter,
|
|
39
|
+
n as Setter,
|
|
40
|
+
I as ValueSetter
|
|
41
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const d = {
|
|
2
|
+
month: /^(1[0-2]|0?\d)/,
|
|
3
|
+
// 0 to 12
|
|
4
|
+
date: /^(3[0-1]|[0-2]?\d)/,
|
|
5
|
+
// 0 to 31
|
|
6
|
+
dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,
|
|
7
|
+
// 0 to 366
|
|
8
|
+
week: /^(5[0-3]|[0-4]?\d)/,
|
|
9
|
+
// 0 to 53
|
|
10
|
+
hour23h: /^(2[0-3]|[0-1]?\d)/,
|
|
11
|
+
// 0 to 23
|
|
12
|
+
hour24h: /^(2[0-4]|[0-1]?\d)/,
|
|
13
|
+
// 0 to 24
|
|
14
|
+
hour11h: /^(1[0-1]|0?\d)/,
|
|
15
|
+
// 0 to 11
|
|
16
|
+
hour12h: /^(1[0-2]|0?\d)/,
|
|
17
|
+
// 0 to 12
|
|
18
|
+
minute: /^[0-5]?\d/,
|
|
19
|
+
// 0 to 59
|
|
20
|
+
second: /^[0-5]?\d/,
|
|
21
|
+
// 0 to 59
|
|
22
|
+
singleDigit: /^\d/,
|
|
23
|
+
// 0 to 9
|
|
24
|
+
twoDigits: /^\d{1,2}/,
|
|
25
|
+
// 0 to 99
|
|
26
|
+
threeDigits: /^\d{1,3}/,
|
|
27
|
+
// 0 to 999
|
|
28
|
+
fourDigits: /^\d{1,4}/,
|
|
29
|
+
// 0 to 9999
|
|
30
|
+
anyDigitsSigned: /^-?\d+/,
|
|
31
|
+
singleDigitSigned: /^-?\d/,
|
|
32
|
+
// 0 to 9, -0 to -9
|
|
33
|
+
twoDigitsSigned: /^-?\d{1,2}/,
|
|
34
|
+
// 0 to 99, -0 to -99
|
|
35
|
+
threeDigitsSigned: /^-?\d{1,3}/,
|
|
36
|
+
// 0 to 999, -0 to -999
|
|
37
|
+
fourDigitsSigned: /^-?\d{1,4}/
|
|
38
|
+
// 0 to 9999, -0 to -9999
|
|
39
|
+
}, i = {
|
|
40
|
+
basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
|
|
41
|
+
basic: /^([+-])(\d{2})(\d{2})|Z/,
|
|
42
|
+
basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
|
|
43
|
+
extended: /^([+-])(\d{2}):(\d{2})|Z/,
|
|
44
|
+
extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
|
|
45
|
+
};
|
|
46
|
+
export {
|
|
47
|
+
d as numericPatterns,
|
|
48
|
+
i as timezonePatterns
|
|
49
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var b = Object.defineProperty;
|
|
2
|
+
var d = (t, o, r) => o in t ? b(t, o, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[o] = r;
|
|
3
|
+
var i = (t, o, r) => d(t, typeof o != "symbol" ? o + "" : o, r);
|
|
4
|
+
import { Parser as n } from "../Parser.mjs";
|
|
5
|
+
import { dayPeriodEnumToHours as s } from "../utils.mjs";
|
|
6
|
+
class c extends n {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
i(this, "priority", 80);
|
|
10
|
+
i(this, "incompatibleTokens", ["a", "B", "H", "k", "t", "T"]);
|
|
11
|
+
}
|
|
12
|
+
parse(r, a, e) {
|
|
13
|
+
switch (a) {
|
|
14
|
+
case "b":
|
|
15
|
+
case "bb":
|
|
16
|
+
case "bbb":
|
|
17
|
+
return e.dayPeriod(r, {
|
|
18
|
+
width: "abbreviated",
|
|
19
|
+
context: "formatting"
|
|
20
|
+
}) || e.dayPeriod(r, {
|
|
21
|
+
width: "narrow",
|
|
22
|
+
context: "formatting"
|
|
23
|
+
});
|
|
24
|
+
case "bbbbb":
|
|
25
|
+
return e.dayPeriod(r, {
|
|
26
|
+
width: "narrow",
|
|
27
|
+
context: "formatting"
|
|
28
|
+
});
|
|
29
|
+
case "bbbb":
|
|
30
|
+
default:
|
|
31
|
+
return e.dayPeriod(r, {
|
|
32
|
+
width: "wide",
|
|
33
|
+
context: "formatting"
|
|
34
|
+
}) || e.dayPeriod(r, {
|
|
35
|
+
width: "abbreviated",
|
|
36
|
+
context: "formatting"
|
|
37
|
+
}) || e.dayPeriod(r, {
|
|
38
|
+
width: "narrow",
|
|
39
|
+
context: "formatting"
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
set(r, a, e) {
|
|
44
|
+
return r.setHours(s(e), 0, 0, 0), r;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
c as AMPMMidnightParser
|
|
49
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var d = Object.defineProperty;
|
|
2
|
+
var n = (e, a, r) => a in e ? d(e, a, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[a] = r;
|
|
3
|
+
var t = (e, a, r) => n(e, typeof a != "symbol" ? a + "" : a, r);
|
|
4
|
+
import { Parser as s } from "../Parser.mjs";
|
|
5
|
+
import { dayPeriodEnumToHours as w } from "../utils.mjs";
|
|
6
|
+
class u extends s {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
t(this, "priority", 80);
|
|
10
|
+
t(this, "incompatibleTokens", ["b", "B", "H", "k", "t", "T"]);
|
|
11
|
+
}
|
|
12
|
+
parse(r, i, o) {
|
|
13
|
+
switch (i) {
|
|
14
|
+
case "a":
|
|
15
|
+
case "aa":
|
|
16
|
+
case "aaa":
|
|
17
|
+
return o.dayPeriod(r, {
|
|
18
|
+
width: "abbreviated",
|
|
19
|
+
context: "formatting"
|
|
20
|
+
}) || o.dayPeriod(r, {
|
|
21
|
+
width: "narrow",
|
|
22
|
+
context: "formatting"
|
|
23
|
+
});
|
|
24
|
+
case "aaaaa":
|
|
25
|
+
return o.dayPeriod(r, {
|
|
26
|
+
width: "narrow",
|
|
27
|
+
context: "formatting"
|
|
28
|
+
});
|
|
29
|
+
case "aaaa":
|
|
30
|
+
default:
|
|
31
|
+
return o.dayPeriod(r, {
|
|
32
|
+
width: "wide",
|
|
33
|
+
context: "formatting"
|
|
34
|
+
}) || o.dayPeriod(r, {
|
|
35
|
+
width: "abbreviated",
|
|
36
|
+
context: "formatting"
|
|
37
|
+
}) || o.dayPeriod(r, {
|
|
38
|
+
width: "narrow",
|
|
39
|
+
context: "formatting"
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
set(r, i, o) {
|
|
44
|
+
return r.setHours(w(o), 0, 0, 0), r;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
u as AMPMParser
|
|
49
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
var c = Object.defineProperty;
|
|
2
|
+
var m = (s, e, r) => e in s ? c(s, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : s[e] = r;
|
|
3
|
+
var o = (s, e, r) => m(s, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { numericPatterns as p } from "../constants.mjs";
|
|
5
|
+
import { Parser as u } from "../Parser.mjs";
|
|
6
|
+
import { parseNDigits as l, parseNumericPattern as N, isLeapYearIndex as Y } from "../utils.mjs";
|
|
7
|
+
const _ = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], f = [
|
|
8
|
+
31,
|
|
9
|
+
29,
|
|
10
|
+
31,
|
|
11
|
+
30,
|
|
12
|
+
31,
|
|
13
|
+
30,
|
|
14
|
+
31,
|
|
15
|
+
31,
|
|
16
|
+
30,
|
|
17
|
+
31,
|
|
18
|
+
30,
|
|
19
|
+
31
|
|
20
|
+
];
|
|
21
|
+
class A extends u {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
o(this, "priority", 90);
|
|
25
|
+
o(this, "subPriority", 1);
|
|
26
|
+
o(this, "incompatibleTokens", [
|
|
27
|
+
"Y",
|
|
28
|
+
"R",
|
|
29
|
+
"q",
|
|
30
|
+
"Q",
|
|
31
|
+
"w",
|
|
32
|
+
"I",
|
|
33
|
+
"D",
|
|
34
|
+
"i",
|
|
35
|
+
"e",
|
|
36
|
+
"c",
|
|
37
|
+
"t",
|
|
38
|
+
"T"
|
|
39
|
+
]);
|
|
40
|
+
}
|
|
41
|
+
parse(r, t, n) {
|
|
42
|
+
switch (t) {
|
|
43
|
+
case "d":
|
|
44
|
+
return N(p.date, r);
|
|
45
|
+
case "do":
|
|
46
|
+
return n.ordinalNumber(r, { unit: "date" });
|
|
47
|
+
default:
|
|
48
|
+
return l(t.length, r);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
validate(r, t) {
|
|
52
|
+
const n = r.getFullYear(), a = Y(n), i = r.getMonth();
|
|
53
|
+
return a ? t >= 1 && t <= f[i] : t >= 1 && t <= _[i];
|
|
54
|
+
}
|
|
55
|
+
set(r, t, n) {
|
|
56
|
+
return r.setDate(n), r.setHours(0, 0, 0, 0), r;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
export {
|
|
60
|
+
A as DateParser
|
|
61
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var n = Object.defineProperty;
|
|
2
|
+
var o = (t, e, r) => e in t ? n(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var i = (t, e, r) => o(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { numericPatterns as p } from "../constants.mjs";
|
|
5
|
+
import { Parser as c } from "../Parser.mjs";
|
|
6
|
+
import { parseNDigits as u, parseNumericPattern as m, isLeapYearIndex as f } from "../utils.mjs";
|
|
7
|
+
class L extends c {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
i(this, "priority", 90);
|
|
11
|
+
i(this, "subpriority", 1);
|
|
12
|
+
i(this, "incompatibleTokens", [
|
|
13
|
+
"Y",
|
|
14
|
+
"R",
|
|
15
|
+
"q",
|
|
16
|
+
"Q",
|
|
17
|
+
"M",
|
|
18
|
+
"L",
|
|
19
|
+
"w",
|
|
20
|
+
"I",
|
|
21
|
+
"d",
|
|
22
|
+
"E",
|
|
23
|
+
"i",
|
|
24
|
+
"e",
|
|
25
|
+
"c",
|
|
26
|
+
"t",
|
|
27
|
+
"T"
|
|
28
|
+
]);
|
|
29
|
+
}
|
|
30
|
+
parse(r, s, a) {
|
|
31
|
+
switch (s) {
|
|
32
|
+
case "D":
|
|
33
|
+
case "DD":
|
|
34
|
+
return m(p.dayOfYear, r);
|
|
35
|
+
case "Do":
|
|
36
|
+
return a.ordinalNumber(r, { unit: "date" });
|
|
37
|
+
default:
|
|
38
|
+
return u(s.length, r);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
validate(r, s) {
|
|
42
|
+
const a = r.getFullYear();
|
|
43
|
+
return f(a) ? s >= 1 && s <= 366 : s >= 1 && s <= 365;
|
|
44
|
+
}
|
|
45
|
+
set(r, s, a) {
|
|
46
|
+
return r.setMonth(0, a), r.setHours(0, 0, 0, 0), r;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
L as DayOfYearParser
|
|
51
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
var s = Object.defineProperty;
|
|
2
|
+
var E = (e, o, t) => o in e ? s(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
|
|
3
|
+
var n = (e, o, t) => E(e, typeof o != "symbol" ? o + "" : o, t);
|
|
4
|
+
import { setDay as w } from "../../../setDay.mjs";
|
|
5
|
+
import { Parser as d } from "../Parser.mjs";
|
|
6
|
+
class c extends d {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
n(this, "priority", 90);
|
|
10
|
+
n(this, "incompatibleTokens", ["D", "i", "e", "c", "t", "T"]);
|
|
11
|
+
}
|
|
12
|
+
parse(t, a, r) {
|
|
13
|
+
switch (a) {
|
|
14
|
+
case "E":
|
|
15
|
+
case "EE":
|
|
16
|
+
case "EEE":
|
|
17
|
+
return r.day(t, {
|
|
18
|
+
width: "abbreviated",
|
|
19
|
+
context: "formatting"
|
|
20
|
+
}) || r.day(t, { width: "short", context: "formatting" }) || r.day(t, { width: "narrow", context: "formatting" });
|
|
21
|
+
case "EEEEE":
|
|
22
|
+
return r.day(t, {
|
|
23
|
+
width: "narrow",
|
|
24
|
+
context: "formatting"
|
|
25
|
+
});
|
|
26
|
+
case "EEEEEE":
|
|
27
|
+
return r.day(t, { width: "short", context: "formatting" }) || r.day(t, { width: "narrow", context: "formatting" });
|
|
28
|
+
case "EEEE":
|
|
29
|
+
default:
|
|
30
|
+
return r.day(t, { width: "wide", context: "formatting" }) || r.day(t, {
|
|
31
|
+
width: "abbreviated",
|
|
32
|
+
context: "formatting"
|
|
33
|
+
}) || r.day(t, { width: "short", context: "formatting" }) || r.day(t, { width: "narrow", context: "formatting" });
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
validate(t, a) {
|
|
37
|
+
return a >= 0 && a <= 6;
|
|
38
|
+
}
|
|
39
|
+
set(t, a, r, i) {
|
|
40
|
+
return t = w(t, r, i), t.setHours(0, 0, 0, 0), t;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
c as DayParser
|
|
45
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var d = Object.defineProperty;
|
|
2
|
+
var n = (t, o, r) => o in t ? d(t, o, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[o] = r;
|
|
3
|
+
var i = (t, o, r) => n(t, typeof o != "symbol" ? o + "" : o, r);
|
|
4
|
+
import { Parser as s } from "../Parser.mjs";
|
|
5
|
+
import { dayPeriodEnumToHours as B } from "../utils.mjs";
|
|
6
|
+
class c extends s {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
i(this, "priority", 80);
|
|
10
|
+
i(this, "incompatibleTokens", ["a", "b", "t", "T"]);
|
|
11
|
+
}
|
|
12
|
+
parse(r, a, e) {
|
|
13
|
+
switch (a) {
|
|
14
|
+
case "B":
|
|
15
|
+
case "BB":
|
|
16
|
+
case "BBB":
|
|
17
|
+
return e.dayPeriod(r, {
|
|
18
|
+
width: "abbreviated",
|
|
19
|
+
context: "formatting"
|
|
20
|
+
}) || e.dayPeriod(r, {
|
|
21
|
+
width: "narrow",
|
|
22
|
+
context: "formatting"
|
|
23
|
+
});
|
|
24
|
+
case "BBBBB":
|
|
25
|
+
return e.dayPeriod(r, {
|
|
26
|
+
width: "narrow",
|
|
27
|
+
context: "formatting"
|
|
28
|
+
});
|
|
29
|
+
case "BBBB":
|
|
30
|
+
default:
|
|
31
|
+
return e.dayPeriod(r, {
|
|
32
|
+
width: "wide",
|
|
33
|
+
context: "formatting"
|
|
34
|
+
}) || e.dayPeriod(r, {
|
|
35
|
+
width: "abbreviated",
|
|
36
|
+
context: "formatting"
|
|
37
|
+
}) || e.dayPeriod(r, {
|
|
38
|
+
width: "narrow",
|
|
39
|
+
context: "formatting"
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
set(r, a, e) {
|
|
44
|
+
return r.setHours(B(e), 0, 0, 0), r;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
c as DayPeriodParser
|
|
49
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var i = Object.defineProperty;
|
|
2
|
+
var o = (G, s, r) => s in G ? i(G, s, { enumerable: !0, configurable: !0, writable: !0, value: r }) : G[s] = r;
|
|
3
|
+
var w = (G, s, r) => o(G, typeof s != "symbol" ? s + "" : s, r);
|
|
4
|
+
import { Parser as u } from "../Parser.mjs";
|
|
5
|
+
class n extends u {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
w(this, "priority", 140);
|
|
9
|
+
w(this, "incompatibleTokens", ["R", "u", "t", "T"]);
|
|
10
|
+
}
|
|
11
|
+
parse(r, a, e) {
|
|
12
|
+
switch (a) {
|
|
13
|
+
case "G":
|
|
14
|
+
case "GG":
|
|
15
|
+
case "GGG":
|
|
16
|
+
return e.era(r, { width: "abbreviated" }) || e.era(r, { width: "narrow" });
|
|
17
|
+
case "GGGGG":
|
|
18
|
+
return e.era(r, { width: "narrow" });
|
|
19
|
+
case "GGGG":
|
|
20
|
+
default:
|
|
21
|
+
return e.era(r, { width: "wide" }) || e.era(r, { width: "abbreviated" }) || e.era(r, { width: "narrow" });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
set(r, a, e) {
|
|
25
|
+
return a.era = e, r.setFullYear(e, 0, 1), r.setHours(0, 0, 0, 0), r;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
n as EraParser
|
|
30
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var p = Object.defineProperty;
|
|
2
|
+
var a = (s, e, r) => e in s ? p(s, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : s[e] = r;
|
|
3
|
+
var i = (s, e, r) => a(s, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { Parser as l } from "../Parser.mjs";
|
|
5
|
+
import { parseNDigitsSigned as o } from "../utils.mjs";
|
|
6
|
+
class c extends l {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
i(this, "priority", 130);
|
|
10
|
+
i(this, "incompatibleTokens", ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"]);
|
|
11
|
+
}
|
|
12
|
+
parse(r, t) {
|
|
13
|
+
return t === "u" ? o(4, r) : o(t.length, r);
|
|
14
|
+
}
|
|
15
|
+
set(r, t, n) {
|
|
16
|
+
return r.setFullYear(n, 0, 1), r.setHours(0, 0, 0, 0), r;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
c as ExtendedYearParser
|
|
21
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
var l = Object.defineProperty;
|
|
2
|
+
var n = (t, e, r) => e in t ? l(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var o = (t, e, r) => n(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { Parser as p } from "../Parser.mjs";
|
|
5
|
+
import { mapValue as c, parseNDigits as m } from "../utils.mjs";
|
|
6
|
+
class h extends p {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
o(this, "priority", 30);
|
|
10
|
+
o(this, "incompatibleTokens", ["t", "T"]);
|
|
11
|
+
}
|
|
12
|
+
parse(r, s) {
|
|
13
|
+
const a = (i) => Math.trunc(i * Math.pow(10, -s.length + 3));
|
|
14
|
+
return c(m(s.length, r), a);
|
|
15
|
+
}
|
|
16
|
+
set(r, s, a) {
|
|
17
|
+
return r.setMilliseconds(a), r;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
h as FractionOfSecondParser
|
|
22
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var u = Object.defineProperty;
|
|
2
|
+
var n = (e, s, r) => s in e ? u(e, s, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[s] = r;
|
|
3
|
+
var i = (e, s, r) => n(e, typeof s != "symbol" ? s + "" : s, r);
|
|
4
|
+
import { numericPatterns as m } from "../constants.mjs";
|
|
5
|
+
import { Parser as a } from "../Parser.mjs";
|
|
6
|
+
import { parseNDigits as p, parseNumericPattern as c } from "../utils.mjs";
|
|
7
|
+
class N extends a {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
i(this, "priority", 70);
|
|
11
|
+
i(this, "incompatibleTokens", ["h", "H", "k", "t", "T"]);
|
|
12
|
+
}
|
|
13
|
+
parse(r, t, o) {
|
|
14
|
+
switch (t) {
|
|
15
|
+
case "K":
|
|
16
|
+
return c(m.hour11h, r);
|
|
17
|
+
case "Ko":
|
|
18
|
+
return o.ordinalNumber(r, { unit: "hour" });
|
|
19
|
+
default:
|
|
20
|
+
return p(t.length, r);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
validate(r, t) {
|
|
24
|
+
return t >= 0 && t <= 11;
|
|
25
|
+
}
|
|
26
|
+
set(r, t, o) {
|
|
27
|
+
return r.getHours() >= 12 && o < 12 ? r.setHours(o + 12, 0, 0, 0) : r.setHours(o, 0, 0, 0), r;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
N as Hour0To11Parser
|
|
32
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var i = Object.defineProperty;
|
|
2
|
+
var u = (t, e, r) => e in t ? i(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var a = (t, e, r) => u(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { numericPatterns as n } from "../constants.mjs";
|
|
5
|
+
import { Parser as m } from "../Parser.mjs";
|
|
6
|
+
import { parseNDigits as p, parseNumericPattern as c } from "../utils.mjs";
|
|
7
|
+
class P extends m {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
a(this, "priority", 70);
|
|
11
|
+
a(this, "incompatibleTokens", ["a", "b", "h", "K", "k", "t", "T"]);
|
|
12
|
+
}
|
|
13
|
+
parse(r, s, o) {
|
|
14
|
+
switch (s) {
|
|
15
|
+
case "H":
|
|
16
|
+
return c(n.hour23h, r);
|
|
17
|
+
case "Ho":
|
|
18
|
+
return o.ordinalNumber(r, { unit: "hour" });
|
|
19
|
+
default:
|
|
20
|
+
return p(s.length, r);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
validate(r, s) {
|
|
24
|
+
return s >= 0 && s <= 23;
|
|
25
|
+
}
|
|
26
|
+
set(r, s, o) {
|
|
27
|
+
return r.setHours(o, 0, 0, 0), r;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
P as Hour0to23Parser
|
|
32
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var n = Object.defineProperty;
|
|
2
|
+
var u = (t, e, r) => e in t ? n(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var i = (t, e, r) => u(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { numericPatterns as m } from "../constants.mjs";
|
|
5
|
+
import { Parser as p } from "../Parser.mjs";
|
|
6
|
+
import { parseNDigits as c, parseNumericPattern as h } from "../utils.mjs";
|
|
7
|
+
class H extends p {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
i(this, "priority", 70);
|
|
11
|
+
i(this, "incompatibleTokens", ["a", "b", "h", "H", "K", "t", "T"]);
|
|
12
|
+
}
|
|
13
|
+
parse(r, s, o) {
|
|
14
|
+
switch (s) {
|
|
15
|
+
case "k":
|
|
16
|
+
return h(m.hour24h, r);
|
|
17
|
+
case "ko":
|
|
18
|
+
return o.ordinalNumber(r, { unit: "hour" });
|
|
19
|
+
default:
|
|
20
|
+
return c(s.length, r);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
validate(r, s) {
|
|
24
|
+
return s >= 1 && s <= 24;
|
|
25
|
+
}
|
|
26
|
+
set(r, s, o) {
|
|
27
|
+
const a = o <= 24 ? o % 24 : o;
|
|
28
|
+
return r.setHours(a, 0, 0, 0), r;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
H as Hour1To24Parser
|
|
33
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var n = Object.defineProperty;
|
|
2
|
+
var m = (e, s, r) => s in e ? n(e, s, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[s] = r;
|
|
3
|
+
var i = (e, s, r) => m(e, typeof s != "symbol" ? s + "" : s, r);
|
|
4
|
+
import { numericPatterns as p } from "../constants.mjs";
|
|
5
|
+
import { Parser as c } from "../Parser.mjs";
|
|
6
|
+
import { parseNDigits as a, parseNumericPattern as f } from "../utils.mjs";
|
|
7
|
+
class N extends c {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
i(this, "priority", 70);
|
|
11
|
+
i(this, "incompatibleTokens", ["H", "K", "k", "t", "T"]);
|
|
12
|
+
}
|
|
13
|
+
parse(r, t, o) {
|
|
14
|
+
switch (t) {
|
|
15
|
+
case "h":
|
|
16
|
+
return f(p.hour12h, r);
|
|
17
|
+
case "ho":
|
|
18
|
+
return o.ordinalNumber(r, { unit: "hour" });
|
|
19
|
+
default:
|
|
20
|
+
return a(t.length, r);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
validate(r, t) {
|
|
24
|
+
return t >= 1 && t <= 12;
|
|
25
|
+
}
|
|
26
|
+
set(r, t, o) {
|
|
27
|
+
const u = r.getHours() >= 12;
|
|
28
|
+
return u && o < 12 ? r.setHours(o + 12, 0, 0, 0) : !u && o === 12 ? r.setHours(0, 0, 0, 0) : r.setHours(o, 0, 0, 0), r;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
N as Hour1to12Parser
|
|
33
|
+
};
|