@caipira/tamandua 0.0.110 → 0.0.112
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/Avatar.js +2 -2
- package/dist/{Avatar.vue_vue_type_script_setup_true_lang-BfieuQNL.js → Avatar.vue_vue_type_script_setup_true_lang-DhrMjSdF.js} +1 -1
- package/dist/Button.js +2 -2
- package/dist/{Button.vue_vue_type_script_setup_true_lang-FMipEkfO.js → Button.vue_vue_type_script_setup_true_lang-SA0hZRlI.js} +29 -28
- package/dist/Dropdown.js +2 -2
- package/dist/{Dropdown.vue_vue_type_script_setup_true_lang-DS7cWe9y.js → Dropdown.vue_vue_type_script_setup_true_lang-DzFX49Bk.js} +1 -1
- package/dist/Form.js +2 -2
- package/dist/{Form.vue_vue_type_script_setup_true_lang-v7aEXY0P.js → Form.vue_vue_type_script_setup_true_lang-BwcOBEkF.js} +2 -2
- package/dist/FormItem.js +2 -2
- package/dist/{FormItem.vue_vue_type_script_setup_true_lang-CPDhCwT3.js → FormItem.vue_vue_type_script_setup_true_lang-CjK_w-y0.js} +1 -1
- package/dist/GraphyPrice.js +2 -2
- package/dist/{GraphyPrice.vue_vue_type_script_setup_true_lang-DWrPfQkl.js → GraphyPrice.vue_vue_type_script_setup_true_lang-DYxzVfdC.js} +1 -1
- package/dist/Icon.js +2 -2
- package/dist/Icon.vue_vue_type_script_setup_true_lang-nVeGHBsG.js +45 -0
- package/dist/InputDate.js +2 -2
- package/dist/{InputDate.vue_vue_type_script_setup_true_lang-CNmUyWG3.js → InputDate.vue_vue_type_script_setup_true_lang-D-JE4KlD.js} +2 -2
- package/dist/InputMultiplier.js +2 -2
- package/dist/{InputMultiplier.vue_vue_type_script_setup_true_lang-hbu4tSBl.js → InputMultiplier.vue_vue_type_script_setup_true_lang-DrwqAgoE.js} +1 -1
- package/dist/InputPassword.js +2 -2
- package/dist/{InputPassword.vue_vue_type_script_setup_true_lang-CdDdCkH1.js → InputPassword.vue_vue_type_script_setup_true_lang-5OClIWva.js} +2 -2
- package/dist/InputSelect.js +2 -2
- package/dist/{InputSelect.vue_vue_type_script_setup_true_lang-C0IG8j5U.js → InputSelect.vue_vue_type_script_setup_true_lang-BJoFIqES.js} +1 -1
- package/dist/InputSwitch.js +2 -2
- package/dist/InputSwitch.vue_vue_type_script_setup_true_lang-BZ8VZijH.js +67 -0
- package/dist/InputText.js +2 -2
- package/dist/{InputText.vue_vue_type_script_setup_true_lang-B42_Uupe.js → InputText.vue_vue_type_script_setup_true_lang-BEWn9egy.js} +1 -1
- package/dist/Link.js +2 -2
- package/dist/{Link.vue_vue_type_script_setup_true_lang-CVJARk4u.js → Link.vue_vue_type_script_setup_true_lang-cxLyHTUe.js} +1 -1
- package/dist/Popconfirm.js +2 -2
- package/dist/{Popconfirm.vue_vue_type_script_setup_true_lang-pSZs1aLq.js → Popconfirm.vue_vue_type_script_setup_true_lang-cnZnvn0v.js} +1 -1
- package/dist/{Popover-LsBKjPQo.js → Popover-Bz6bcajn.js} +1 -1
- package/dist/Popover.js +2 -2
- package/dist/Table-E9rOfkPs.js +178 -0
- package/dist/Table.css +1 -1
- package/dist/Table.js +2 -2
- package/dist/Tag.js +2 -2
- package/dist/{Tag.vue_vue_type_script_setup_true_lang-DYJ5GWWC.js → Tag.vue_vue_type_script_setup_true_lang-BiWByuaf.js} +1 -1
- package/dist/Toast.js +2 -2
- package/dist/{Toast.vue_vue_type_script_setup_true_lang-D2BmbbjR.js → Toast.vue_vue_type_script_setup_true_lang-BEHKEsBr.js} +1 -1
- package/dist/apps-B1TP2L84.js +5 -0
- package/dist/bucket-42cRrGev.js +5 -0
- package/dist/bucket-outline-0GeMJDw5.js +5 -0
- package/dist/components.js +19 -19
- package/dist/database-outline-DM5lGGq7.js +5 -0
- package/dist/date.js +3144 -230
- package/dist/enums.js +1 -1
- package/dist/form2.js +1 -1
- package/dist/{format-CNTeOuM7.js → format-EV1gUJVC.js} +405 -365
- package/dist/git-BjHtzzmF.js +5 -0
- package/dist/{plugin-BlAFrrBh.js → plugin-6ULHxd5V.js} +1 -1
- package/dist/{plugin-Bl-ieCLY.js → plugin-BDuyyFqe.js} +1 -1
- package/dist/{plugin-CbahIIjI.js → plugin-BUXGSpUK.js} +1 -1
- package/dist/{plugin-Lap81czB.js → plugin-BXtaaV04.js} +1 -1
- package/dist/{plugin-kLxDNCij.js → plugin-BZTDtYgA.js} +1 -1
- package/dist/{plugin-xOWvAZJ8.js → plugin-B_Lp0ZMi.js} +1 -1
- package/dist/{plugin-C9PvjtX8.js → plugin-C-qtO_z9.js} +1 -1
- package/dist/{plugin-CLPYJfBT.js → plugin-Cbq9m56Q.js} +1 -1
- package/dist/{plugin-C4ZwDhqb.js → plugin-CzWnCRfO.js} +1 -1
- package/dist/{plugin-C-hzgafN.js → plugin-D6ZiaITy.js} +1 -1
- package/dist/{plugin-B6tq39a7.js → plugin-D9o0LcLI.js} +1 -1
- package/dist/{plugin-2EOpg2Hm.js → plugin-DB0XiYOM.js} +1 -1
- package/dist/{plugin-DZK7Bkjx.js → plugin-DF_OI3Z1.js} +1 -1
- package/dist/{plugin-hQ-aWPlo.js → plugin-DPuprKdB.js} +1 -1
- package/dist/{plugin-D81dElMV.js → plugin-Deq2Gjkg.js} +1 -1
- package/dist/{plugin-DXi8aCer.js → plugin-Dg4Sw41N.js} +1 -1
- package/dist/{plugin-BgYMFlp9.js → plugin-KiD_ar54.js} +1 -1
- package/dist/{plugin-DPIBggyG.js → plugin-e0fusAIQ.js} +1 -1
- package/dist/{plugin-M4Xqncbq.js → plugin-rHsYo5X-.js} +1 -1
- package/dist/{plugins-CFWRsvy1.js → plugins-DASyBRSp.js} +36 -35
- package/dist/plugins.js +109 -108
- package/dist/source-repository-CHRA433A.js +5 -0
- package/dist/{subMonths-D17wKxDQ.js → subMonths-C3ZeTBVE.js} +1 -1
- package/dist/tamandua.js +1 -1
- package/dist/{transformers-CrxkoXtN.js → transformers-BORZfvK0.js} +1 -1
- package/dist/types/components/Button/Button.story.d.ts +6 -1
- package/dist/types/components/Button/Button.vue.d.ts +3 -3
- package/dist/types/components/InputSwitch/InputSwitch.story.d.ts +7 -0
- package/dist/types/components/InputSwitch/InputSwitch.vue.d.ts +4 -0
- package/dist/types/components/InputSwitch/types.d.ts +3 -0
- package/dist/types/components/ProgressLine/ProgressLine.vue.d.ts +1 -1
- package/dist/types/components/Table/Table.story.d.ts +9 -0
- package/dist/types/components/Table/types.d.ts +2 -0
- package/dist/types/enums/ui.d.ts +7 -2
- package/dist/types/index.d.ts +6 -3
- package/dist/types/services/date.d.ts +2 -4
- package/dist/ui-UhY-K-wS.js +15 -0
- package/package.json +30 -8
- package/dist/Icon.vue_vue_type_script_setup_true_lang-Cf60EnJ0.js +0 -45
- package/dist/InputSwitch.vue_vue_type_script_setup_true_lang-BVGfQFZh.js +0 -62
- package/dist/Table-maK98cK_.js +0 -177
- package/dist/ui-djKlQTOR.js +0 -15
|
@@ -1,4 +1,80 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _t = 7, Lt = 365.2425, jt = 6048e5, Gt = 864e5, Bt = 6e4, At = 36e5, Rt = 1e3, Vt = 525600, Jt = 43200, $t = 1440, zt = 60, Ut = 3, Kt = 12, Zt = 4, te = 3600, ee = 60, ne = 86400, ae = 604800, re = 31556952, oe = 2629746, se = 7889238, W = Symbol.for("constructDateFrom");
|
|
2
|
+
function g(t, e) {
|
|
3
|
+
return typeof t == "function" ? t(e) : t && typeof t == "object" && W in t ? t[W](e) : t instanceof Date ? new t.constructor(e) : new Date(e);
|
|
4
|
+
}
|
|
5
|
+
function h(t, e) {
|
|
6
|
+
return g(e || t, t);
|
|
7
|
+
}
|
|
8
|
+
let E = {};
|
|
9
|
+
function O() {
|
|
10
|
+
return E;
|
|
11
|
+
}
|
|
12
|
+
function ie(t) {
|
|
13
|
+
E = t;
|
|
14
|
+
}
|
|
15
|
+
function M(t, e) {
|
|
16
|
+
const n = O(), a = e?.weekStartsOn ?? e?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, r = h(t, e?.in), o = r.getDay(), s = (o < a ? 7 : 0) + o - a;
|
|
17
|
+
return r.setDate(r.getDate() - s), r.setHours(0, 0, 0, 0), r;
|
|
18
|
+
}
|
|
19
|
+
function P(t, e) {
|
|
20
|
+
return M(t, { ...e, weekStartsOn: 1 });
|
|
21
|
+
}
|
|
22
|
+
function I(t, e) {
|
|
23
|
+
const n = h(t, e?.in), a = n.getFullYear(), r = g(n, 0);
|
|
24
|
+
r.setFullYear(a + 1, 0, 4), r.setHours(0, 0, 0, 0);
|
|
25
|
+
const o = P(r), s = g(n, 0);
|
|
26
|
+
s.setFullYear(a, 0, 4), s.setHours(0, 0, 0, 0);
|
|
27
|
+
const c = P(s);
|
|
28
|
+
return n.getTime() >= o.getTime() ? a + 1 : n.getTime() >= c.getTime() ? a : a - 1;
|
|
29
|
+
}
|
|
30
|
+
function x(t) {
|
|
31
|
+
const e = h(t), n = new Date(
|
|
32
|
+
Date.UTC(
|
|
33
|
+
e.getFullYear(),
|
|
34
|
+
e.getMonth(),
|
|
35
|
+
e.getDate(),
|
|
36
|
+
e.getHours(),
|
|
37
|
+
e.getMinutes(),
|
|
38
|
+
e.getSeconds(),
|
|
39
|
+
e.getMilliseconds()
|
|
40
|
+
)
|
|
41
|
+
);
|
|
42
|
+
return n.setUTCFullYear(e.getFullYear()), +t - +n;
|
|
43
|
+
}
|
|
44
|
+
function N(t, ...e) {
|
|
45
|
+
const n = g.bind(
|
|
46
|
+
null,
|
|
47
|
+
t || e.find((a) => typeof a == "object")
|
|
48
|
+
);
|
|
49
|
+
return e.map(n);
|
|
50
|
+
}
|
|
51
|
+
function v(t, e) {
|
|
52
|
+
const n = h(t, e?.in);
|
|
53
|
+
return n.setHours(0, 0, 0, 0), n;
|
|
54
|
+
}
|
|
55
|
+
function H(t, e, n) {
|
|
56
|
+
const [a, r] = N(
|
|
57
|
+
n?.in,
|
|
58
|
+
t,
|
|
59
|
+
e
|
|
60
|
+
), o = v(a), s = v(r), c = +o - x(o), f = +s - x(s);
|
|
61
|
+
return Math.round((c - f) / 864e5);
|
|
62
|
+
}
|
|
63
|
+
function Q(t, e) {
|
|
64
|
+
const n = I(t, e), a = g(e?.in || t, 0);
|
|
65
|
+
return a.setFullYear(n, 0, 4), a.setHours(0, 0, 0, 0), P(a);
|
|
66
|
+
}
|
|
67
|
+
function X(t) {
|
|
68
|
+
return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
|
|
69
|
+
}
|
|
70
|
+
function _(t) {
|
|
71
|
+
return !(!X(t) && typeof t != "number" || isNaN(+h(t)));
|
|
72
|
+
}
|
|
73
|
+
function L(t, e) {
|
|
74
|
+
const n = h(t, e?.in);
|
|
75
|
+
return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
76
|
+
}
|
|
77
|
+
const j = {
|
|
2
78
|
lessThanXSeconds: {
|
|
3
79
|
one: "less than a second",
|
|
4
80
|
other: "less than {{count}} seconds"
|
|
@@ -60,77 +136,77 @@ const H = {
|
|
|
60
136
|
one: "almost 1 year",
|
|
61
137
|
other: "almost {{count}} years"
|
|
62
138
|
}
|
|
63
|
-
},
|
|
64
|
-
let
|
|
65
|
-
const
|
|
66
|
-
return typeof
|
|
139
|
+
}, G = (t, e, n) => {
|
|
140
|
+
let a;
|
|
141
|
+
const r = j[t];
|
|
142
|
+
return typeof r == "string" ? a = r : e === 1 ? a = r.one : a = r.other.replace("{{count}}", e.toString()), n?.addSuffix ? n.comparison && n.comparison > 0 ? "in " + a : a + " ago" : a;
|
|
67
143
|
};
|
|
68
|
-
function
|
|
144
|
+
function D(t) {
|
|
69
145
|
return (e = {}) => {
|
|
70
146
|
const n = e.width ? String(e.width) : t.defaultWidth;
|
|
71
147
|
return t.formats[n] || t.formats[t.defaultWidth];
|
|
72
148
|
};
|
|
73
149
|
}
|
|
74
|
-
const
|
|
150
|
+
const B = {
|
|
75
151
|
full: "EEEE, MMMM do, y",
|
|
76
152
|
long: "MMMM do, y",
|
|
77
153
|
medium: "MMM d, y",
|
|
78
154
|
short: "MM/dd/yyyy"
|
|
79
|
-
},
|
|
155
|
+
}, A = {
|
|
80
156
|
full: "h:mm:ss a zzzz",
|
|
81
157
|
long: "h:mm:ss a z",
|
|
82
158
|
medium: "h:mm:ss a",
|
|
83
159
|
short: "h:mm a"
|
|
84
|
-
},
|
|
160
|
+
}, R = {
|
|
85
161
|
full: "{{date}} 'at' {{time}}",
|
|
86
162
|
long: "{{date}} 'at' {{time}}",
|
|
87
163
|
medium: "{{date}}, {{time}}",
|
|
88
164
|
short: "{{date}}, {{time}}"
|
|
89
|
-
},
|
|
90
|
-
date:
|
|
91
|
-
formats:
|
|
165
|
+
}, V = {
|
|
166
|
+
date: D({
|
|
167
|
+
formats: B,
|
|
92
168
|
defaultWidth: "full"
|
|
93
169
|
}),
|
|
94
|
-
time:
|
|
95
|
-
formats:
|
|
170
|
+
time: D({
|
|
171
|
+
formats: A,
|
|
96
172
|
defaultWidth: "full"
|
|
97
173
|
}),
|
|
98
|
-
dateTime:
|
|
99
|
-
formats:
|
|
174
|
+
dateTime: D({
|
|
175
|
+
formats: R,
|
|
100
176
|
defaultWidth: "full"
|
|
101
177
|
})
|
|
102
|
-
},
|
|
178
|
+
}, J = {
|
|
103
179
|
lastWeek: "'last' eeee 'at' p",
|
|
104
180
|
yesterday: "'yesterday at' p",
|
|
105
181
|
today: "'today at' p",
|
|
106
182
|
tomorrow: "'tomorrow at' p",
|
|
107
183
|
nextWeek: "eeee 'at' p",
|
|
108
184
|
other: "P"
|
|
109
|
-
},
|
|
185
|
+
}, $ = (t, e, n, a) => J[t];
|
|
110
186
|
function b(t) {
|
|
111
187
|
return (e, n) => {
|
|
112
|
-
const
|
|
113
|
-
let
|
|
114
|
-
if (
|
|
115
|
-
const
|
|
116
|
-
|
|
188
|
+
const a = n?.context ? String(n.context) : "standalone";
|
|
189
|
+
let r;
|
|
190
|
+
if (a === "formatting" && t.formattingValues) {
|
|
191
|
+
const s = t.defaultFormattingWidth || t.defaultWidth, c = n?.width ? String(n.width) : s;
|
|
192
|
+
r = t.formattingValues[c] || t.formattingValues[s];
|
|
117
193
|
} else {
|
|
118
|
-
const
|
|
119
|
-
|
|
194
|
+
const s = t.defaultWidth, c = n?.width ? String(n.width) : t.defaultWidth;
|
|
195
|
+
r = t.values[c] || t.values[s];
|
|
120
196
|
}
|
|
121
197
|
const o = t.argumentCallback ? t.argumentCallback(e) : e;
|
|
122
|
-
return
|
|
198
|
+
return r[o];
|
|
123
199
|
};
|
|
124
200
|
}
|
|
125
|
-
const
|
|
201
|
+
const z = {
|
|
126
202
|
narrow: ["B", "A"],
|
|
127
203
|
abbreviated: ["BC", "AD"],
|
|
128
204
|
wide: ["Before Christ", "Anno Domini"]
|
|
129
|
-
},
|
|
205
|
+
}, U = {
|
|
130
206
|
narrow: ["1", "2", "3", "4"],
|
|
131
207
|
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
132
208
|
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
133
|
-
},
|
|
209
|
+
}, K = {
|
|
134
210
|
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
135
211
|
abbreviated: [
|
|
136
212
|
"Jan",
|
|
@@ -160,7 +236,7 @@ const A = {
|
|
|
160
236
|
"November",
|
|
161
237
|
"December"
|
|
162
238
|
]
|
|
163
|
-
},
|
|
239
|
+
}, Z = {
|
|
164
240
|
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
165
241
|
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
166
242
|
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
@@ -173,7 +249,7 @@ const A = {
|
|
|
173
249
|
"Friday",
|
|
174
250
|
"Saturday"
|
|
175
251
|
]
|
|
176
|
-
},
|
|
252
|
+
}, tt = {
|
|
177
253
|
narrow: {
|
|
178
254
|
am: "a",
|
|
179
255
|
pm: "p",
|
|
@@ -204,7 +280,7 @@ const A = {
|
|
|
204
280
|
evening: "evening",
|
|
205
281
|
night: "night"
|
|
206
282
|
}
|
|
207
|
-
},
|
|
283
|
+
}, et = {
|
|
208
284
|
narrow: {
|
|
209
285
|
am: "a",
|
|
210
286
|
pm: "p",
|
|
@@ -235,10 +311,10 @@ const A = {
|
|
|
235
311
|
evening: "in the evening",
|
|
236
312
|
night: "at night"
|
|
237
313
|
}
|
|
238
|
-
},
|
|
239
|
-
const n = Number(t),
|
|
240
|
-
if (
|
|
241
|
-
switch (
|
|
314
|
+
}, nt = (t, e) => {
|
|
315
|
+
const n = Number(t), a = n % 100;
|
|
316
|
+
if (a > 20 || a < 10)
|
|
317
|
+
switch (a % 10) {
|
|
242
318
|
case 1:
|
|
243
319
|
return n + "st";
|
|
244
320
|
case 2:
|
|
@@ -247,91 +323,91 @@ const A = {
|
|
|
247
323
|
return n + "rd";
|
|
248
324
|
}
|
|
249
325
|
return n + "th";
|
|
250
|
-
},
|
|
251
|
-
ordinalNumber:
|
|
326
|
+
}, at = {
|
|
327
|
+
ordinalNumber: nt,
|
|
252
328
|
era: b({
|
|
253
|
-
values:
|
|
329
|
+
values: z,
|
|
254
330
|
defaultWidth: "wide"
|
|
255
331
|
}),
|
|
256
332
|
quarter: b({
|
|
257
|
-
values:
|
|
333
|
+
values: U,
|
|
258
334
|
defaultWidth: "wide",
|
|
259
335
|
argumentCallback: (t) => t - 1
|
|
260
336
|
}),
|
|
261
337
|
month: b({
|
|
262
|
-
values:
|
|
338
|
+
values: K,
|
|
263
339
|
defaultWidth: "wide"
|
|
264
340
|
}),
|
|
265
341
|
day: b({
|
|
266
|
-
values:
|
|
342
|
+
values: Z,
|
|
267
343
|
defaultWidth: "wide"
|
|
268
344
|
}),
|
|
269
345
|
dayPeriod: b({
|
|
270
|
-
values:
|
|
346
|
+
values: tt,
|
|
271
347
|
defaultWidth: "wide",
|
|
272
|
-
formattingValues:
|
|
348
|
+
formattingValues: et,
|
|
273
349
|
defaultFormattingWidth: "wide"
|
|
274
350
|
})
|
|
275
351
|
};
|
|
276
352
|
function p(t) {
|
|
277
353
|
return (e, n = {}) => {
|
|
278
|
-
const
|
|
354
|
+
const a = n.width, r = a && t.matchPatterns[a] || t.matchPatterns[t.defaultMatchWidth], o = e.match(r);
|
|
279
355
|
if (!o)
|
|
280
356
|
return null;
|
|
281
|
-
const
|
|
357
|
+
const s = o[0], c = a && t.parsePatterns[a] || t.parsePatterns[t.defaultParseWidth], f = Array.isArray(c) ? ot(c, (u) => u.test(s)) : (
|
|
282
358
|
// [TODO] -- I challenge you to fix the type
|
|
283
|
-
|
|
359
|
+
rt(c, (u) => u.test(s))
|
|
284
360
|
);
|
|
285
361
|
let m;
|
|
286
362
|
m = t.valueCallback ? t.valueCallback(f) : f, m = n.valueCallback ? (
|
|
287
363
|
// [TODO] -- I challenge you to fix the type
|
|
288
364
|
n.valueCallback(m)
|
|
289
365
|
) : m;
|
|
290
|
-
const d = e.slice(
|
|
366
|
+
const d = e.slice(s.length);
|
|
291
367
|
return { value: m, rest: d };
|
|
292
368
|
};
|
|
293
369
|
}
|
|
294
|
-
function
|
|
370
|
+
function rt(t, e) {
|
|
295
371
|
for (const n in t)
|
|
296
372
|
if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n]))
|
|
297
373
|
return n;
|
|
298
374
|
}
|
|
299
|
-
function
|
|
375
|
+
function ot(t, e) {
|
|
300
376
|
for (let n = 0; n < t.length; n++)
|
|
301
377
|
if (e(t[n]))
|
|
302
378
|
return n;
|
|
303
379
|
}
|
|
304
|
-
function
|
|
380
|
+
function st(t) {
|
|
305
381
|
return (e, n = {}) => {
|
|
306
|
-
const
|
|
307
|
-
if (!
|
|
382
|
+
const a = e.match(t.matchPattern);
|
|
383
|
+
if (!a)
|
|
308
384
|
return null;
|
|
309
|
-
const
|
|
385
|
+
const r = a[0], o = e.match(t.parsePattern);
|
|
310
386
|
if (!o)
|
|
311
387
|
return null;
|
|
312
|
-
let
|
|
313
|
-
|
|
314
|
-
const
|
|
315
|
-
return { value:
|
|
388
|
+
let s = t.valueCallback ? t.valueCallback(o[0]) : o[0];
|
|
389
|
+
s = n.valueCallback ? n.valueCallback(s) : s;
|
|
390
|
+
const c = e.slice(r.length);
|
|
391
|
+
return { value: s, rest: c };
|
|
316
392
|
};
|
|
317
393
|
}
|
|
318
|
-
const
|
|
394
|
+
const it = /^(\d+)(th|st|nd|rd)?/i, ct = /\d+/i, ut = {
|
|
319
395
|
narrow: /^(b|a)/i,
|
|
320
396
|
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
321
397
|
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
322
|
-
},
|
|
398
|
+
}, dt = {
|
|
323
399
|
any: [/^b/i, /^(a|c)/i]
|
|
324
|
-
},
|
|
400
|
+
}, ft = {
|
|
325
401
|
narrow: /^[1234]/i,
|
|
326
402
|
abbreviated: /^q[1234]/i,
|
|
327
403
|
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
328
|
-
},
|
|
404
|
+
}, ht = {
|
|
329
405
|
any: [/1/i, /2/i, /3/i, /4/i]
|
|
330
|
-
},
|
|
406
|
+
}, mt = {
|
|
331
407
|
narrow: /^[jfmasond]/i,
|
|
332
408
|
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
333
409
|
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
334
|
-
},
|
|
410
|
+
}, lt = {
|
|
335
411
|
narrow: [
|
|
336
412
|
/^j/i,
|
|
337
413
|
/^f/i,
|
|
@@ -360,18 +436,18 @@ const et = /^(\d+)(th|st|nd|rd)?/i, nt = /\d+/i, rt = {
|
|
|
360
436
|
/^n/i,
|
|
361
437
|
/^d/i
|
|
362
438
|
]
|
|
363
|
-
},
|
|
439
|
+
}, gt = {
|
|
364
440
|
narrow: /^[smtwf]/i,
|
|
365
441
|
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
366
442
|
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
367
443
|
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
368
|
-
},
|
|
444
|
+
}, wt = {
|
|
369
445
|
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
370
446
|
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
371
|
-
},
|
|
447
|
+
}, yt = {
|
|
372
448
|
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
373
449
|
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
374
|
-
},
|
|
450
|
+
}, bt = {
|
|
375
451
|
any: {
|
|
376
452
|
am: /^a/i,
|
|
377
453
|
pm: /^p/i,
|
|
@@ -382,164 +458,97 @@ const et = /^(\d+)(th|st|nd|rd)?/i, nt = /\d+/i, rt = {
|
|
|
382
458
|
evening: /evening/i,
|
|
383
459
|
night: /night/i
|
|
384
460
|
}
|
|
385
|
-
},
|
|
386
|
-
ordinalNumber:
|
|
387
|
-
matchPattern:
|
|
388
|
-
parsePattern:
|
|
461
|
+
}, pt = {
|
|
462
|
+
ordinalNumber: st({
|
|
463
|
+
matchPattern: it,
|
|
464
|
+
parsePattern: ct,
|
|
389
465
|
valueCallback: (t) => parseInt(t, 10)
|
|
390
466
|
}),
|
|
391
467
|
era: p({
|
|
392
|
-
matchPatterns:
|
|
468
|
+
matchPatterns: ut,
|
|
393
469
|
defaultMatchWidth: "wide",
|
|
394
|
-
parsePatterns:
|
|
470
|
+
parsePatterns: dt,
|
|
395
471
|
defaultParseWidth: "any"
|
|
396
472
|
}),
|
|
397
473
|
quarter: p({
|
|
398
|
-
matchPatterns:
|
|
474
|
+
matchPatterns: ft,
|
|
399
475
|
defaultMatchWidth: "wide",
|
|
400
|
-
parsePatterns:
|
|
476
|
+
parsePatterns: ht,
|
|
401
477
|
defaultParseWidth: "any",
|
|
402
478
|
valueCallback: (t) => t + 1
|
|
403
479
|
}),
|
|
404
480
|
month: p({
|
|
405
|
-
matchPatterns:
|
|
481
|
+
matchPatterns: mt,
|
|
406
482
|
defaultMatchWidth: "wide",
|
|
407
|
-
parsePatterns:
|
|
483
|
+
parsePatterns: lt,
|
|
408
484
|
defaultParseWidth: "any"
|
|
409
485
|
}),
|
|
410
486
|
day: p({
|
|
411
|
-
matchPatterns:
|
|
487
|
+
matchPatterns: gt,
|
|
412
488
|
defaultMatchWidth: "wide",
|
|
413
|
-
parsePatterns:
|
|
489
|
+
parsePatterns: wt,
|
|
414
490
|
defaultParseWidth: "any"
|
|
415
491
|
}),
|
|
416
492
|
dayPeriod: p({
|
|
417
|
-
matchPatterns:
|
|
493
|
+
matchPatterns: yt,
|
|
418
494
|
defaultMatchWidth: "any",
|
|
419
|
-
parsePatterns:
|
|
495
|
+
parsePatterns: bt,
|
|
420
496
|
defaultParseWidth: "any"
|
|
421
497
|
})
|
|
422
|
-
},
|
|
498
|
+
}, Mt = {
|
|
423
499
|
code: "en-US",
|
|
424
|
-
formatDistance:
|
|
425
|
-
formatLong:
|
|
426
|
-
formatRelative:
|
|
427
|
-
localize:
|
|
428
|
-
match:
|
|
500
|
+
formatDistance: G,
|
|
501
|
+
formatLong: V,
|
|
502
|
+
formatRelative: $,
|
|
503
|
+
localize: at,
|
|
504
|
+
match: pt,
|
|
429
505
|
options: {
|
|
430
506
|
weekStartsOn: 0,
|
|
431
507
|
firstWeekContainsDate: 1
|
|
432
508
|
}
|
|
433
509
|
};
|
|
434
|
-
let gt = {};
|
|
435
|
-
function O() {
|
|
436
|
-
return gt;
|
|
437
|
-
}
|
|
438
|
-
const E = 6048e5, wt = 864e5, Gt = 6e4, Bt = 36e5, At = 43200, It = 1440, W = Symbol.for("constructDateFrom");
|
|
439
|
-
function g(t, e) {
|
|
440
|
-
return typeof t == "function" ? t(e) : t && typeof t == "object" && W in t ? t[W](e) : t instanceof Date ? new t.constructor(e) : new Date(e);
|
|
441
|
-
}
|
|
442
|
-
function h(t, e) {
|
|
443
|
-
return g(e || t, t);
|
|
444
|
-
}
|
|
445
|
-
function D(t) {
|
|
446
|
-
const e = h(t), n = new Date(
|
|
447
|
-
Date.UTC(
|
|
448
|
-
e.getFullYear(),
|
|
449
|
-
e.getMonth(),
|
|
450
|
-
e.getDate(),
|
|
451
|
-
e.getHours(),
|
|
452
|
-
e.getMinutes(),
|
|
453
|
-
e.getSeconds(),
|
|
454
|
-
e.getMilliseconds()
|
|
455
|
-
)
|
|
456
|
-
);
|
|
457
|
-
return n.setUTCFullYear(e.getFullYear()), +t - +n;
|
|
458
|
-
}
|
|
459
|
-
function yt(t, ...e) {
|
|
460
|
-
const n = g.bind(
|
|
461
|
-
null,
|
|
462
|
-
t || e.find((r) => typeof r == "object")
|
|
463
|
-
);
|
|
464
|
-
return e.map(n);
|
|
465
|
-
}
|
|
466
|
-
function v(t, e) {
|
|
467
|
-
const n = h(t, e?.in);
|
|
468
|
-
return n.setHours(0, 0, 0, 0), n;
|
|
469
|
-
}
|
|
470
|
-
function bt(t, e, n) {
|
|
471
|
-
const [r, a] = yt(
|
|
472
|
-
n?.in,
|
|
473
|
-
t,
|
|
474
|
-
e
|
|
475
|
-
), o = v(r), i = v(a), u = +o - D(o), f = +i - D(i);
|
|
476
|
-
return Math.round((u - f) / wt);
|
|
477
|
-
}
|
|
478
|
-
function pt(t, e) {
|
|
479
|
-
const n = h(t, e?.in);
|
|
480
|
-
return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
481
|
-
}
|
|
482
|
-
function Mt(t, e) {
|
|
483
|
-
const n = h(t, e?.in);
|
|
484
|
-
return bt(n, pt(n)) + 1;
|
|
485
|
-
}
|
|
486
|
-
function M(t, e) {
|
|
487
|
-
const n = O(), r = e?.weekStartsOn ?? e?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, a = h(t, e?.in), o = a.getDay(), i = (o < r ? 7 : 0) + o - r;
|
|
488
|
-
return a.setDate(a.getDate() - i), a.setHours(0, 0, 0, 0), a;
|
|
489
|
-
}
|
|
490
|
-
function P(t, e) {
|
|
491
|
-
return M(t, { ...e, weekStartsOn: 1 });
|
|
492
|
-
}
|
|
493
|
-
function C(t, e) {
|
|
494
|
-
const n = h(t, e?.in), r = n.getFullYear(), a = g(n, 0);
|
|
495
|
-
a.setFullYear(r + 1, 0, 4), a.setHours(0, 0, 0, 0);
|
|
496
|
-
const o = P(a), i = g(n, 0);
|
|
497
|
-
i.setFullYear(r, 0, 4), i.setHours(0, 0, 0, 0);
|
|
498
|
-
const u = P(i);
|
|
499
|
-
return n.getTime() >= o.getTime() ? r + 1 : n.getTime() >= u.getTime() ? r : r - 1;
|
|
500
|
-
}
|
|
501
510
|
function Pt(t, e) {
|
|
502
|
-
const n =
|
|
503
|
-
return
|
|
511
|
+
const n = h(t, e?.in);
|
|
512
|
+
return H(n, L(n)) + 1;
|
|
504
513
|
}
|
|
505
514
|
function Ot(t, e) {
|
|
506
|
-
const n = h(t, e?.in),
|
|
507
|
-
return Math.round(
|
|
515
|
+
const n = h(t, e?.in), a = +P(n) - +Q(n);
|
|
516
|
+
return Math.round(a / 6048e5) + 1;
|
|
508
517
|
}
|
|
509
|
-
function
|
|
510
|
-
const n = h(t, e?.in),
|
|
511
|
-
|
|
512
|
-
const
|
|
513
|
-
f.setFullYear(
|
|
518
|
+
function C(t, e) {
|
|
519
|
+
const n = h(t, e?.in), a = n.getFullYear(), r = O(), o = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, s = g(e?.in || t, 0);
|
|
520
|
+
s.setFullYear(a + 1, 0, o), s.setHours(0, 0, 0, 0);
|
|
521
|
+
const c = M(s, e), f = g(e?.in || t, 0);
|
|
522
|
+
f.setFullYear(a, 0, o), f.setHours(0, 0, 0, 0);
|
|
514
523
|
const m = M(f, e);
|
|
515
|
-
return +n >= +
|
|
524
|
+
return +n >= +c ? a + 1 : +n >= +m ? a : a - 1;
|
|
516
525
|
}
|
|
517
526
|
function kt(t, e) {
|
|
518
|
-
const n = O(),
|
|
519
|
-
return o.setFullYear(
|
|
527
|
+
const n = O(), a = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, r = C(t, e), o = g(e?.in || t, 0);
|
|
528
|
+
return o.setFullYear(r, 0, a), o.setHours(0, 0, 0, 0), M(o, e);
|
|
520
529
|
}
|
|
521
|
-
function
|
|
522
|
-
const n = h(t, e?.in),
|
|
523
|
-
return Math.round(
|
|
530
|
+
function Dt(t, e) {
|
|
531
|
+
const n = h(t, e?.in), a = +M(n, e) - +kt(n, e);
|
|
532
|
+
return Math.round(a / 6048e5) + 1;
|
|
524
533
|
}
|
|
525
|
-
function
|
|
526
|
-
const n = t < 0 ? "-" : "",
|
|
527
|
-
return n +
|
|
534
|
+
function i(t, e) {
|
|
535
|
+
const n = t < 0 ? "-" : "", a = Math.abs(t).toString().padStart(e, "0");
|
|
536
|
+
return n + a;
|
|
528
537
|
}
|
|
529
538
|
const l = {
|
|
530
539
|
// Year
|
|
531
540
|
y(t, e) {
|
|
532
|
-
const n = t.getFullYear(),
|
|
533
|
-
return
|
|
541
|
+
const n = t.getFullYear(), a = n > 0 ? n : 1 - n;
|
|
542
|
+
return i(e === "yy" ? a % 100 : a, e.length);
|
|
534
543
|
},
|
|
535
544
|
// Month
|
|
536
545
|
M(t, e) {
|
|
537
546
|
const n = t.getMonth();
|
|
538
|
-
return e === "M" ? String(n + 1) :
|
|
547
|
+
return e === "M" ? String(n + 1) : i(n + 1, 2);
|
|
539
548
|
},
|
|
540
549
|
// Day of the month
|
|
541
550
|
d(t, e) {
|
|
542
|
-
return
|
|
551
|
+
return i(t.getDate(), e.length);
|
|
543
552
|
},
|
|
544
553
|
// AM or PM
|
|
545
554
|
a(t, e) {
|
|
@@ -559,26 +568,26 @@ const l = {
|
|
|
559
568
|
},
|
|
560
569
|
// Hour [1-12]
|
|
561
570
|
h(t, e) {
|
|
562
|
-
return
|
|
571
|
+
return i(t.getHours() % 12 || 12, e.length);
|
|
563
572
|
},
|
|
564
573
|
// Hour [0-23]
|
|
565
574
|
H(t, e) {
|
|
566
|
-
return
|
|
575
|
+
return i(t.getHours(), e.length);
|
|
567
576
|
},
|
|
568
577
|
// Minute
|
|
569
578
|
m(t, e) {
|
|
570
|
-
return
|
|
579
|
+
return i(t.getMinutes(), e.length);
|
|
571
580
|
},
|
|
572
581
|
// Second
|
|
573
582
|
s(t, e) {
|
|
574
|
-
return
|
|
583
|
+
return i(t.getSeconds(), e.length);
|
|
575
584
|
},
|
|
576
585
|
// Fraction of second
|
|
577
586
|
S(t, e) {
|
|
578
|
-
const n = e.length,
|
|
579
|
-
|
|
587
|
+
const n = e.length, a = t.getMilliseconds(), r = Math.trunc(
|
|
588
|
+
a * Math.pow(10, n - 3)
|
|
580
589
|
);
|
|
581
|
-
return
|
|
590
|
+
return i(r, e.length);
|
|
582
591
|
}
|
|
583
592
|
}, y = {
|
|
584
593
|
am: "am",
|
|
@@ -589,43 +598,43 @@ const l = {
|
|
|
589
598
|
afternoon: "afternoon",
|
|
590
599
|
evening: "evening",
|
|
591
600
|
night: "night"
|
|
592
|
-
},
|
|
601
|
+
}, Y = {
|
|
593
602
|
// Era
|
|
594
603
|
G: function(t, e, n) {
|
|
595
|
-
const
|
|
604
|
+
const a = t.getFullYear() > 0 ? 1 : 0;
|
|
596
605
|
switch (e) {
|
|
597
606
|
case "G":
|
|
598
607
|
case "GG":
|
|
599
608
|
case "GGG":
|
|
600
|
-
return n.era(
|
|
609
|
+
return n.era(a, { width: "abbreviated" });
|
|
601
610
|
case "GGGGG":
|
|
602
|
-
return n.era(
|
|
611
|
+
return n.era(a, { width: "narrow" });
|
|
603
612
|
case "GGGG":
|
|
604
613
|
default:
|
|
605
|
-
return n.era(
|
|
614
|
+
return n.era(a, { width: "wide" });
|
|
606
615
|
}
|
|
607
616
|
},
|
|
608
617
|
// Year
|
|
609
618
|
y: function(t, e, n) {
|
|
610
619
|
if (e === "yo") {
|
|
611
|
-
const
|
|
612
|
-
return n.ordinalNumber(
|
|
620
|
+
const a = t.getFullYear(), r = a > 0 ? a : 1 - a;
|
|
621
|
+
return n.ordinalNumber(r, { unit: "year" });
|
|
613
622
|
}
|
|
614
623
|
return l.y(t, e);
|
|
615
624
|
},
|
|
616
625
|
// Local week-numbering year
|
|
617
|
-
Y: function(t, e, n,
|
|
618
|
-
const
|
|
626
|
+
Y: function(t, e, n, a) {
|
|
627
|
+
const r = C(t, a), o = r > 0 ? r : 1 - r;
|
|
619
628
|
if (e === "YY") {
|
|
620
|
-
const
|
|
621
|
-
return s
|
|
629
|
+
const s = o % 100;
|
|
630
|
+
return i(s, 2);
|
|
622
631
|
}
|
|
623
|
-
return e === "Yo" ? n.ordinalNumber(o, { unit: "year" }) :
|
|
632
|
+
return e === "Yo" ? n.ordinalNumber(o, { unit: "year" }) : i(o, e.length);
|
|
624
633
|
},
|
|
625
634
|
// ISO week-numbering year
|
|
626
635
|
R: function(t, e) {
|
|
627
|
-
const n =
|
|
628
|
-
return
|
|
636
|
+
const n = I(t);
|
|
637
|
+
return i(n, e.length);
|
|
629
638
|
},
|
|
630
639
|
// Extended year. This is a single number designating the year of this calendar system.
|
|
631
640
|
// The main difference between `y` and `u` localizers are B.C. years:
|
|
@@ -638,31 +647,31 @@ const l = {
|
|
|
638
647
|
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
639
648
|
u: function(t, e) {
|
|
640
649
|
const n = t.getFullYear();
|
|
641
|
-
return
|
|
650
|
+
return i(n, e.length);
|
|
642
651
|
},
|
|
643
652
|
// Quarter
|
|
644
653
|
Q: function(t, e, n) {
|
|
645
|
-
const
|
|
654
|
+
const a = Math.ceil((t.getMonth() + 1) / 3);
|
|
646
655
|
switch (e) {
|
|
647
656
|
case "Q":
|
|
648
|
-
return String(
|
|
657
|
+
return String(a);
|
|
649
658
|
case "QQ":
|
|
650
|
-
return
|
|
659
|
+
return i(a, 2);
|
|
651
660
|
case "Qo":
|
|
652
|
-
return n.ordinalNumber(
|
|
661
|
+
return n.ordinalNumber(a, { unit: "quarter" });
|
|
653
662
|
case "QQQ":
|
|
654
|
-
return n.quarter(
|
|
663
|
+
return n.quarter(a, {
|
|
655
664
|
width: "abbreviated",
|
|
656
665
|
context: "formatting"
|
|
657
666
|
});
|
|
658
667
|
case "QQQQQ":
|
|
659
|
-
return n.quarter(
|
|
668
|
+
return n.quarter(a, {
|
|
660
669
|
width: "narrow",
|
|
661
670
|
context: "formatting"
|
|
662
671
|
});
|
|
663
672
|
case "QQQQ":
|
|
664
673
|
default:
|
|
665
|
-
return n.quarter(
|
|
674
|
+
return n.quarter(a, {
|
|
666
675
|
width: "wide",
|
|
667
676
|
context: "formatting"
|
|
668
677
|
});
|
|
@@ -670,27 +679,27 @@ const l = {
|
|
|
670
679
|
},
|
|
671
680
|
// Stand-alone quarter
|
|
672
681
|
q: function(t, e, n) {
|
|
673
|
-
const
|
|
682
|
+
const a = Math.ceil((t.getMonth() + 1) / 3);
|
|
674
683
|
switch (e) {
|
|
675
684
|
case "q":
|
|
676
|
-
return String(
|
|
685
|
+
return String(a);
|
|
677
686
|
case "qq":
|
|
678
|
-
return
|
|
687
|
+
return i(a, 2);
|
|
679
688
|
case "qo":
|
|
680
|
-
return n.ordinalNumber(
|
|
689
|
+
return n.ordinalNumber(a, { unit: "quarter" });
|
|
681
690
|
case "qqq":
|
|
682
|
-
return n.quarter(
|
|
691
|
+
return n.quarter(a, {
|
|
683
692
|
width: "abbreviated",
|
|
684
693
|
context: "standalone"
|
|
685
694
|
});
|
|
686
695
|
case "qqqqq":
|
|
687
|
-
return n.quarter(
|
|
696
|
+
return n.quarter(a, {
|
|
688
697
|
width: "narrow",
|
|
689
698
|
context: "standalone"
|
|
690
699
|
});
|
|
691
700
|
case "qqqq":
|
|
692
701
|
default:
|
|
693
|
-
return n.quarter(
|
|
702
|
+
return n.quarter(a, {
|
|
694
703
|
width: "wide",
|
|
695
704
|
context: "standalone"
|
|
696
705
|
});
|
|
@@ -698,62 +707,62 @@ const l = {
|
|
|
698
707
|
},
|
|
699
708
|
// Month
|
|
700
709
|
M: function(t, e, n) {
|
|
701
|
-
const
|
|
710
|
+
const a = t.getMonth();
|
|
702
711
|
switch (e) {
|
|
703
712
|
case "M":
|
|
704
713
|
case "MM":
|
|
705
714
|
return l.M(t, e);
|
|
706
715
|
case "Mo":
|
|
707
|
-
return n.ordinalNumber(
|
|
716
|
+
return n.ordinalNumber(a + 1, { unit: "month" });
|
|
708
717
|
case "MMM":
|
|
709
|
-
return n.month(
|
|
718
|
+
return n.month(a, {
|
|
710
719
|
width: "abbreviated",
|
|
711
720
|
context: "formatting"
|
|
712
721
|
});
|
|
713
722
|
case "MMMMM":
|
|
714
|
-
return n.month(
|
|
723
|
+
return n.month(a, {
|
|
715
724
|
width: "narrow",
|
|
716
725
|
context: "formatting"
|
|
717
726
|
});
|
|
718
727
|
case "MMMM":
|
|
719
728
|
default:
|
|
720
|
-
return n.month(
|
|
729
|
+
return n.month(a, { width: "wide", context: "formatting" });
|
|
721
730
|
}
|
|
722
731
|
},
|
|
723
732
|
// Stand-alone month
|
|
724
733
|
L: function(t, e, n) {
|
|
725
|
-
const
|
|
734
|
+
const a = t.getMonth();
|
|
726
735
|
switch (e) {
|
|
727
736
|
case "L":
|
|
728
|
-
return String(
|
|
737
|
+
return String(a + 1);
|
|
729
738
|
case "LL":
|
|
730
|
-
return
|
|
739
|
+
return i(a + 1, 2);
|
|
731
740
|
case "Lo":
|
|
732
|
-
return n.ordinalNumber(
|
|
741
|
+
return n.ordinalNumber(a + 1, { unit: "month" });
|
|
733
742
|
case "LLL":
|
|
734
|
-
return n.month(
|
|
743
|
+
return n.month(a, {
|
|
735
744
|
width: "abbreviated",
|
|
736
745
|
context: "standalone"
|
|
737
746
|
});
|
|
738
747
|
case "LLLLL":
|
|
739
|
-
return n.month(
|
|
748
|
+
return n.month(a, {
|
|
740
749
|
width: "narrow",
|
|
741
750
|
context: "standalone"
|
|
742
751
|
});
|
|
743
752
|
case "LLLL":
|
|
744
753
|
default:
|
|
745
|
-
return n.month(
|
|
754
|
+
return n.month(a, { width: "wide", context: "standalone" });
|
|
746
755
|
}
|
|
747
756
|
},
|
|
748
757
|
// Local week of year
|
|
749
|
-
w: function(t, e, n,
|
|
750
|
-
const
|
|
751
|
-
return e === "wo" ? n.ordinalNumber(
|
|
758
|
+
w: function(t, e, n, a) {
|
|
759
|
+
const r = Dt(t, a);
|
|
760
|
+
return e === "wo" ? n.ordinalNumber(r, { unit: "week" }) : i(r, e.length);
|
|
752
761
|
},
|
|
753
762
|
// ISO week of year
|
|
754
763
|
I: function(t, e, n) {
|
|
755
|
-
const
|
|
756
|
-
return e === "Io" ? n.ordinalNumber(
|
|
764
|
+
const a = Ot(t);
|
|
765
|
+
return e === "Io" ? n.ordinalNumber(a, { unit: "week" }) : i(a, e.length);
|
|
757
766
|
},
|
|
758
767
|
// Day of the month
|
|
759
768
|
d: function(t, e, n) {
|
|
@@ -761,99 +770,99 @@ const l = {
|
|
|
761
770
|
},
|
|
762
771
|
// Day of year
|
|
763
772
|
D: function(t, e, n) {
|
|
764
|
-
const
|
|
765
|
-
return e === "Do" ? n.ordinalNumber(
|
|
773
|
+
const a = Pt(t);
|
|
774
|
+
return e === "Do" ? n.ordinalNumber(a, { unit: "dayOfYear" }) : i(a, e.length);
|
|
766
775
|
},
|
|
767
776
|
// Day of week
|
|
768
777
|
E: function(t, e, n) {
|
|
769
|
-
const
|
|
778
|
+
const a = t.getDay();
|
|
770
779
|
switch (e) {
|
|
771
780
|
case "E":
|
|
772
781
|
case "EE":
|
|
773
782
|
case "EEE":
|
|
774
|
-
return n.day(
|
|
783
|
+
return n.day(a, {
|
|
775
784
|
width: "abbreviated",
|
|
776
785
|
context: "formatting"
|
|
777
786
|
});
|
|
778
787
|
case "EEEEE":
|
|
779
|
-
return n.day(
|
|
788
|
+
return n.day(a, {
|
|
780
789
|
width: "narrow",
|
|
781
790
|
context: "formatting"
|
|
782
791
|
});
|
|
783
792
|
case "EEEEEE":
|
|
784
|
-
return n.day(
|
|
793
|
+
return n.day(a, {
|
|
785
794
|
width: "short",
|
|
786
795
|
context: "formatting"
|
|
787
796
|
});
|
|
788
797
|
case "EEEE":
|
|
789
798
|
default:
|
|
790
|
-
return n.day(
|
|
799
|
+
return n.day(a, {
|
|
791
800
|
width: "wide",
|
|
792
801
|
context: "formatting"
|
|
793
802
|
});
|
|
794
803
|
}
|
|
795
804
|
},
|
|
796
805
|
// Local day of week
|
|
797
|
-
e: function(t, e, n,
|
|
798
|
-
const
|
|
806
|
+
e: function(t, e, n, a) {
|
|
807
|
+
const r = t.getDay(), o = (r - a.weekStartsOn + 8) % 7 || 7;
|
|
799
808
|
switch (e) {
|
|
800
809
|
case "e":
|
|
801
810
|
return String(o);
|
|
802
811
|
case "ee":
|
|
803
|
-
return
|
|
812
|
+
return i(o, 2);
|
|
804
813
|
case "eo":
|
|
805
814
|
return n.ordinalNumber(o, { unit: "day" });
|
|
806
815
|
case "eee":
|
|
807
|
-
return n.day(
|
|
816
|
+
return n.day(r, {
|
|
808
817
|
width: "abbreviated",
|
|
809
818
|
context: "formatting"
|
|
810
819
|
});
|
|
811
820
|
case "eeeee":
|
|
812
|
-
return n.day(
|
|
821
|
+
return n.day(r, {
|
|
813
822
|
width: "narrow",
|
|
814
823
|
context: "formatting"
|
|
815
824
|
});
|
|
816
825
|
case "eeeeee":
|
|
817
|
-
return n.day(
|
|
826
|
+
return n.day(r, {
|
|
818
827
|
width: "short",
|
|
819
828
|
context: "formatting"
|
|
820
829
|
});
|
|
821
830
|
case "eeee":
|
|
822
831
|
default:
|
|
823
|
-
return n.day(
|
|
832
|
+
return n.day(r, {
|
|
824
833
|
width: "wide",
|
|
825
834
|
context: "formatting"
|
|
826
835
|
});
|
|
827
836
|
}
|
|
828
837
|
},
|
|
829
838
|
// Stand-alone local day of week
|
|
830
|
-
c: function(t, e, n,
|
|
831
|
-
const
|
|
839
|
+
c: function(t, e, n, a) {
|
|
840
|
+
const r = t.getDay(), o = (r - a.weekStartsOn + 8) % 7 || 7;
|
|
832
841
|
switch (e) {
|
|
833
842
|
case "c":
|
|
834
843
|
return String(o);
|
|
835
844
|
case "cc":
|
|
836
|
-
return
|
|
845
|
+
return i(o, e.length);
|
|
837
846
|
case "co":
|
|
838
847
|
return n.ordinalNumber(o, { unit: "day" });
|
|
839
848
|
case "ccc":
|
|
840
|
-
return n.day(
|
|
849
|
+
return n.day(r, {
|
|
841
850
|
width: "abbreviated",
|
|
842
851
|
context: "standalone"
|
|
843
852
|
});
|
|
844
853
|
case "ccccc":
|
|
845
|
-
return n.day(
|
|
854
|
+
return n.day(r, {
|
|
846
855
|
width: "narrow",
|
|
847
856
|
context: "standalone"
|
|
848
857
|
});
|
|
849
858
|
case "cccccc":
|
|
850
|
-
return n.day(
|
|
859
|
+
return n.day(r, {
|
|
851
860
|
width: "short",
|
|
852
861
|
context: "standalone"
|
|
853
862
|
});
|
|
854
863
|
case "cccc":
|
|
855
864
|
default:
|
|
856
|
-
return n.day(
|
|
865
|
+
return n.day(r, {
|
|
857
866
|
width: "wide",
|
|
858
867
|
context: "standalone"
|
|
859
868
|
});
|
|
@@ -861,32 +870,32 @@ const l = {
|
|
|
861
870
|
},
|
|
862
871
|
// ISO day of week
|
|
863
872
|
i: function(t, e, n) {
|
|
864
|
-
const
|
|
873
|
+
const a = t.getDay(), r = a === 0 ? 7 : a;
|
|
865
874
|
switch (e) {
|
|
866
875
|
case "i":
|
|
867
|
-
return String(
|
|
876
|
+
return String(r);
|
|
868
877
|
case "ii":
|
|
869
|
-
return
|
|
878
|
+
return i(r, e.length);
|
|
870
879
|
case "io":
|
|
871
|
-
return n.ordinalNumber(
|
|
880
|
+
return n.ordinalNumber(r, { unit: "day" });
|
|
872
881
|
case "iii":
|
|
873
|
-
return n.day(
|
|
882
|
+
return n.day(a, {
|
|
874
883
|
width: "abbreviated",
|
|
875
884
|
context: "formatting"
|
|
876
885
|
});
|
|
877
886
|
case "iiiii":
|
|
878
|
-
return n.day(
|
|
887
|
+
return n.day(a, {
|
|
879
888
|
width: "narrow",
|
|
880
889
|
context: "formatting"
|
|
881
890
|
});
|
|
882
891
|
case "iiiiii":
|
|
883
|
-
return n.day(
|
|
892
|
+
return n.day(a, {
|
|
884
893
|
width: "short",
|
|
885
894
|
context: "formatting"
|
|
886
895
|
});
|
|
887
896
|
case "iiii":
|
|
888
897
|
default:
|
|
889
|
-
return n.day(
|
|
898
|
+
return n.day(a, {
|
|
890
899
|
width: "wide",
|
|
891
900
|
context: "formatting"
|
|
892
901
|
});
|
|
@@ -894,27 +903,27 @@ const l = {
|
|
|
894
903
|
},
|
|
895
904
|
// AM or PM
|
|
896
905
|
a: function(t, e, n) {
|
|
897
|
-
const
|
|
906
|
+
const r = t.getHours() / 12 >= 1 ? "pm" : "am";
|
|
898
907
|
switch (e) {
|
|
899
908
|
case "a":
|
|
900
909
|
case "aa":
|
|
901
|
-
return n.dayPeriod(
|
|
910
|
+
return n.dayPeriod(r, {
|
|
902
911
|
width: "abbreviated",
|
|
903
912
|
context: "formatting"
|
|
904
913
|
});
|
|
905
914
|
case "aaa":
|
|
906
|
-
return n.dayPeriod(
|
|
915
|
+
return n.dayPeriod(r, {
|
|
907
916
|
width: "abbreviated",
|
|
908
917
|
context: "formatting"
|
|
909
918
|
}).toLowerCase();
|
|
910
919
|
case "aaaaa":
|
|
911
|
-
return n.dayPeriod(
|
|
920
|
+
return n.dayPeriod(r, {
|
|
912
921
|
width: "narrow",
|
|
913
922
|
context: "formatting"
|
|
914
923
|
});
|
|
915
924
|
case "aaaa":
|
|
916
925
|
default:
|
|
917
|
-
return n.dayPeriod(
|
|
926
|
+
return n.dayPeriod(r, {
|
|
918
927
|
width: "wide",
|
|
919
928
|
context: "formatting"
|
|
920
929
|
});
|
|
@@ -922,28 +931,28 @@ const l = {
|
|
|
922
931
|
},
|
|
923
932
|
// AM, PM, midnight, noon
|
|
924
933
|
b: function(t, e, n) {
|
|
925
|
-
const
|
|
926
|
-
let
|
|
927
|
-
switch (
|
|
934
|
+
const a = t.getHours();
|
|
935
|
+
let r;
|
|
936
|
+
switch (a === 12 ? r = y.noon : a === 0 ? r = y.midnight : r = a / 12 >= 1 ? "pm" : "am", e) {
|
|
928
937
|
case "b":
|
|
929
938
|
case "bb":
|
|
930
|
-
return n.dayPeriod(
|
|
939
|
+
return n.dayPeriod(r, {
|
|
931
940
|
width: "abbreviated",
|
|
932
941
|
context: "formatting"
|
|
933
942
|
});
|
|
934
943
|
case "bbb":
|
|
935
|
-
return n.dayPeriod(
|
|
944
|
+
return n.dayPeriod(r, {
|
|
936
945
|
width: "abbreviated",
|
|
937
946
|
context: "formatting"
|
|
938
947
|
}).toLowerCase();
|
|
939
948
|
case "bbbbb":
|
|
940
|
-
return n.dayPeriod(
|
|
949
|
+
return n.dayPeriod(r, {
|
|
941
950
|
width: "narrow",
|
|
942
951
|
context: "formatting"
|
|
943
952
|
});
|
|
944
953
|
case "bbbb":
|
|
945
954
|
default:
|
|
946
|
-
return n.dayPeriod(
|
|
955
|
+
return n.dayPeriod(r, {
|
|
947
956
|
width: "wide",
|
|
948
957
|
context: "formatting"
|
|
949
958
|
});
|
|
@@ -951,24 +960,24 @@ const l = {
|
|
|
951
960
|
},
|
|
952
961
|
// in the morning, in the afternoon, in the evening, at night
|
|
953
962
|
B: function(t, e, n) {
|
|
954
|
-
const
|
|
955
|
-
let
|
|
956
|
-
switch (
|
|
963
|
+
const a = t.getHours();
|
|
964
|
+
let r;
|
|
965
|
+
switch (a >= 17 ? r = y.evening : a >= 12 ? r = y.afternoon : a >= 4 ? r = y.morning : r = y.night, e) {
|
|
957
966
|
case "B":
|
|
958
967
|
case "BB":
|
|
959
968
|
case "BBB":
|
|
960
|
-
return n.dayPeriod(
|
|
969
|
+
return n.dayPeriod(r, {
|
|
961
970
|
width: "abbreviated",
|
|
962
971
|
context: "formatting"
|
|
963
972
|
});
|
|
964
973
|
case "BBBBB":
|
|
965
|
-
return n.dayPeriod(
|
|
974
|
+
return n.dayPeriod(r, {
|
|
966
975
|
width: "narrow",
|
|
967
976
|
context: "formatting"
|
|
968
977
|
});
|
|
969
978
|
case "BBBB":
|
|
970
979
|
default:
|
|
971
|
-
return n.dayPeriod(
|
|
980
|
+
return n.dayPeriod(r, {
|
|
972
981
|
width: "wide",
|
|
973
982
|
context: "formatting"
|
|
974
983
|
});
|
|
@@ -977,8 +986,8 @@ const l = {
|
|
|
977
986
|
// Hour [1-12]
|
|
978
987
|
h: function(t, e, n) {
|
|
979
988
|
if (e === "ho") {
|
|
980
|
-
let
|
|
981
|
-
return
|
|
989
|
+
let a = t.getHours() % 12;
|
|
990
|
+
return a === 0 && (a = 12), n.ordinalNumber(a, { unit: "hour" });
|
|
982
991
|
}
|
|
983
992
|
return l.h(t, e);
|
|
984
993
|
},
|
|
@@ -988,13 +997,13 @@ const l = {
|
|
|
988
997
|
},
|
|
989
998
|
// Hour [0-11]
|
|
990
999
|
K: function(t, e, n) {
|
|
991
|
-
const
|
|
992
|
-
return e === "Ko" ? n.ordinalNumber(
|
|
1000
|
+
const a = t.getHours() % 12;
|
|
1001
|
+
return e === "Ko" ? n.ordinalNumber(a, { unit: "hour" }) : i(a, e.length);
|
|
993
1002
|
},
|
|
994
1003
|
// Hour [1-24]
|
|
995
1004
|
k: function(t, e, n) {
|
|
996
|
-
let
|
|
997
|
-
return
|
|
1005
|
+
let a = t.getHours();
|
|
1006
|
+
return a === 0 && (a = 24), e === "ko" ? n.ordinalNumber(a, { unit: "hour" }) : i(a, e.length);
|
|
998
1007
|
},
|
|
999
1008
|
// Minute
|
|
1000
1009
|
m: function(t, e, n) {
|
|
@@ -1010,82 +1019,82 @@ const l = {
|
|
|
1010
1019
|
},
|
|
1011
1020
|
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1012
1021
|
X: function(t, e, n) {
|
|
1013
|
-
const
|
|
1014
|
-
if (
|
|
1022
|
+
const a = t.getTimezoneOffset();
|
|
1023
|
+
if (a === 0)
|
|
1015
1024
|
return "Z";
|
|
1016
1025
|
switch (e) {
|
|
1017
1026
|
case "X":
|
|
1018
|
-
return T(
|
|
1027
|
+
return T(a);
|
|
1019
1028
|
case "XXXX":
|
|
1020
1029
|
case "XX":
|
|
1021
|
-
return w(
|
|
1030
|
+
return w(a);
|
|
1022
1031
|
case "XXXXX":
|
|
1023
1032
|
case "XXX":
|
|
1024
1033
|
default:
|
|
1025
|
-
return w(
|
|
1034
|
+
return w(a, ":");
|
|
1026
1035
|
}
|
|
1027
1036
|
},
|
|
1028
1037
|
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
1029
1038
|
x: function(t, e, n) {
|
|
1030
|
-
const
|
|
1039
|
+
const a = t.getTimezoneOffset();
|
|
1031
1040
|
switch (e) {
|
|
1032
1041
|
case "x":
|
|
1033
|
-
return T(
|
|
1042
|
+
return T(a);
|
|
1034
1043
|
case "xxxx":
|
|
1035
1044
|
case "xx":
|
|
1036
|
-
return w(
|
|
1045
|
+
return w(a);
|
|
1037
1046
|
case "xxxxx":
|
|
1038
1047
|
case "xxx":
|
|
1039
1048
|
default:
|
|
1040
|
-
return w(
|
|
1049
|
+
return w(a, ":");
|
|
1041
1050
|
}
|
|
1042
1051
|
},
|
|
1043
1052
|
// Timezone (GMT)
|
|
1044
1053
|
O: function(t, e, n) {
|
|
1045
|
-
const
|
|
1054
|
+
const a = t.getTimezoneOffset();
|
|
1046
1055
|
switch (e) {
|
|
1047
1056
|
case "O":
|
|
1048
1057
|
case "OO":
|
|
1049
1058
|
case "OOO":
|
|
1050
|
-
return "GMT" +
|
|
1059
|
+
return "GMT" + S(a, ":");
|
|
1051
1060
|
case "OOOO":
|
|
1052
1061
|
default:
|
|
1053
|
-
return "GMT" + w(
|
|
1062
|
+
return "GMT" + w(a, ":");
|
|
1054
1063
|
}
|
|
1055
1064
|
},
|
|
1056
1065
|
// Timezone (specific non-location)
|
|
1057
1066
|
z: function(t, e, n) {
|
|
1058
|
-
const
|
|
1067
|
+
const a = t.getTimezoneOffset();
|
|
1059
1068
|
switch (e) {
|
|
1060
1069
|
case "z":
|
|
1061
1070
|
case "zz":
|
|
1062
1071
|
case "zzz":
|
|
1063
|
-
return "GMT" +
|
|
1072
|
+
return "GMT" + S(a, ":");
|
|
1064
1073
|
case "zzzz":
|
|
1065
1074
|
default:
|
|
1066
|
-
return "GMT" + w(
|
|
1075
|
+
return "GMT" + w(a, ":");
|
|
1067
1076
|
}
|
|
1068
1077
|
},
|
|
1069
1078
|
// Seconds timestamp
|
|
1070
1079
|
t: function(t, e, n) {
|
|
1071
|
-
const
|
|
1072
|
-
return
|
|
1080
|
+
const a = Math.trunc(+t / 1e3);
|
|
1081
|
+
return i(a, e.length);
|
|
1073
1082
|
},
|
|
1074
1083
|
// Milliseconds timestamp
|
|
1075
1084
|
T: function(t, e, n) {
|
|
1076
|
-
return
|
|
1085
|
+
return i(+t, e.length);
|
|
1077
1086
|
}
|
|
1078
1087
|
};
|
|
1079
|
-
function
|
|
1080
|
-
const n = t > 0 ? "-" : "+",
|
|
1081
|
-
return o === 0 ? n + String(
|
|
1088
|
+
function S(t, e = "") {
|
|
1089
|
+
const n = t > 0 ? "-" : "+", a = Math.abs(t), r = Math.trunc(a / 60), o = a % 60;
|
|
1090
|
+
return o === 0 ? n + String(r) : n + String(r) + e + i(o, 2);
|
|
1082
1091
|
}
|
|
1083
1092
|
function T(t, e) {
|
|
1084
|
-
return t % 60 === 0 ? (t > 0 ? "-" : "+") +
|
|
1093
|
+
return t % 60 === 0 ? (t > 0 ? "-" : "+") + i(Math.abs(t) / 60, 2) : w(t, e);
|
|
1085
1094
|
}
|
|
1086
1095
|
function w(t, e = "") {
|
|
1087
|
-
const n = t > 0 ? "-" : "+",
|
|
1088
|
-
return n +
|
|
1096
|
+
const n = t > 0 ? "-" : "+", a = Math.abs(t), r = i(Math.trunc(a / 60), 2), o = i(a % 60, 2);
|
|
1097
|
+
return n + r + e + o;
|
|
1089
1098
|
}
|
|
1090
1099
|
const F = (t, e) => {
|
|
1091
1100
|
switch (t) {
|
|
@@ -1099,7 +1108,7 @@ const F = (t, e) => {
|
|
|
1099
1108
|
default:
|
|
1100
1109
|
return e.date({ width: "full" });
|
|
1101
1110
|
}
|
|
1102
|
-
},
|
|
1111
|
+
}, q = (t, e) => {
|
|
1103
1112
|
switch (t) {
|
|
1104
1113
|
case "p":
|
|
1105
1114
|
return e.time({ width: "short" });
|
|
@@ -1112,11 +1121,11 @@ const F = (t, e) => {
|
|
|
1112
1121
|
return e.time({ width: "full" });
|
|
1113
1122
|
}
|
|
1114
1123
|
}, Wt = (t, e) => {
|
|
1115
|
-
const n = t.match(/(P+)(p+)?/) || [],
|
|
1116
|
-
if (!
|
|
1124
|
+
const n = t.match(/(P+)(p+)?/) || [], a = n[1], r = n[2];
|
|
1125
|
+
if (!r)
|
|
1117
1126
|
return F(t, e);
|
|
1118
1127
|
let o;
|
|
1119
|
-
switch (
|
|
1128
|
+
switch (a) {
|
|
1120
1129
|
case "P":
|
|
1121
1130
|
o = e.dateTime({ width: "short" });
|
|
1122
1131
|
break;
|
|
@@ -1131,89 +1140,120 @@ const F = (t, e) => {
|
|
|
1131
1140
|
o = e.dateTime({ width: "full" });
|
|
1132
1141
|
break;
|
|
1133
1142
|
}
|
|
1134
|
-
return o.replace("{{date}}", F(
|
|
1135
|
-
},
|
|
1136
|
-
p:
|
|
1143
|
+
return o.replace("{{date}}", F(a, e)).replace("{{time}}", q(r, e));
|
|
1144
|
+
}, xt = {
|
|
1145
|
+
p: q,
|
|
1137
1146
|
P: Wt
|
|
1138
|
-
}, vt = /^D+$/,
|
|
1147
|
+
}, vt = /^D+$/, Yt = /^Y+$/, St = ["D", "DD", "YY", "YYYY"];
|
|
1139
1148
|
function Tt(t) {
|
|
1140
1149
|
return vt.test(t);
|
|
1141
1150
|
}
|
|
1142
1151
|
function Ft(t) {
|
|
1143
|
-
return
|
|
1152
|
+
return Yt.test(t);
|
|
1144
1153
|
}
|
|
1145
1154
|
function Et(t, e, n) {
|
|
1146
|
-
const
|
|
1147
|
-
if (console.warn(
|
|
1148
|
-
throw new RangeError(
|
|
1149
|
-
}
|
|
1150
|
-
function Ct(t, e, n) {
|
|
1151
|
-
const r = t[0] === "Y" ? "years" : "days of the month";
|
|
1152
|
-
return `Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
1153
|
-
}
|
|
1154
|
-
function qt(t) {
|
|
1155
|
-
return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
|
|
1155
|
+
const a = It(t, e, n);
|
|
1156
|
+
if (console.warn(a), St.includes(t))
|
|
1157
|
+
throw new RangeError(a);
|
|
1156
1158
|
}
|
|
1157
|
-
function
|
|
1158
|
-
|
|
1159
|
+
function It(t, e, n) {
|
|
1160
|
+
const a = t[0] === "Y" ? "years" : "days of the month";
|
|
1161
|
+
return `Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${a} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
1159
1162
|
}
|
|
1160
|
-
const
|
|
1161
|
-
function
|
|
1162
|
-
const
|
|
1163
|
-
if (!
|
|
1163
|
+
const Ct = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, qt = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Nt = /^'([^]*?)'?$/, Ht = /''/g, Qt = /[a-zA-Z]/;
|
|
1164
|
+
function ce(t, e, n) {
|
|
1165
|
+
const a = O(), r = n?.locale ?? a.locale ?? Mt, o = n?.firstWeekContainsDate ?? n?.locale?.options?.firstWeekContainsDate ?? a.firstWeekContainsDate ?? a.locale?.options?.firstWeekContainsDate ?? 1, s = n?.weekStartsOn ?? n?.locale?.options?.weekStartsOn ?? a.weekStartsOn ?? a.locale?.options?.weekStartsOn ?? 0, c = h(t, n?.in);
|
|
1166
|
+
if (!_(c))
|
|
1164
1167
|
throw new RangeError("Invalid time value");
|
|
1165
|
-
let f = e.match(
|
|
1166
|
-
const
|
|
1167
|
-
if (
|
|
1168
|
-
const k =
|
|
1169
|
-
return k(d,
|
|
1168
|
+
let f = e.match(qt).map((d) => {
|
|
1169
|
+
const u = d[0];
|
|
1170
|
+
if (u === "p" || u === "P") {
|
|
1171
|
+
const k = xt[u];
|
|
1172
|
+
return k(d, r.formatLong);
|
|
1170
1173
|
}
|
|
1171
1174
|
return d;
|
|
1172
|
-
}).join("").match(
|
|
1175
|
+
}).join("").match(Ct).map((d) => {
|
|
1173
1176
|
if (d === "''")
|
|
1174
1177
|
return { isToken: !1, value: "'" };
|
|
1175
|
-
const
|
|
1176
|
-
if (
|
|
1177
|
-
return { isToken: !1, value:
|
|
1178
|
-
if (
|
|
1178
|
+
const u = d[0];
|
|
1179
|
+
if (u === "'")
|
|
1180
|
+
return { isToken: !1, value: Xt(d) };
|
|
1181
|
+
if (Y[u])
|
|
1179
1182
|
return { isToken: !0, value: d };
|
|
1180
|
-
if (
|
|
1183
|
+
if (u.match(Qt))
|
|
1181
1184
|
throw new RangeError(
|
|
1182
|
-
"Format string contains an unescaped latin alphabet character `" +
|
|
1185
|
+
"Format string contains an unescaped latin alphabet character `" + u + "`"
|
|
1183
1186
|
);
|
|
1184
1187
|
return { isToken: !1, value: d };
|
|
1185
1188
|
});
|
|
1186
|
-
|
|
1189
|
+
r.localize.preprocessor && (f = r.localize.preprocessor(c, f));
|
|
1187
1190
|
const m = {
|
|
1188
1191
|
firstWeekContainsDate: o,
|
|
1189
|
-
weekStartsOn:
|
|
1190
|
-
locale:
|
|
1192
|
+
weekStartsOn: s,
|
|
1193
|
+
locale: r
|
|
1191
1194
|
};
|
|
1192
1195
|
return f.map((d) => {
|
|
1193
1196
|
if (!d.isToken)
|
|
1194
1197
|
return d.value;
|
|
1195
|
-
const
|
|
1196
|
-
(!n?.useAdditionalWeekYearTokens && Ft(
|
|
1197
|
-
const k =
|
|
1198
|
-
return k(
|
|
1198
|
+
const u = d.value;
|
|
1199
|
+
(!n?.useAdditionalWeekYearTokens && Ft(u) || !n?.useAdditionalDayOfYearTokens && Tt(u)) && Et(u, e, String(t));
|
|
1200
|
+
const k = Y[u[0]];
|
|
1201
|
+
return k(c, u, r.localize, m);
|
|
1199
1202
|
}).join("");
|
|
1200
1203
|
}
|
|
1201
|
-
function
|
|
1202
|
-
const e = t.match(
|
|
1203
|
-
return e ? e[1].replace(
|
|
1204
|
+
function Xt(t) {
|
|
1205
|
+
const e = t.match(Nt);
|
|
1206
|
+
return e ? e[1].replace(Ht, "'") : t;
|
|
1204
1207
|
}
|
|
1205
1208
|
export {
|
|
1209
|
+
ee as A,
|
|
1210
|
+
ne as B,
|
|
1211
|
+
ae as C,
|
|
1212
|
+
oe as D,
|
|
1213
|
+
se as E,
|
|
1214
|
+
re as F,
|
|
1215
|
+
Rt as G,
|
|
1216
|
+
C as H,
|
|
1217
|
+
Dt as I,
|
|
1218
|
+
Ot as J,
|
|
1219
|
+
xt as K,
|
|
1220
|
+
Ft as L,
|
|
1221
|
+
Et as M,
|
|
1222
|
+
Tt as N,
|
|
1223
|
+
l as O,
|
|
1224
|
+
Lt as P,
|
|
1225
|
+
Ut as Q,
|
|
1226
|
+
Kt as R,
|
|
1227
|
+
Zt as S,
|
|
1228
|
+
ie as T,
|
|
1229
|
+
kt as U,
|
|
1230
|
+
Y as V,
|
|
1231
|
+
Pt as W,
|
|
1232
|
+
X,
|
|
1206
1233
|
Bt as a,
|
|
1207
|
-
|
|
1234
|
+
_t as b,
|
|
1208
1235
|
g as c,
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1236
|
+
H as d,
|
|
1237
|
+
v as e,
|
|
1238
|
+
ce as f,
|
|
1239
|
+
I as g,
|
|
1240
|
+
P as h,
|
|
1241
|
+
_ as i,
|
|
1242
|
+
x as j,
|
|
1243
|
+
jt as k,
|
|
1244
|
+
M as l,
|
|
1245
|
+
At as m,
|
|
1246
|
+
N as n,
|
|
1247
|
+
L as o,
|
|
1248
|
+
O as p,
|
|
1249
|
+
Mt as q,
|
|
1250
|
+
$t as r,
|
|
1251
|
+
Q as s,
|
|
1252
|
+
h as t,
|
|
1253
|
+
Jt as u,
|
|
1254
|
+
Vt as v,
|
|
1255
|
+
i as w,
|
|
1256
|
+
Gt as x,
|
|
1257
|
+
zt as y,
|
|
1258
|
+
te as z
|
|
1219
1259
|
};
|