@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,74 @@
|
|
|
1
|
+
var i = Object.defineProperty;
|
|
2
|
+
var y = (n, a, e) => a in n ? i(n, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[a] = e;
|
|
3
|
+
var s = (n, a, e) => y(n, typeof a != "symbol" ? a + "" : a, e);
|
|
4
|
+
import { setDay as u } from "../../../setDay.mjs";
|
|
5
|
+
import { Parser as x } from "../Parser.mjs";
|
|
6
|
+
import { mapValue as l, parseNDigits as p } from "../utils.mjs";
|
|
7
|
+
class k extends x {
|
|
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
|
+
"e",
|
|
25
|
+
"t",
|
|
26
|
+
"T"
|
|
27
|
+
]);
|
|
28
|
+
}
|
|
29
|
+
parse(e, t, o, r) {
|
|
30
|
+
const c = (d) => {
|
|
31
|
+
const w = Math.floor((d - 1) / 7) * 7;
|
|
32
|
+
return (d + r.weekStartsOn + 6) % 7 + w;
|
|
33
|
+
};
|
|
34
|
+
switch (t) {
|
|
35
|
+
case "c":
|
|
36
|
+
case "cc":
|
|
37
|
+
return l(p(t.length, e), c);
|
|
38
|
+
case "co":
|
|
39
|
+
return l(
|
|
40
|
+
o.ordinalNumber(e, {
|
|
41
|
+
unit: "day"
|
|
42
|
+
}),
|
|
43
|
+
c
|
|
44
|
+
);
|
|
45
|
+
case "ccc":
|
|
46
|
+
return o.day(e, {
|
|
47
|
+
width: "abbreviated",
|
|
48
|
+
context: "standalone"
|
|
49
|
+
}) || o.day(e, { width: "short", context: "standalone" }) || o.day(e, { width: "narrow", context: "standalone" });
|
|
50
|
+
case "ccccc":
|
|
51
|
+
return o.day(e, {
|
|
52
|
+
width: "narrow",
|
|
53
|
+
context: "standalone"
|
|
54
|
+
});
|
|
55
|
+
case "cccccc":
|
|
56
|
+
return o.day(e, { width: "short", context: "standalone" }) || o.day(e, { width: "narrow", context: "standalone" });
|
|
57
|
+
case "cccc":
|
|
58
|
+
default:
|
|
59
|
+
return o.day(e, { width: "wide", context: "standalone" }) || o.day(e, {
|
|
60
|
+
width: "abbreviated",
|
|
61
|
+
context: "standalone"
|
|
62
|
+
}) || o.day(e, { width: "short", context: "standalone" }) || o.day(e, { width: "narrow", context: "standalone" });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
validate(e, t) {
|
|
66
|
+
return t >= 0 && t <= 6;
|
|
67
|
+
}
|
|
68
|
+
set(e, t, o, r) {
|
|
69
|
+
return e = u(e, o, r), e.setHours(0, 0, 0, 0), e;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
export {
|
|
73
|
+
k as StandAloneLocalDayParser
|
|
74
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
var L = Object.defineProperty;
|
|
2
|
+
var u = (o, n, e) => n in o ? L(o, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[n] = e;
|
|
3
|
+
var a = (o, n, e) => u(o, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
+
import { numericPatterns as c } from "../constants.mjs";
|
|
5
|
+
import { Parser as m } from "../Parser.mjs";
|
|
6
|
+
import { mapValue as i, parseNDigits as w, parseNumericPattern as d } from "../utils.mjs";
|
|
7
|
+
class f extends m {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
a(this, "priority", 110);
|
|
11
|
+
a(this, "incompatibleTokens", [
|
|
12
|
+
"Y",
|
|
13
|
+
"R",
|
|
14
|
+
"q",
|
|
15
|
+
"Q",
|
|
16
|
+
"M",
|
|
17
|
+
"w",
|
|
18
|
+
"I",
|
|
19
|
+
"D",
|
|
20
|
+
"i",
|
|
21
|
+
"e",
|
|
22
|
+
"c",
|
|
23
|
+
"t",
|
|
24
|
+
"T"
|
|
25
|
+
]);
|
|
26
|
+
}
|
|
27
|
+
parse(e, r, t) {
|
|
28
|
+
const s = (l) => l - 1;
|
|
29
|
+
switch (r) {
|
|
30
|
+
case "L":
|
|
31
|
+
return i(
|
|
32
|
+
d(c.month, e),
|
|
33
|
+
s
|
|
34
|
+
);
|
|
35
|
+
case "LL":
|
|
36
|
+
return i(w(2, e), s);
|
|
37
|
+
case "Lo":
|
|
38
|
+
return i(
|
|
39
|
+
t.ordinalNumber(e, {
|
|
40
|
+
unit: "month"
|
|
41
|
+
}),
|
|
42
|
+
s
|
|
43
|
+
);
|
|
44
|
+
case "LLL":
|
|
45
|
+
return t.month(e, {
|
|
46
|
+
width: "abbreviated",
|
|
47
|
+
context: "standalone"
|
|
48
|
+
}) || t.month(e, { width: "narrow", context: "standalone" });
|
|
49
|
+
case "LLLLL":
|
|
50
|
+
return t.month(e, {
|
|
51
|
+
width: "narrow",
|
|
52
|
+
context: "standalone"
|
|
53
|
+
});
|
|
54
|
+
case "LLLL":
|
|
55
|
+
default:
|
|
56
|
+
return t.month(e, { width: "wide", context: "standalone" }) || t.month(e, {
|
|
57
|
+
width: "abbreviated",
|
|
58
|
+
context: "standalone"
|
|
59
|
+
}) || t.month(e, { width: "narrow", context: "standalone" });
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
validate(e, r) {
|
|
63
|
+
return r >= 0 && r <= 11;
|
|
64
|
+
}
|
|
65
|
+
set(e, r, t) {
|
|
66
|
+
return e.setMonth(t, 1), e.setHours(0, 0, 0, 0), e;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
f as StandAloneMonthParser
|
|
71
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
var s = Object.defineProperty;
|
|
2
|
+
var q = (a, t, r) => t in a ? s(a, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : a[t] = r;
|
|
3
|
+
var o = (a, t, r) => q(a, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { Parser as u } from "../Parser.mjs";
|
|
5
|
+
import { parseNDigits as i } from "../utils.mjs";
|
|
6
|
+
class c extends u {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
o(this, "priority", 120);
|
|
10
|
+
o(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, n, e) {
|
|
28
|
+
switch (n) {
|
|
29
|
+
case "q":
|
|
30
|
+
case "qq":
|
|
31
|
+
return i(n.length, r);
|
|
32
|
+
case "qo":
|
|
33
|
+
return e.ordinalNumber(r, { unit: "quarter" });
|
|
34
|
+
case "qqq":
|
|
35
|
+
return e.quarter(r, {
|
|
36
|
+
width: "abbreviated",
|
|
37
|
+
context: "standalone"
|
|
38
|
+
}) || e.quarter(r, {
|
|
39
|
+
width: "narrow",
|
|
40
|
+
context: "standalone"
|
|
41
|
+
});
|
|
42
|
+
case "qqqqq":
|
|
43
|
+
return e.quarter(r, {
|
|
44
|
+
width: "narrow",
|
|
45
|
+
context: "standalone"
|
|
46
|
+
});
|
|
47
|
+
case "qqqq":
|
|
48
|
+
default:
|
|
49
|
+
return e.quarter(r, {
|
|
50
|
+
width: "wide",
|
|
51
|
+
context: "standalone"
|
|
52
|
+
}) || e.quarter(r, {
|
|
53
|
+
width: "abbreviated",
|
|
54
|
+
context: "standalone"
|
|
55
|
+
}) || e.quarter(r, {
|
|
56
|
+
width: "narrow",
|
|
57
|
+
context: "standalone"
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
validate(r, n) {
|
|
62
|
+
return n >= 1 && n <= 4;
|
|
63
|
+
}
|
|
64
|
+
set(r, n, e) {
|
|
65
|
+
return r.setMonth((e - 1) * 3, 1), r.setHours(0, 0, 0, 0), r;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
c as StandAloneQuarterParser
|
|
70
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
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 s = (t, r, e) => m(t, typeof r != "symbol" ? r + "" : r, e);
|
|
4
|
+
import { constructFrom as p } from "../../../constructFrom.mjs";
|
|
5
|
+
import { Parser as a } from "../Parser.mjs";
|
|
6
|
+
import { parseAnyDigitsSigned as n } from "../utils.mjs";
|
|
7
|
+
class g extends a {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
s(this, "priority", 20);
|
|
11
|
+
s(this, "incompatibleTokens", "*");
|
|
12
|
+
}
|
|
13
|
+
parse(e) {
|
|
14
|
+
return n(e);
|
|
15
|
+
}
|
|
16
|
+
set(e, c, i) {
|
|
17
|
+
return [p(e, i), { timestampIsSet: !0 }];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
g as TimestampMillisecondsParser
|
|
22
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
var i = Object.defineProperty;
|
|
2
|
+
var m = (t, r, e) => r in t ? i(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
|
|
3
|
+
var s = (t, r, e) => m(t, typeof r != "symbol" ? r + "" : r, e);
|
|
4
|
+
import { constructFrom as p } from "../../../constructFrom.mjs";
|
|
5
|
+
import { Parser as a } from "../Parser.mjs";
|
|
6
|
+
import { parseAnyDigitsSigned as n } from "../utils.mjs";
|
|
7
|
+
class l extends a {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
s(this, "priority", 40);
|
|
11
|
+
s(this, "incompatibleTokens", "*");
|
|
12
|
+
}
|
|
13
|
+
parse(e) {
|
|
14
|
+
return n(e);
|
|
15
|
+
}
|
|
16
|
+
set(e, c, o) {
|
|
17
|
+
return [p(e, o * 1e3), { timestampIsSet: !0 }];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
l as TimestampSecondsParser
|
|
22
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var y = Object.defineProperty;
|
|
2
|
+
var Y = (a, i, r) => i in a ? y(a, i, { enumerable: !0, configurable: !0, writable: !0, value: r }) : a[i] = r;
|
|
3
|
+
var n = (a, i, r) => Y(a, typeof i != "symbol" ? i + "" : i, r);
|
|
4
|
+
import { Parser as m } from "../Parser.mjs";
|
|
5
|
+
import { mapValue as u, parseNDigits as l, normalizeTwoDigitYear as p } from "../utils.mjs";
|
|
6
|
+
class g extends m {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
n(this, "priority", 130);
|
|
10
|
+
n(this, "incompatibleTokens", ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"]);
|
|
11
|
+
}
|
|
12
|
+
parse(r, e, s) {
|
|
13
|
+
const t = (o) => ({
|
|
14
|
+
year: o,
|
|
15
|
+
isTwoDigitYear: e === "yy"
|
|
16
|
+
});
|
|
17
|
+
switch (e) {
|
|
18
|
+
case "y":
|
|
19
|
+
return u(l(4, r), t);
|
|
20
|
+
case "yo":
|
|
21
|
+
return u(
|
|
22
|
+
s.ordinalNumber(r, {
|
|
23
|
+
unit: "year"
|
|
24
|
+
}),
|
|
25
|
+
t
|
|
26
|
+
);
|
|
27
|
+
default:
|
|
28
|
+
return u(l(e.length, r), t);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
validate(r, e) {
|
|
32
|
+
return e.isTwoDigitYear || e.year > 0;
|
|
33
|
+
}
|
|
34
|
+
set(r, e, s) {
|
|
35
|
+
const t = r.getFullYear();
|
|
36
|
+
if (s.isTwoDigitYear) {
|
|
37
|
+
const c = p(
|
|
38
|
+
s.year,
|
|
39
|
+
t
|
|
40
|
+
);
|
|
41
|
+
return r.setFullYear(c, 0, 1), r.setHours(0, 0, 0, 0), r;
|
|
42
|
+
}
|
|
43
|
+
const o = !("era" in e) || e.era === 1 ? s.year : 1 - s.year;
|
|
44
|
+
return r.setFullYear(o, 0, 1), r.setHours(0, 0, 0, 0), r;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
g as YearParser
|
|
49
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { EraParser as r } from "./parsers/EraParser.mjs";
|
|
2
|
+
import { YearParser as e } from "./parsers/YearParser.mjs";
|
|
3
|
+
import { LocalWeekYearParser as o } from "./parsers/LocalWeekYearParser.mjs";
|
|
4
|
+
import { ISOWeekYearParser as m } from "./parsers/ISOWeekYearParser.mjs";
|
|
5
|
+
import { ExtendedYearParser as a } from "./parsers/ExtendedYearParser.mjs";
|
|
6
|
+
import { QuarterParser as t } from "./parsers/QuarterParser.mjs";
|
|
7
|
+
import { StandAloneQuarterParser as n } from "./parsers/StandAloneQuarterParser.mjs";
|
|
8
|
+
import { MonthParser as i } from "./parsers/MonthParser.mjs";
|
|
9
|
+
import { StandAloneMonthParser as s } from "./parsers/StandAloneMonthParser.mjs";
|
|
10
|
+
import { LocalWeekParser as p } from "./parsers/LocalWeekParser.mjs";
|
|
11
|
+
import { ISOWeekParser as P } from "./parsers/ISOWeekParser.mjs";
|
|
12
|
+
import { DateParser as f } from "./parsers/DateParser.mjs";
|
|
13
|
+
import { DayOfYearParser as w } from "./parsers/DayOfYearParser.mjs";
|
|
14
|
+
import { DayParser as d } from "./parsers/DayParser.mjs";
|
|
15
|
+
import { LocalDayParser as S } from "./parsers/LocalDayParser.mjs";
|
|
16
|
+
import { StandAloneLocalDayParser as c } from "./parsers/StandAloneLocalDayParser.mjs";
|
|
17
|
+
import { ISODayParser as M } from "./parsers/ISODayParser.mjs";
|
|
18
|
+
import { AMPMParser as l } from "./parsers/AMPMParser.mjs";
|
|
19
|
+
import { AMPMMidnightParser as u } from "./parsers/AMPMMidnightParser.mjs";
|
|
20
|
+
import { DayPeriodParser as D } from "./parsers/DayPeriodParser.mjs";
|
|
21
|
+
import { Hour1to12Parser as y } from "./parsers/Hour1to12Parser.mjs";
|
|
22
|
+
import { Hour0to23Parser as O } from "./parsers/Hour0to23Parser.mjs";
|
|
23
|
+
import { Hour0To11Parser as T } from "./parsers/Hour0To11Parser.mjs";
|
|
24
|
+
import { Hour1To24Parser as I } from "./parsers/Hour1To24Parser.mjs";
|
|
25
|
+
import { MinuteParser as Y } from "./parsers/MinuteParser.mjs";
|
|
26
|
+
import { SecondParser as h } from "./parsers/SecondParser.mjs";
|
|
27
|
+
import { FractionOfSecondParser as k } from "./parsers/FractionOfSecondParser.mjs";
|
|
28
|
+
import { ISOTimezoneWithZParser as A } from "./parsers/ISOTimezoneWithZParser.mjs";
|
|
29
|
+
import { ISOTimezoneParser as H } from "./parsers/ISOTimezoneParser.mjs";
|
|
30
|
+
import { TimestampSecondsParser as L } from "./parsers/TimestampSecondsParser.mjs";
|
|
31
|
+
import { TimestampMillisecondsParser as W } from "./parsers/TimestampMillisecondsParser.mjs";
|
|
32
|
+
const sr = {
|
|
33
|
+
G: new r(),
|
|
34
|
+
y: new e(),
|
|
35
|
+
Y: new o(),
|
|
36
|
+
R: new m(),
|
|
37
|
+
u: new a(),
|
|
38
|
+
Q: new t(),
|
|
39
|
+
q: new n(),
|
|
40
|
+
M: new i(),
|
|
41
|
+
L: new s(),
|
|
42
|
+
w: new p(),
|
|
43
|
+
I: new P(),
|
|
44
|
+
d: new f(),
|
|
45
|
+
D: new w(),
|
|
46
|
+
E: new d(),
|
|
47
|
+
e: new S(),
|
|
48
|
+
c: new c(),
|
|
49
|
+
i: new M(),
|
|
50
|
+
a: new l(),
|
|
51
|
+
b: new u(),
|
|
52
|
+
B: new D(),
|
|
53
|
+
h: new y(),
|
|
54
|
+
H: new O(),
|
|
55
|
+
K: new T(),
|
|
56
|
+
k: new I(),
|
|
57
|
+
m: new Y(),
|
|
58
|
+
s: new h(),
|
|
59
|
+
S: new k(),
|
|
60
|
+
X: new A(),
|
|
61
|
+
x: new H(),
|
|
62
|
+
t: new L(),
|
|
63
|
+
T: new W()
|
|
64
|
+
};
|
|
65
|
+
export {
|
|
66
|
+
sr as parsers
|
|
67
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { millisecondsInHour as l, millisecondsInMinute as m, millisecondsInSecond as f } from "../../constants.mjs";
|
|
2
|
+
import { numericPatterns as r } from "./constants.mjs";
|
|
3
|
+
function p(e, n) {
|
|
4
|
+
return e && {
|
|
5
|
+
value: n(e.value),
|
|
6
|
+
rest: e.rest
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
function t(e, n) {
|
|
10
|
+
const s = n.match(e);
|
|
11
|
+
return s ? {
|
|
12
|
+
value: parseInt(s[0], 10),
|
|
13
|
+
rest: n.slice(s[0].length)
|
|
14
|
+
} : null;
|
|
15
|
+
}
|
|
16
|
+
function d(e, n) {
|
|
17
|
+
const s = n.match(e);
|
|
18
|
+
if (!s)
|
|
19
|
+
return null;
|
|
20
|
+
if (s[0] === "Z")
|
|
21
|
+
return {
|
|
22
|
+
value: 0,
|
|
23
|
+
rest: n.slice(1)
|
|
24
|
+
};
|
|
25
|
+
const u = s[1] === "+" ? 1 : -1, i = s[2] ? parseInt(s[2], 10) : 0, c = s[3] ? parseInt(s[3], 10) : 0, o = s[5] ? parseInt(s[5], 10) : 0;
|
|
26
|
+
return {
|
|
27
|
+
value: u * (i * l + c * m + o * f),
|
|
28
|
+
rest: n.slice(s[0].length)
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function D(e) {
|
|
32
|
+
return t(r.anyDigitsSigned, e);
|
|
33
|
+
}
|
|
34
|
+
function I(e, n) {
|
|
35
|
+
switch (e) {
|
|
36
|
+
case 1:
|
|
37
|
+
return t(r.singleDigit, n);
|
|
38
|
+
case 2:
|
|
39
|
+
return t(r.twoDigits, n);
|
|
40
|
+
case 3:
|
|
41
|
+
return t(r.threeDigits, n);
|
|
42
|
+
case 4:
|
|
43
|
+
return t(r.fourDigits, n);
|
|
44
|
+
default:
|
|
45
|
+
return t(new RegExp("^\\d{1," + e + "}"), n);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function v(e, n) {
|
|
49
|
+
switch (e) {
|
|
50
|
+
case 1:
|
|
51
|
+
return t(r.singleDigitSigned, n);
|
|
52
|
+
case 2:
|
|
53
|
+
return t(r.twoDigitsSigned, n);
|
|
54
|
+
case 3:
|
|
55
|
+
return t(r.threeDigitsSigned, n);
|
|
56
|
+
case 4:
|
|
57
|
+
return t(r.fourDigitsSigned, n);
|
|
58
|
+
default:
|
|
59
|
+
return t(new RegExp("^-?\\d{1," + e + "}"), n);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function w(e) {
|
|
63
|
+
switch (e) {
|
|
64
|
+
case "morning":
|
|
65
|
+
return 4;
|
|
66
|
+
case "evening":
|
|
67
|
+
return 17;
|
|
68
|
+
case "pm":
|
|
69
|
+
case "noon":
|
|
70
|
+
case "afternoon":
|
|
71
|
+
return 12;
|
|
72
|
+
case "am":
|
|
73
|
+
case "midnight":
|
|
74
|
+
case "night":
|
|
75
|
+
default:
|
|
76
|
+
return 0;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function E(e, n) {
|
|
80
|
+
const s = n > 0, u = s ? n : 1 - n;
|
|
81
|
+
let i;
|
|
82
|
+
if (u <= 50)
|
|
83
|
+
i = e || 100;
|
|
84
|
+
else {
|
|
85
|
+
const c = u + 50, o = Math.trunc(c / 100) * 100, a = e >= c % 100;
|
|
86
|
+
i = e + o - (a ? 100 : 0);
|
|
87
|
+
}
|
|
88
|
+
return s ? i : 1 - i;
|
|
89
|
+
}
|
|
90
|
+
function P(e) {
|
|
91
|
+
return e % 400 === 0 || e % 4 === 0 && e % 100 !== 0;
|
|
92
|
+
}
|
|
93
|
+
export {
|
|
94
|
+
w as dayPeriodEnumToHours,
|
|
95
|
+
P as isLeapYearIndex,
|
|
96
|
+
p as mapValue,
|
|
97
|
+
E as normalizeTwoDigitYear,
|
|
98
|
+
D as parseAnyDigitsSigned,
|
|
99
|
+
I as parseNDigits,
|
|
100
|
+
v as parseNDigitsSigned,
|
|
101
|
+
t as parseNumericPattern,
|
|
102
|
+
d as parseTimezonePattern
|
|
103
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { longFormatters as R } from "./_lib/format/longFormatters.mjs";
|
|
2
|
+
import { isProtectedWeekYearToken as $, warnOrThrowProtectedError as x, isProtectedDayOfYearToken as A } from "./_lib/protectedTokens.mjs";
|
|
3
|
+
import { constructFrom as W } from "./constructFrom.mjs";
|
|
4
|
+
import { getDefaultOptions as N } from "./getDefaultOptions.mjs";
|
|
5
|
+
import { toDate as P } from "./toDate.mjs";
|
|
6
|
+
import { DateTimezoneSetter as L } from "./parse/_lib/Setter.mjs";
|
|
7
|
+
import { parsers as Y } from "./parse/_lib/parsers.mjs";
|
|
8
|
+
import { enUS as j } from "./locale/en-US.mjs";
|
|
9
|
+
const q = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, v = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, z = /^'([^]*?)'?$/, Q = /''/g, H = /\S/, I = /[a-zA-Z]/;
|
|
10
|
+
function _(n, c, f, o) {
|
|
11
|
+
var k, w, T, y;
|
|
12
|
+
const s = () => W(f, NaN), a = N(), l = a.locale ?? j, b = a.firstWeekContainsDate ?? ((w = (k = a.locale) == null ? void 0 : k.options) == null ? void 0 : w.firstWeekContainsDate) ?? 1, C = a.weekStartsOn ?? ((y = (T = a.locale) == null ? void 0 : T.options) == null ? void 0 : y.weekStartsOn) ?? 0;
|
|
13
|
+
if (!c)
|
|
14
|
+
return n ? s() : P(f, o == null ? void 0 : o.in);
|
|
15
|
+
const m = {
|
|
16
|
+
firstWeekContainsDate: b,
|
|
17
|
+
weekStartsOn: C,
|
|
18
|
+
locale: l
|
|
19
|
+
}, u = [new L(o == null ? void 0 : o.in, f)], D = c.match(v).map((t) => {
|
|
20
|
+
const e = t[0];
|
|
21
|
+
if (e in R) {
|
|
22
|
+
const r = R[e];
|
|
23
|
+
return r(t, l.formatLong);
|
|
24
|
+
}
|
|
25
|
+
return t;
|
|
26
|
+
}).join("").match(q), p = [];
|
|
27
|
+
for (let t of D) {
|
|
28
|
+
$(t) && x(t, c, n), A(t) && x(t, c, n);
|
|
29
|
+
const e = t[0], r = Y[e];
|
|
30
|
+
if (r) {
|
|
31
|
+
const { incompatibleTokens: E } = r;
|
|
32
|
+
if (Array.isArray(E)) {
|
|
33
|
+
const O = p.find(
|
|
34
|
+
(d) => E.includes(d.token) || d.token === e
|
|
35
|
+
);
|
|
36
|
+
if (O)
|
|
37
|
+
throw new RangeError(
|
|
38
|
+
`The format string mustn't contain \`${O.fullToken}\` and \`${t}\` at the same time`
|
|
39
|
+
);
|
|
40
|
+
} else if (r.incompatibleTokens === "*" && p.length > 0)
|
|
41
|
+
throw new RangeError(
|
|
42
|
+
`The format string mustn't contain \`${t}\` and any other token at the same time`
|
|
43
|
+
);
|
|
44
|
+
p.push({ token: e, fullToken: t });
|
|
45
|
+
const g = r.run(
|
|
46
|
+
n,
|
|
47
|
+
t,
|
|
48
|
+
l.match,
|
|
49
|
+
m
|
|
50
|
+
);
|
|
51
|
+
if (!g)
|
|
52
|
+
return s();
|
|
53
|
+
u.push(g.setter), n = g.rest;
|
|
54
|
+
} else {
|
|
55
|
+
if (e.match(I))
|
|
56
|
+
throw new RangeError(
|
|
57
|
+
"Format string contains an unescaped latin alphabet character `" + e + "`"
|
|
58
|
+
);
|
|
59
|
+
if (t === "''" ? t = "'" : e === "'" && (t = K(t)), n.indexOf(t) === 0)
|
|
60
|
+
n = n.slice(t.length);
|
|
61
|
+
else
|
|
62
|
+
return s();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (n.length > 0 && H.test(n))
|
|
66
|
+
return s();
|
|
67
|
+
const F = u.map((t) => t.priority).sort((t, e) => e - t).filter((t, e, r) => r.indexOf(t) === e).map(
|
|
68
|
+
(t) => u.filter((e) => e.priority === t).sort((e, r) => r.subPriority - e.subPriority)
|
|
69
|
+
).map((t) => t[0]);
|
|
70
|
+
let i = P(f, o == null ? void 0 : o.in);
|
|
71
|
+
if (isNaN(+i)) return s();
|
|
72
|
+
const h = {};
|
|
73
|
+
for (const t of F) {
|
|
74
|
+
if (!t.validate(i, m))
|
|
75
|
+
return s();
|
|
76
|
+
const e = t.set(i, h, m);
|
|
77
|
+
Array.isArray(e) ? (i = e[0], Object.assign(h, e[1])) : i = e;
|
|
78
|
+
}
|
|
79
|
+
return i;
|
|
80
|
+
}
|
|
81
|
+
function K(n) {
|
|
82
|
+
return n.match(z)[1].replace(Q, "'");
|
|
83
|
+
}
|
|
84
|
+
export {
|
|
85
|
+
R as longFormatters,
|
|
86
|
+
_ as parse,
|
|
87
|
+
Y as parsers
|
|
88
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { getDefaultOptions as w } from "./_lib/defaultOptions.mjs";
|
|
2
|
+
import { addDays as S } from "./addDays.mjs";
|
|
3
|
+
import { toDate as s } from "./toDate.mjs";
|
|
4
|
+
function _(O, t, e) {
|
|
5
|
+
var f, m, d, l;
|
|
6
|
+
const a = w(), D = (e == null ? void 0 : e.weekStartsOn) ?? ((m = (f = e == null ? void 0 : e.locale) == null ? void 0 : f.options) == null ? void 0 : m.weekStartsOn) ?? a.weekStartsOn ?? ((l = (d = a.locale) == null ? void 0 : d.options) == null ? void 0 : l.weekStartsOn) ?? 0, c = s(O, e == null ? void 0 : e.in), n = c.getDay(), k = (t % 7 + 7) % 7, r = 7 - D, u = t < 0 || t > 6 ? t - (n + r) % 7 : (k + r) % 7 - (n + r) % 7;
|
|
7
|
+
return S(c, u, e);
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
_ as setDay
|
|
11
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { addDays as c } from "./addDays.mjs";
|
|
2
|
+
import { getISODay as D } from "./getISODay.mjs";
|
|
3
|
+
import { toDate as d } from "./toDate.mjs";
|
|
4
|
+
function I(a, e, r) {
|
|
5
|
+
const t = d(a, r == null ? void 0 : r.in), f = D(t, r), m = e - f;
|
|
6
|
+
return c(t, m, r);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
I as setISODay
|
|
10
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { getISOWeek as m } from "./getISOWeek.mjs";
|
|
2
|
+
import { toDate as c } from "./toDate.mjs";
|
|
3
|
+
function g(r, f, e) {
|
|
4
|
+
const t = c(r, e == null ? void 0 : e.in), a = m(t, e) - f;
|
|
5
|
+
return t.setDate(t.getDate() - a * 7), t;
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
g as setISOWeek
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { getWeek as c } from "./getWeek.mjs";
|
|
2
|
+
import { toDate as t } from "./toDate.mjs";
|
|
3
|
+
function g(f, a, e) {
|
|
4
|
+
const r = t(f, e == null ? void 0 : e.in), m = c(r, e) - a;
|
|
5
|
+
return r.setDate(r.getDate() - m * 7), t(r, e == null ? void 0 : e.in);
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
g as setWeek
|
|
9
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { constructFrom as f } from "./constructFrom.mjs";
|
|
2
|
+
import { getISOWeekYear as s } from "./getISOWeekYear.mjs";
|
|
3
|
+
import { startOfISOWeek as a } from "./startOfISOWeek.mjs";
|
|
4
|
+
function O(t, e) {
|
|
5
|
+
const o = s(t, e), r = f(t, 0);
|
|
6
|
+
return r.setFullYear(o, 0, 4), r.setHours(0, 0, 0, 0), a(r);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
O as startOfISOWeekYear
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { getDefaultOptions as D } from "./_lib/defaultOptions.mjs";
|
|
2
|
+
import { toDate as S } from "./toDate.mjs";
|
|
3
|
+
function n(u, e) {
|
|
4
|
+
var f, O, k, l;
|
|
5
|
+
const a = D(), r = (e == null ? void 0 : e.weekStartsOn) ?? ((O = (f = e == null ? void 0 : e.locale) == null ? void 0 : f.options) == null ? void 0 : O.weekStartsOn) ?? a.weekStartsOn ?? ((l = (k = a.locale) == null ? void 0 : k.options) == null ? void 0 : l.weekStartsOn) ?? 0, t = S(u, e == null ? void 0 : e.in), c = t.getDay(), w = (c < r ? 7 : 0) + c - r;
|
|
6
|
+
return t.setDate(t.getDate() - w), t.setHours(0, 0, 0, 0), t;
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
n as startOfWeek
|
|
10
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { getDefaultOptions as l } from "./_lib/defaultOptions.mjs";
|
|
2
|
+
import { constructFrom as n } from "./constructFrom.mjs";
|
|
3
|
+
import { getWeekYear as u } from "./getWeekYear.mjs";
|
|
4
|
+
import { startOfWeek as D } from "./startOfWeek.mjs";
|
|
5
|
+
function g(r, e) {
|
|
6
|
+
var f, c, s, k;
|
|
7
|
+
const a = l(), m = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((c = (f = e == null ? void 0 : e.locale) == null ? void 0 : f.options) == null ? void 0 : c.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((k = (s = a.locale) == null ? void 0 : s.options) == null ? void 0 : k.firstWeekContainsDate) ?? 1, W = u(r, e), t = n((e == null ? void 0 : e.in) || r, 0);
|
|
8
|
+
return t.setFullYear(W, 0, m), t.setHours(0, 0, 0, 0), D(t, e);
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
g as startOfWeekYear
|
|
12
|
+
};
|