@sbb-esta/lyne-elements-experimental 2.11.1 → 2.11.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/core/datetime/date-helper.js +142 -142
- package/core/timetable/access-leg-helper.js +49 -52
- package/core/timetable/timetable-helper.js +7 -8
- package/custom-elements.json +852 -867
- package/development/core/datetime/date-helper.js +10 -10
- package/development/core/timetable/access-leg-helper.js +12 -15
- package/development/core/timetable/timetable-helper.js +6 -7
- package/development/{differenceInMinutes-CHSyWiQs.js → differenceInMinutes-D5Nj8Stc.js} +3 -3
- package/development/{format-D0-yhzi4.js → format-BQfaa1ZT.js} +22 -26
- package/development/{isValid-Bo4R7iA7.js → isValid-DvieCZVi.js} +3 -3
- package/development/journey-summary/journey-summary.component.js +4 -5
- package/development/pearl-chain/pearl-chain.component.d.ts.map +1 -1
- package/development/pearl-chain/pearl-chain.component.js +28 -39
- package/development/pearl-chain-time/pearl-chain-time.component.js +5 -6
- package/development/pearl-chain-vertical/pearl-chain-vertical.component.js +1 -1
- package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +1 -1
- package/development/seat-reservation/common/mapper/icon-mapper.js +1 -1
- package/development/seat-reservation/common/mapper/mapper.js +14 -16
- package/development/seat-reservation/common/mapper/seat-reservation-sample-data.js +1 -1
- package/development/seat-reservation/common/svgs.js +1 -1
- package/development/seat-reservation/common/translations/i18n.js +2 -3
- package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation/seat-reservation-base-element.js +22 -33
- package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation/seat-reservation.component.js +18 -25
- package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +1 -1
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +2 -3
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +7 -8
- package/development/seat-reservation/{seat-reservation-navigation/seat-reservation-navigation-coach → seat-reservation-navigation-coach}/seat-reservation-navigation-coach.component.d.ts +1 -1
- package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts.map +1 -0
- package/development/seat-reservation/{seat-reservation-navigation/seat-reservation-navigation-coach → seat-reservation-navigation-coach}/seat-reservation-navigation-coach.component.js +8 -12
- package/development/seat-reservation/seat-reservation-navigation-coach.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +123 -0
- package/development/seat-reservation/seat-reservation-navigation-services.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +4 -5
- package/development/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.d.ts.map +1 -0
- package/development/seat-reservation/{seat-reservation/seat-reservation-scoped → seat-reservation-scoped}/seat-reservation-scoped.component.js +6 -7
- package/{seat-reservation → development}/seat-reservation/seat-reservation-scoped.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation.d.ts +0 -1
- package/development/seat-reservation/seat-reservation.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation.js +1 -3
- package/development/seat-reservation.d.ts +3 -1
- package/development/seat-reservation.d.ts.map +1 -1
- package/development/seat-reservation.js +3 -3
- package/development/timetable-duration/timetable-duration.component.js +1 -1
- package/development/timetable-row/timetable-row.component.js +58 -89
- package/differenceInMinutes-CP_C5onR.js +23 -0
- package/{format-Dg8rkk7h.js → format-lqeCzmzS.js} +438 -442
- package/index.d.ts +3 -3
- package/index.js +3 -3
- package/isValid-Ceq2O0NQ.js +45 -0
- package/journey-summary/journey-summary.component.js +3 -4
- package/package.json +14 -19
- package/pearl-chain/pearl-chain.component.d.ts.map +1 -1
- package/pearl-chain/pearl-chain.component.js +78 -95
- package/pearl-chain-time/pearl-chain-time.component.js +44 -45
- package/seat-reservation/common/mapper/mapper.js +50 -54
- package/seat-reservation/common/translations/i18n.js +5 -6
- package/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts.map +1 -1
- package/seat-reservation/seat-reservation/seat-reservation-base-element.js +104 -115
- package/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +1 -1
- package/seat-reservation/seat-reservation/seat-reservation.component.js +80 -89
- package/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +15 -18
- package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +58 -59
- package/seat-reservation/{seat-reservation-navigation/seat-reservation-navigation-coach → seat-reservation-navigation-coach}/seat-reservation-navigation-coach.component.d.ts +1 -1
- package/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts.map +1 -0
- package/seat-reservation/{seat-reservation-navigation/seat-reservation-navigation-coach → seat-reservation-navigation-coach}/seat-reservation-navigation-coach.component.js +71 -75
- package/seat-reservation/seat-reservation-navigation-coach.d.ts.map +1 -0
- package/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.d.ts.map +1 -0
- package/seat-reservation/{seat-reservation-navigation/seat-reservation-navigation-services → seat-reservation-navigation-services}/seat-reservation-navigation-services.component.js +14 -15
- package/seat-reservation/seat-reservation-navigation-services.d.ts.map +1 -0
- package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +23 -24
- package/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.d.ts.map +1 -0
- package/seat-reservation/{seat-reservation/seat-reservation-scoped → seat-reservation-scoped}/seat-reservation-scoped.component.js +40 -41
- package/seat-reservation/seat-reservation-scoped.d.ts.map +1 -0
- package/seat-reservation/seat-reservation.d.ts +0 -1
- package/seat-reservation/seat-reservation.d.ts.map +1 -1
- package/seat-reservation/seat-reservation.js +0 -2
- package/seat-reservation.d.ts +3 -1
- package/seat-reservation.d.ts.map +1 -1
- package/seat-reservation.js +12 -12
- package/timetable-row/timetable-row.component.js +207 -247
- package/development/seat-reservation/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.d.ts.map +0 -1
- package/development/seat-reservation/seat-reservation/seat-reservation-scoped.d.ts.map +0 -1
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts.map +0 -1
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach.d.ts.map +0 -1
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.d.ts.map +0 -1
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +0 -123
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services.d.ts.map +0 -1
- package/development/seat-reservation/seat-reservation-navigation.d.ts +0 -6
- package/development/seat-reservation/seat-reservation-navigation.d.ts.map +0 -1
- package/development/seat-reservation/seat-reservation-navigation.js +0 -7
- package/differenceInMinutes-BMqUZdhj.js +0 -23
- package/isValid-DJ69OMZJ.js +0 -45
- package/seat-reservation/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.d.ts.map +0 -1
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts.map +0 -1
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach.d.ts.map +0 -1
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.d.ts.map +0 -1
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services.d.ts.map +0 -1
- package/seat-reservation/seat-reservation-navigation.d.ts +0 -6
- package/seat-reservation/seat-reservation-navigation.d.ts.map +0 -1
- package/seat-reservation/seat-reservation-navigation.js +0 -6
- /package/development/seat-reservation/{seat-reservation-navigation/seat-reservation-navigation-coach.d.ts → seat-reservation-navigation-coach.d.ts} +0 -0
- /package/development/seat-reservation/{seat-reservation-navigation/seat-reservation-navigation-coach.js → seat-reservation-navigation-coach.js} +0 -0
- /package/development/seat-reservation/{seat-reservation-navigation/seat-reservation-navigation-services → seat-reservation-navigation-services}/seat-reservation-navigation-services.component.d.ts +0 -0
- /package/development/seat-reservation/{seat-reservation-navigation/seat-reservation-navigation-services.d.ts → seat-reservation-navigation-services.d.ts} +0 -0
- /package/development/seat-reservation/{seat-reservation-navigation/seat-reservation-navigation-services.js → seat-reservation-navigation-services.js} +0 -0
- /package/development/seat-reservation/{seat-reservation/seat-reservation-scoped → seat-reservation-scoped}/seat-reservation-scoped.component.d.ts +0 -0
- /package/development/seat-reservation/{seat-reservation/seat-reservation-scoped.d.ts → seat-reservation-scoped.d.ts} +0 -0
- /package/development/seat-reservation/{seat-reservation/seat-reservation-scoped.js → seat-reservation-scoped.js} +0 -0
- /package/seat-reservation/{seat-reservation-navigation/seat-reservation-navigation-coach.d.ts → seat-reservation-navigation-coach.d.ts} +0 -0
- /package/seat-reservation/{seat-reservation-navigation/seat-reservation-navigation-coach.js → seat-reservation-navigation-coach.js} +0 -0
- /package/seat-reservation/{seat-reservation-navigation/seat-reservation-navigation-services → seat-reservation-navigation-services}/seat-reservation-navigation-services.component.d.ts +0 -0
- /package/seat-reservation/{seat-reservation-navigation/seat-reservation-navigation-services.d.ts → seat-reservation-navigation-services.d.ts} +0 -0
- /package/seat-reservation/{seat-reservation-navigation/seat-reservation-navigation-services.js → seat-reservation-navigation-services.js} +0 -0
- /package/seat-reservation/{seat-reservation/seat-reservation-scoped → seat-reservation-scoped}/seat-reservation-scoped.component.d.ts +0 -0
- /package/seat-reservation/{seat-reservation/seat-reservation-scoped.d.ts → seat-reservation-scoped.d.ts} +0 -0
- /package/seat-reservation/{seat-reservation/seat-reservation-scoped.js → seat-reservation-scoped.js} +0 -0
|
@@ -1,34 +1,33 @@
|
|
|
1
|
-
import { d as
|
|
2
|
-
import { t as
|
|
3
|
-
let
|
|
4
|
-
function
|
|
5
|
-
return
|
|
1
|
+
import { d as q, i as C } from "./isValid-Ceq2O0NQ.js";
|
|
2
|
+
import { t as l, c as y, d as D } from "./toDate-BCXKL_wM.js";
|
|
3
|
+
let N = {};
|
|
4
|
+
function O() {
|
|
5
|
+
return N;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
const e = S(), r = (t == null ? void 0 : t.weekStartsOn) ?? ((c = (u = t == null ? void 0 : t.locale) == null ? void 0 : u.options) == null ? void 0 : c.weekStartsOn) ?? e.weekStartsOn ?? ((f = (d = e.locale) == null ? void 0 : d.options) == null ? void 0 : f.weekStartsOn) ?? 0, a = w(n, t == null ? void 0 : t.in), i = a.getDay(), s = (i < r ? 7 : 0) + i - r;
|
|
7
|
+
function p(t, e) {
|
|
8
|
+
const n = O(), r = e?.weekStartsOn ?? e?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, a = l(t, e?.in), o = a.getDay(), s = (o < r ? 7 : 0) + o - r;
|
|
10
9
|
return a.setDate(a.getDate() - s), a.setHours(0, 0, 0, 0), a;
|
|
11
10
|
}
|
|
12
|
-
function
|
|
13
|
-
return
|
|
11
|
+
function M(t, e) {
|
|
12
|
+
return p(t, { ...e, weekStartsOn: 1 });
|
|
14
13
|
}
|
|
15
|
-
function
|
|
16
|
-
const
|
|
14
|
+
function T(t, e) {
|
|
15
|
+
const n = l(t, e?.in), r = n.getFullYear(), a = y(n, 0);
|
|
17
16
|
a.setFullYear(r + 1, 0, 4), a.setHours(0, 0, 0, 0);
|
|
18
|
-
const
|
|
17
|
+
const o = M(a), s = y(n, 0);
|
|
19
18
|
s.setFullYear(r, 0, 4), s.setHours(0, 0, 0, 0);
|
|
20
|
-
const
|
|
21
|
-
return
|
|
19
|
+
const c = M(s);
|
|
20
|
+
return n.getTime() >= o.getTime() ? r + 1 : n.getTime() >= c.getTime() ? r : r - 1;
|
|
22
21
|
}
|
|
23
|
-
function
|
|
24
|
-
const
|
|
25
|
-
return r.setFullYear(
|
|
22
|
+
function H(t, e) {
|
|
23
|
+
const n = T(t, e), r = y(t, 0);
|
|
24
|
+
return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), M(r);
|
|
26
25
|
}
|
|
27
|
-
function
|
|
28
|
-
const
|
|
29
|
-
return
|
|
26
|
+
function Q(t, e) {
|
|
27
|
+
const n = l(t, e?.in);
|
|
28
|
+
return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
30
29
|
}
|
|
31
|
-
const
|
|
30
|
+
const X = {
|
|
32
31
|
lessThanXSeconds: {
|
|
33
32
|
one: "less than a second",
|
|
34
33
|
other: "less than {{count}} seconds"
|
|
@@ -90,77 +89,77 @@ const R = {
|
|
|
90
89
|
one: "almost 1 year",
|
|
91
90
|
other: "almost {{count}} years"
|
|
92
91
|
}
|
|
93
|
-
},
|
|
92
|
+
}, L = (t, e, n) => {
|
|
94
93
|
let r;
|
|
95
|
-
const a =
|
|
96
|
-
return typeof a == "string" ? r = a :
|
|
94
|
+
const a = X[t];
|
|
95
|
+
return typeof a == "string" ? r = a : e === 1 ? r = a.one : r = a.other.replace("{{count}}", e.toString()), n?.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
|
|
97
96
|
};
|
|
98
|
-
function
|
|
99
|
-
return (
|
|
100
|
-
const
|
|
101
|
-
return
|
|
97
|
+
function k(t) {
|
|
98
|
+
return (e = {}) => {
|
|
99
|
+
const n = e.width ? String(e.width) : t.defaultWidth;
|
|
100
|
+
return t.formats[n] || t.formats[t.defaultWidth];
|
|
102
101
|
};
|
|
103
102
|
}
|
|
104
|
-
const
|
|
103
|
+
const G = {
|
|
105
104
|
full: "EEEE, MMMM do, y",
|
|
106
105
|
long: "MMMM do, y",
|
|
107
106
|
medium: "MMM d, y",
|
|
108
107
|
short: "MM/dd/yyyy"
|
|
109
|
-
},
|
|
108
|
+
}, _ = {
|
|
110
109
|
full: "h:mm:ss a zzzz",
|
|
111
110
|
long: "h:mm:ss a z",
|
|
112
111
|
medium: "h:mm:ss a",
|
|
113
112
|
short: "h:mm a"
|
|
114
|
-
},
|
|
113
|
+
}, B = {
|
|
115
114
|
full: "{{date}} 'at' {{time}}",
|
|
116
115
|
long: "{{date}} 'at' {{time}}",
|
|
117
116
|
medium: "{{date}}, {{time}}",
|
|
118
117
|
short: "{{date}}, {{time}}"
|
|
119
|
-
},
|
|
120
|
-
date:
|
|
121
|
-
formats:
|
|
118
|
+
}, R = {
|
|
119
|
+
date: k({
|
|
120
|
+
formats: G,
|
|
122
121
|
defaultWidth: "full"
|
|
123
122
|
}),
|
|
124
|
-
time:
|
|
125
|
-
formats:
|
|
123
|
+
time: k({
|
|
124
|
+
formats: _,
|
|
126
125
|
defaultWidth: "full"
|
|
127
126
|
}),
|
|
128
|
-
dateTime:
|
|
129
|
-
formats:
|
|
127
|
+
dateTime: k({
|
|
128
|
+
formats: B,
|
|
130
129
|
defaultWidth: "full"
|
|
131
130
|
})
|
|
132
|
-
},
|
|
131
|
+
}, A = {
|
|
133
132
|
lastWeek: "'last' eeee 'at' p",
|
|
134
133
|
yesterday: "'yesterday at' p",
|
|
135
134
|
today: "'today at' p",
|
|
136
135
|
tomorrow: "'tomorrow at' p",
|
|
137
136
|
nextWeek: "eeee 'at' p",
|
|
138
137
|
other: "P"
|
|
139
|
-
},
|
|
140
|
-
function
|
|
141
|
-
return (
|
|
142
|
-
const r =
|
|
138
|
+
}, V = (t, e, n, r) => A[t];
|
|
139
|
+
function b(t) {
|
|
140
|
+
return (e, n) => {
|
|
141
|
+
const r = n?.context ? String(n.context) : "standalone";
|
|
143
142
|
let a;
|
|
144
|
-
if (r === "formatting" &&
|
|
145
|
-
const s =
|
|
146
|
-
a =
|
|
143
|
+
if (r === "formatting" && t.formattingValues) {
|
|
144
|
+
const s = t.defaultFormattingWidth || t.defaultWidth, c = n?.width ? String(n.width) : s;
|
|
145
|
+
a = t.formattingValues[c] || t.formattingValues[s];
|
|
147
146
|
} else {
|
|
148
|
-
const s =
|
|
149
|
-
a =
|
|
147
|
+
const s = t.defaultWidth, c = n?.width ? String(n.width) : t.defaultWidth;
|
|
148
|
+
a = t.values[c] || t.values[s];
|
|
150
149
|
}
|
|
151
|
-
const
|
|
152
|
-
return a[
|
|
150
|
+
const o = t.argumentCallback ? t.argumentCallback(e) : e;
|
|
151
|
+
return a[o];
|
|
153
152
|
};
|
|
154
153
|
}
|
|
155
|
-
const
|
|
154
|
+
const j = {
|
|
156
155
|
narrow: ["B", "A"],
|
|
157
156
|
abbreviated: ["BC", "AD"],
|
|
158
157
|
wide: ["Before Christ", "Anno Domini"]
|
|
159
|
-
},
|
|
158
|
+
}, I = {
|
|
160
159
|
narrow: ["1", "2", "3", "4"],
|
|
161
160
|
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
162
161
|
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
163
|
-
},
|
|
162
|
+
}, J = {
|
|
164
163
|
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
165
164
|
abbreviated: [
|
|
166
165
|
"Jan",
|
|
@@ -190,7 +189,7 @@ const K = {
|
|
|
190
189
|
"November",
|
|
191
190
|
"December"
|
|
192
191
|
]
|
|
193
|
-
},
|
|
192
|
+
}, $ = {
|
|
194
193
|
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
195
194
|
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
196
195
|
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
@@ -203,7 +202,7 @@ const K = {
|
|
|
203
202
|
"Friday",
|
|
204
203
|
"Saturday"
|
|
205
204
|
]
|
|
206
|
-
},
|
|
205
|
+
}, K = {
|
|
207
206
|
narrow: {
|
|
208
207
|
am: "a",
|
|
209
208
|
pm: "p",
|
|
@@ -234,7 +233,7 @@ const K = {
|
|
|
234
233
|
evening: "evening",
|
|
235
234
|
night: "night"
|
|
236
235
|
}
|
|
237
|
-
},
|
|
236
|
+
}, U = {
|
|
238
237
|
narrow: {
|
|
239
238
|
am: "a",
|
|
240
239
|
pm: "p",
|
|
@@ -265,101 +264,101 @@ const K = {
|
|
|
265
264
|
evening: "in the evening",
|
|
266
265
|
night: "at night"
|
|
267
266
|
}
|
|
268
|
-
},
|
|
269
|
-
const
|
|
267
|
+
}, z = (t, e) => {
|
|
268
|
+
const n = Number(t), r = n % 100;
|
|
270
269
|
if (r > 20 || r < 10)
|
|
271
270
|
switch (r % 10) {
|
|
272
271
|
case 1:
|
|
273
|
-
return
|
|
272
|
+
return n + "st";
|
|
274
273
|
case 2:
|
|
275
|
-
return
|
|
274
|
+
return n + "nd";
|
|
276
275
|
case 3:
|
|
277
|
-
return
|
|
276
|
+
return n + "rd";
|
|
278
277
|
}
|
|
279
|
-
return
|
|
280
|
-
},
|
|
281
|
-
ordinalNumber:
|
|
282
|
-
era:
|
|
283
|
-
values:
|
|
278
|
+
return n + "th";
|
|
279
|
+
}, Z = {
|
|
280
|
+
ordinalNumber: z,
|
|
281
|
+
era: b({
|
|
282
|
+
values: j,
|
|
284
283
|
defaultWidth: "wide"
|
|
285
284
|
}),
|
|
286
|
-
quarter:
|
|
287
|
-
values:
|
|
285
|
+
quarter: b({
|
|
286
|
+
values: I,
|
|
288
287
|
defaultWidth: "wide",
|
|
289
|
-
argumentCallback: (
|
|
288
|
+
argumentCallback: (t) => t - 1
|
|
290
289
|
}),
|
|
291
|
-
month:
|
|
292
|
-
values:
|
|
290
|
+
month: b({
|
|
291
|
+
values: J,
|
|
293
292
|
defaultWidth: "wide"
|
|
294
293
|
}),
|
|
295
|
-
day:
|
|
296
|
-
values:
|
|
294
|
+
day: b({
|
|
295
|
+
values: $,
|
|
297
296
|
defaultWidth: "wide"
|
|
298
297
|
}),
|
|
299
|
-
dayPeriod:
|
|
300
|
-
values:
|
|
298
|
+
dayPeriod: b({
|
|
299
|
+
values: K,
|
|
301
300
|
defaultWidth: "wide",
|
|
302
|
-
formattingValues:
|
|
301
|
+
formattingValues: U,
|
|
303
302
|
defaultFormattingWidth: "wide"
|
|
304
303
|
})
|
|
305
304
|
};
|
|
306
|
-
function
|
|
307
|
-
return (
|
|
308
|
-
const r =
|
|
309
|
-
if (!
|
|
305
|
+
function P(t) {
|
|
306
|
+
return (e, n = {}) => {
|
|
307
|
+
const r = n.width, a = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], o = e.match(a);
|
|
308
|
+
if (!o)
|
|
310
309
|
return null;
|
|
311
|
-
const s =
|
|
310
|
+
const s = o[0], c = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], h = Array.isArray(c) ? et(c, (u) => u.test(s)) : (
|
|
312
311
|
// [TODO] -- I challenge you to fix the type
|
|
313
|
-
|
|
312
|
+
tt(c, (u) => u.test(s))
|
|
314
313
|
);
|
|
315
|
-
let
|
|
316
|
-
|
|
314
|
+
let f;
|
|
315
|
+
f = t.valueCallback ? t.valueCallback(h) : h, f = n.valueCallback ? (
|
|
317
316
|
// [TODO] -- I challenge you to fix the type
|
|
318
|
-
|
|
319
|
-
) :
|
|
320
|
-
const
|
|
321
|
-
return { value:
|
|
317
|
+
n.valueCallback(f)
|
|
318
|
+
) : f;
|
|
319
|
+
const d = e.slice(s.length);
|
|
320
|
+
return { value: f, rest: d };
|
|
322
321
|
};
|
|
323
322
|
}
|
|
324
|
-
function
|
|
325
|
-
for (const
|
|
326
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
327
|
-
return
|
|
323
|
+
function tt(t, e) {
|
|
324
|
+
for (const n in t)
|
|
325
|
+
if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n]))
|
|
326
|
+
return n;
|
|
328
327
|
}
|
|
329
|
-
function
|
|
330
|
-
for (let
|
|
331
|
-
if (t
|
|
332
|
-
return
|
|
328
|
+
function et(t, e) {
|
|
329
|
+
for (let n = 0; n < t.length; n++)
|
|
330
|
+
if (e(t[n]))
|
|
331
|
+
return n;
|
|
333
332
|
}
|
|
334
|
-
function
|
|
335
|
-
return (
|
|
336
|
-
const r =
|
|
333
|
+
function nt(t) {
|
|
334
|
+
return (e, n = {}) => {
|
|
335
|
+
const r = e.match(t.matchPattern);
|
|
337
336
|
if (!r) return null;
|
|
338
|
-
const a = r[0],
|
|
339
|
-
if (!
|
|
340
|
-
let s =
|
|
341
|
-
s =
|
|
342
|
-
const
|
|
343
|
-
return { value: s, rest:
|
|
337
|
+
const a = r[0], o = e.match(t.parsePattern);
|
|
338
|
+
if (!o) return null;
|
|
339
|
+
let s = t.valueCallback ? t.valueCallback(o[0]) : o[0];
|
|
340
|
+
s = n.valueCallback ? n.valueCallback(s) : s;
|
|
341
|
+
const c = e.slice(a.length);
|
|
342
|
+
return { value: s, rest: c };
|
|
344
343
|
};
|
|
345
344
|
}
|
|
346
|
-
const
|
|
345
|
+
const rt = /^(\d+)(th|st|nd|rd)?/i, at = /\d+/i, ot = {
|
|
347
346
|
narrow: /^(b|a)/i,
|
|
348
347
|
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
349
348
|
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
350
|
-
},
|
|
349
|
+
}, it = {
|
|
351
350
|
any: [/^b/i, /^(a|c)/i]
|
|
352
|
-
},
|
|
351
|
+
}, st = {
|
|
353
352
|
narrow: /^[1234]/i,
|
|
354
353
|
abbreviated: /^q[1234]/i,
|
|
355
354
|
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
356
|
-
},
|
|
355
|
+
}, ut = {
|
|
357
356
|
any: [/1/i, /2/i, /3/i, /4/i]
|
|
358
|
-
},
|
|
357
|
+
}, ct = {
|
|
359
358
|
narrow: /^[jfmasond]/i,
|
|
360
359
|
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
361
360
|
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
362
|
-
},
|
|
361
|
+
}, dt = {
|
|
363
362
|
narrow: [
|
|
364
363
|
/^j/i,
|
|
365
364
|
/^f/i,
|
|
@@ -388,18 +387,18 @@ const st = /^(\d+)(th|st|nd|rd)?/i, ut = /\d+/i, ct = {
|
|
|
388
387
|
/^n/i,
|
|
389
388
|
/^d/i
|
|
390
389
|
]
|
|
391
|
-
},
|
|
390
|
+
}, ht = {
|
|
392
391
|
narrow: /^[smtwf]/i,
|
|
393
392
|
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
394
393
|
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
395
394
|
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
396
|
-
},
|
|
395
|
+
}, ft = {
|
|
397
396
|
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
398
397
|
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
399
|
-
},
|
|
398
|
+
}, mt = {
|
|
400
399
|
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
401
400
|
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
402
|
-
},
|
|
401
|
+
}, lt = {
|
|
403
402
|
any: {
|
|
404
403
|
am: /^a/i,
|
|
405
404
|
pm: /^p/i,
|
|
@@ -410,186 +409,184 @@ const st = /^(\d+)(th|st|nd|rd)?/i, ut = /\d+/i, ct = {
|
|
|
410
409
|
evening: /evening/i,
|
|
411
410
|
night: /night/i
|
|
412
411
|
}
|
|
413
|
-
},
|
|
414
|
-
ordinalNumber:
|
|
415
|
-
matchPattern:
|
|
416
|
-
parsePattern:
|
|
417
|
-
valueCallback: (
|
|
412
|
+
}, gt = {
|
|
413
|
+
ordinalNumber: nt({
|
|
414
|
+
matchPattern: rt,
|
|
415
|
+
parsePattern: at,
|
|
416
|
+
valueCallback: (t) => parseInt(t, 10)
|
|
418
417
|
}),
|
|
419
|
-
era:
|
|
420
|
-
matchPatterns:
|
|
418
|
+
era: P({
|
|
419
|
+
matchPatterns: ot,
|
|
421
420
|
defaultMatchWidth: "wide",
|
|
422
|
-
parsePatterns:
|
|
421
|
+
parsePatterns: it,
|
|
423
422
|
defaultParseWidth: "any"
|
|
424
423
|
}),
|
|
425
|
-
quarter:
|
|
426
|
-
matchPatterns:
|
|
424
|
+
quarter: P({
|
|
425
|
+
matchPatterns: st,
|
|
427
426
|
defaultMatchWidth: "wide",
|
|
428
|
-
parsePatterns:
|
|
427
|
+
parsePatterns: ut,
|
|
429
428
|
defaultParseWidth: "any",
|
|
430
|
-
valueCallback: (
|
|
429
|
+
valueCallback: (t) => t + 1
|
|
431
430
|
}),
|
|
432
|
-
month:
|
|
433
|
-
matchPatterns:
|
|
431
|
+
month: P({
|
|
432
|
+
matchPatterns: ct,
|
|
434
433
|
defaultMatchWidth: "wide",
|
|
435
|
-
parsePatterns:
|
|
434
|
+
parsePatterns: dt,
|
|
436
435
|
defaultParseWidth: "any"
|
|
437
436
|
}),
|
|
438
|
-
day:
|
|
439
|
-
matchPatterns:
|
|
437
|
+
day: P({
|
|
438
|
+
matchPatterns: ht,
|
|
440
439
|
defaultMatchWidth: "wide",
|
|
441
|
-
parsePatterns:
|
|
440
|
+
parsePatterns: ft,
|
|
442
441
|
defaultParseWidth: "any"
|
|
443
442
|
}),
|
|
444
|
-
dayPeriod:
|
|
445
|
-
matchPatterns:
|
|
443
|
+
dayPeriod: P({
|
|
444
|
+
matchPatterns: mt,
|
|
446
445
|
defaultMatchWidth: "any",
|
|
447
|
-
parsePatterns:
|
|
446
|
+
parsePatterns: lt,
|
|
448
447
|
defaultParseWidth: "any"
|
|
449
448
|
})
|
|
450
|
-
},
|
|
449
|
+
}, wt = {
|
|
451
450
|
code: "en-US",
|
|
452
|
-
formatDistance:
|
|
453
|
-
formatLong:
|
|
454
|
-
formatRelative:
|
|
455
|
-
localize:
|
|
456
|
-
match:
|
|
451
|
+
formatDistance: L,
|
|
452
|
+
formatLong: R,
|
|
453
|
+
formatRelative: V,
|
|
454
|
+
localize: Z,
|
|
455
|
+
match: gt,
|
|
457
456
|
options: {
|
|
458
457
|
weekStartsOn: 0,
|
|
459
458
|
firstWeekContainsDate: 1
|
|
460
459
|
}
|
|
461
460
|
};
|
|
462
|
-
function
|
|
463
|
-
const
|
|
464
|
-
return
|
|
461
|
+
function yt(t, e) {
|
|
462
|
+
const n = l(t, e?.in);
|
|
463
|
+
return q(n, Q(n)) + 1;
|
|
465
464
|
}
|
|
466
|
-
function
|
|
467
|
-
const
|
|
468
|
-
return Math.round(r /
|
|
465
|
+
function bt(t, e) {
|
|
466
|
+
const n = l(t, e?.in), r = +M(n) - +H(n);
|
|
467
|
+
return Math.round(r / D) + 1;
|
|
469
468
|
}
|
|
470
|
-
function
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
return +e >= +u ? r + 1 : +e >= +d ? r : r - 1;
|
|
469
|
+
function E(t, e) {
|
|
470
|
+
const n = l(t, e?.in), r = n.getFullYear(), a = O(), o = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? a.firstWeekContainsDate ?? a.locale?.options?.firstWeekContainsDate ?? 1, s = y(e?.in || t, 0);
|
|
471
|
+
s.setFullYear(r + 1, 0, o), s.setHours(0, 0, 0, 0);
|
|
472
|
+
const c = p(s, e), h = y(e?.in || t, 0);
|
|
473
|
+
h.setFullYear(r, 0, o), h.setHours(0, 0, 0, 0);
|
|
474
|
+
const f = p(h, e);
|
|
475
|
+
return +n >= +c ? r + 1 : +n >= +f ? r : r - 1;
|
|
478
476
|
}
|
|
479
|
-
function
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
return i.setFullYear(a, 0, r), i.setHours(0, 0, 0, 0), x(i, t);
|
|
477
|
+
function Pt(t, e) {
|
|
478
|
+
const n = O(), r = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, a = E(t, e), o = y(e?.in || t, 0);
|
|
479
|
+
return o.setFullYear(a, 0, r), o.setHours(0, 0, 0, 0), p(o, e);
|
|
483
480
|
}
|
|
484
|
-
function
|
|
485
|
-
const
|
|
486
|
-
return Math.round(r /
|
|
481
|
+
function pt(t, e) {
|
|
482
|
+
const n = l(t, e?.in), r = +p(n, e) - +Pt(n, e);
|
|
483
|
+
return Math.round(r / D) + 1;
|
|
487
484
|
}
|
|
488
|
-
function
|
|
489
|
-
const
|
|
490
|
-
return
|
|
485
|
+
function i(t, e) {
|
|
486
|
+
const n = t < 0 ? "-" : "", r = Math.abs(t).toString().padStart(e, "0");
|
|
487
|
+
return n + r;
|
|
491
488
|
}
|
|
492
|
-
const
|
|
489
|
+
const m = {
|
|
493
490
|
// Year
|
|
494
|
-
y(
|
|
495
|
-
const
|
|
496
|
-
return
|
|
491
|
+
y(t, e) {
|
|
492
|
+
const n = t.getFullYear(), r = n > 0 ? n : 1 - n;
|
|
493
|
+
return i(e === "yy" ? r % 100 : r, e.length);
|
|
497
494
|
},
|
|
498
495
|
// Month
|
|
499
|
-
M(
|
|
500
|
-
const
|
|
501
|
-
return
|
|
496
|
+
M(t, e) {
|
|
497
|
+
const n = t.getMonth();
|
|
498
|
+
return e === "M" ? String(n + 1) : i(n + 1, 2);
|
|
502
499
|
},
|
|
503
500
|
// Day of the month
|
|
504
|
-
d(
|
|
505
|
-
return
|
|
501
|
+
d(t, e) {
|
|
502
|
+
return i(t.getDate(), e.length);
|
|
506
503
|
},
|
|
507
504
|
// AM or PM
|
|
508
|
-
a(
|
|
509
|
-
const
|
|
510
|
-
switch (
|
|
505
|
+
a(t, e) {
|
|
506
|
+
const n = t.getHours() / 12 >= 1 ? "pm" : "am";
|
|
507
|
+
switch (e) {
|
|
511
508
|
case "a":
|
|
512
509
|
case "aa":
|
|
513
|
-
return
|
|
510
|
+
return n.toUpperCase();
|
|
514
511
|
case "aaa":
|
|
515
|
-
return
|
|
512
|
+
return n;
|
|
516
513
|
case "aaaaa":
|
|
517
|
-
return
|
|
514
|
+
return n[0];
|
|
518
515
|
case "aaaa":
|
|
519
516
|
default:
|
|
520
|
-
return
|
|
517
|
+
return n === "am" ? "a.m." : "p.m.";
|
|
521
518
|
}
|
|
522
519
|
},
|
|
523
520
|
// Hour [1-12]
|
|
524
|
-
h(
|
|
525
|
-
return
|
|
521
|
+
h(t, e) {
|
|
522
|
+
return i(t.getHours() % 12 || 12, e.length);
|
|
526
523
|
},
|
|
527
524
|
// Hour [0-23]
|
|
528
|
-
H(
|
|
529
|
-
return
|
|
525
|
+
H(t, e) {
|
|
526
|
+
return i(t.getHours(), e.length);
|
|
530
527
|
},
|
|
531
528
|
// Minute
|
|
532
|
-
m(
|
|
533
|
-
return
|
|
529
|
+
m(t, e) {
|
|
530
|
+
return i(t.getMinutes(), e.length);
|
|
534
531
|
},
|
|
535
532
|
// Second
|
|
536
|
-
s(
|
|
537
|
-
return
|
|
533
|
+
s(t, e) {
|
|
534
|
+
return i(t.getSeconds(), e.length);
|
|
538
535
|
},
|
|
539
536
|
// Fraction of second
|
|
540
|
-
S(
|
|
541
|
-
const
|
|
542
|
-
r * Math.pow(10,
|
|
537
|
+
S(t, e) {
|
|
538
|
+
const n = e.length, r = t.getMilliseconds(), a = Math.trunc(
|
|
539
|
+
r * Math.pow(10, n - 3)
|
|
543
540
|
);
|
|
544
|
-
return
|
|
541
|
+
return i(a, e.length);
|
|
545
542
|
}
|
|
546
|
-
},
|
|
543
|
+
}, w = {
|
|
547
544
|
midnight: "midnight",
|
|
548
545
|
noon: "noon",
|
|
549
546
|
morning: "morning",
|
|
550
547
|
afternoon: "afternoon",
|
|
551
548
|
evening: "evening",
|
|
552
549
|
night: "night"
|
|
553
|
-
},
|
|
550
|
+
}, x = {
|
|
554
551
|
// Era
|
|
555
|
-
G: function(
|
|
556
|
-
const r =
|
|
557
|
-
switch (
|
|
552
|
+
G: function(t, e, n) {
|
|
553
|
+
const r = t.getFullYear() > 0 ? 1 : 0;
|
|
554
|
+
switch (e) {
|
|
558
555
|
// AD, BC
|
|
559
556
|
case "G":
|
|
560
557
|
case "GG":
|
|
561
558
|
case "GGG":
|
|
562
|
-
return
|
|
559
|
+
return n.era(r, { width: "abbreviated" });
|
|
563
560
|
// A, B
|
|
564
561
|
case "GGGGG":
|
|
565
|
-
return
|
|
562
|
+
return n.era(r, { width: "narrow" });
|
|
566
563
|
// Anno Domini, Before Christ
|
|
567
564
|
case "GGGG":
|
|
568
565
|
default:
|
|
569
|
-
return
|
|
566
|
+
return n.era(r, { width: "wide" });
|
|
570
567
|
}
|
|
571
568
|
},
|
|
572
569
|
// Year
|
|
573
|
-
y: function(
|
|
574
|
-
if (
|
|
575
|
-
const r =
|
|
576
|
-
return
|
|
570
|
+
y: function(t, e, n) {
|
|
571
|
+
if (e === "yo") {
|
|
572
|
+
const r = t.getFullYear(), a = r > 0 ? r : 1 - r;
|
|
573
|
+
return n.ordinalNumber(a, { unit: "year" });
|
|
577
574
|
}
|
|
578
|
-
return
|
|
575
|
+
return m.y(t, e);
|
|
579
576
|
},
|
|
580
577
|
// Local week-numbering year
|
|
581
|
-
Y: function(
|
|
582
|
-
const a =
|
|
583
|
-
if (
|
|
584
|
-
const s =
|
|
585
|
-
return
|
|
578
|
+
Y: function(t, e, n, r) {
|
|
579
|
+
const a = E(t, r), o = a > 0 ? a : 1 - a;
|
|
580
|
+
if (e === "YY") {
|
|
581
|
+
const s = o % 100;
|
|
582
|
+
return i(s, 2);
|
|
586
583
|
}
|
|
587
|
-
return
|
|
584
|
+
return e === "Yo" ? n.ordinalNumber(o, { unit: "year" }) : i(o, e.length);
|
|
588
585
|
},
|
|
589
586
|
// ISO week-numbering year
|
|
590
|
-
R: function(
|
|
591
|
-
const
|
|
592
|
-
return
|
|
587
|
+
R: function(t, e) {
|
|
588
|
+
const n = T(t);
|
|
589
|
+
return i(n, e.length);
|
|
593
590
|
},
|
|
594
591
|
// Extended year. This is a single number designating the year of this calendar system.
|
|
595
592
|
// The main difference between `y` and `u` localizers are B.C. years:
|
|
@@ -600,438 +597,438 @@ const g = {
|
|
|
600
597
|
// | BC 2 | 2 | -1 |
|
|
601
598
|
// Also `yy` always returns the last two digits of a year,
|
|
602
599
|
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
603
|
-
u: function(
|
|
604
|
-
const
|
|
605
|
-
return
|
|
600
|
+
u: function(t, e) {
|
|
601
|
+
const n = t.getFullYear();
|
|
602
|
+
return i(n, e.length);
|
|
606
603
|
},
|
|
607
604
|
// Quarter
|
|
608
|
-
Q: function(
|
|
609
|
-
const r = Math.ceil((
|
|
610
|
-
switch (
|
|
605
|
+
Q: function(t, e, n) {
|
|
606
|
+
const r = Math.ceil((t.getMonth() + 1) / 3);
|
|
607
|
+
switch (e) {
|
|
611
608
|
// 1, 2, 3, 4
|
|
612
609
|
case "Q":
|
|
613
610
|
return String(r);
|
|
614
611
|
// 01, 02, 03, 04
|
|
615
612
|
case "QQ":
|
|
616
|
-
return
|
|
613
|
+
return i(r, 2);
|
|
617
614
|
// 1st, 2nd, 3rd, 4th
|
|
618
615
|
case "Qo":
|
|
619
|
-
return
|
|
616
|
+
return n.ordinalNumber(r, { unit: "quarter" });
|
|
620
617
|
// Q1, Q2, Q3, Q4
|
|
621
618
|
case "QQQ":
|
|
622
|
-
return
|
|
619
|
+
return n.quarter(r, {
|
|
623
620
|
width: "abbreviated",
|
|
624
621
|
context: "formatting"
|
|
625
622
|
});
|
|
626
623
|
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
627
624
|
case "QQQQQ":
|
|
628
|
-
return
|
|
625
|
+
return n.quarter(r, {
|
|
629
626
|
width: "narrow",
|
|
630
627
|
context: "formatting"
|
|
631
628
|
});
|
|
632
629
|
// 1st quarter, 2nd quarter, ...
|
|
633
630
|
case "QQQQ":
|
|
634
631
|
default:
|
|
635
|
-
return
|
|
632
|
+
return n.quarter(r, {
|
|
636
633
|
width: "wide",
|
|
637
634
|
context: "formatting"
|
|
638
635
|
});
|
|
639
636
|
}
|
|
640
637
|
},
|
|
641
638
|
// Stand-alone quarter
|
|
642
|
-
q: function(
|
|
643
|
-
const r = Math.ceil((
|
|
644
|
-
switch (
|
|
639
|
+
q: function(t, e, n) {
|
|
640
|
+
const r = Math.ceil((t.getMonth() + 1) / 3);
|
|
641
|
+
switch (e) {
|
|
645
642
|
// 1, 2, 3, 4
|
|
646
643
|
case "q":
|
|
647
644
|
return String(r);
|
|
648
645
|
// 01, 02, 03, 04
|
|
649
646
|
case "qq":
|
|
650
|
-
return
|
|
647
|
+
return i(r, 2);
|
|
651
648
|
// 1st, 2nd, 3rd, 4th
|
|
652
649
|
case "qo":
|
|
653
|
-
return
|
|
650
|
+
return n.ordinalNumber(r, { unit: "quarter" });
|
|
654
651
|
// Q1, Q2, Q3, Q4
|
|
655
652
|
case "qqq":
|
|
656
|
-
return
|
|
653
|
+
return n.quarter(r, {
|
|
657
654
|
width: "abbreviated",
|
|
658
655
|
context: "standalone"
|
|
659
656
|
});
|
|
660
657
|
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
661
658
|
case "qqqqq":
|
|
662
|
-
return
|
|
659
|
+
return n.quarter(r, {
|
|
663
660
|
width: "narrow",
|
|
664
661
|
context: "standalone"
|
|
665
662
|
});
|
|
666
663
|
// 1st quarter, 2nd quarter, ...
|
|
667
664
|
case "qqqq":
|
|
668
665
|
default:
|
|
669
|
-
return
|
|
666
|
+
return n.quarter(r, {
|
|
670
667
|
width: "wide",
|
|
671
668
|
context: "standalone"
|
|
672
669
|
});
|
|
673
670
|
}
|
|
674
671
|
},
|
|
675
672
|
// Month
|
|
676
|
-
M: function(
|
|
677
|
-
const r =
|
|
678
|
-
switch (
|
|
673
|
+
M: function(t, e, n) {
|
|
674
|
+
const r = t.getMonth();
|
|
675
|
+
switch (e) {
|
|
679
676
|
case "M":
|
|
680
677
|
case "MM":
|
|
681
|
-
return
|
|
678
|
+
return m.M(t, e);
|
|
682
679
|
// 1st, 2nd, ..., 12th
|
|
683
680
|
case "Mo":
|
|
684
|
-
return
|
|
681
|
+
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
685
682
|
// Jan, Feb, ..., Dec
|
|
686
683
|
case "MMM":
|
|
687
|
-
return
|
|
684
|
+
return n.month(r, {
|
|
688
685
|
width: "abbreviated",
|
|
689
686
|
context: "formatting"
|
|
690
687
|
});
|
|
691
688
|
// J, F, ..., D
|
|
692
689
|
case "MMMMM":
|
|
693
|
-
return
|
|
690
|
+
return n.month(r, {
|
|
694
691
|
width: "narrow",
|
|
695
692
|
context: "formatting"
|
|
696
693
|
});
|
|
697
694
|
// January, February, ..., December
|
|
698
695
|
case "MMMM":
|
|
699
696
|
default:
|
|
700
|
-
return
|
|
697
|
+
return n.month(r, { width: "wide", context: "formatting" });
|
|
701
698
|
}
|
|
702
699
|
},
|
|
703
700
|
// Stand-alone month
|
|
704
|
-
L: function(
|
|
705
|
-
const r =
|
|
706
|
-
switch (
|
|
701
|
+
L: function(t, e, n) {
|
|
702
|
+
const r = t.getMonth();
|
|
703
|
+
switch (e) {
|
|
707
704
|
// 1, 2, ..., 12
|
|
708
705
|
case "L":
|
|
709
706
|
return String(r + 1);
|
|
710
707
|
// 01, 02, ..., 12
|
|
711
708
|
case "LL":
|
|
712
|
-
return
|
|
709
|
+
return i(r + 1, 2);
|
|
713
710
|
// 1st, 2nd, ..., 12th
|
|
714
711
|
case "Lo":
|
|
715
|
-
return
|
|
712
|
+
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
716
713
|
// Jan, Feb, ..., Dec
|
|
717
714
|
case "LLL":
|
|
718
|
-
return
|
|
715
|
+
return n.month(r, {
|
|
719
716
|
width: "abbreviated",
|
|
720
717
|
context: "standalone"
|
|
721
718
|
});
|
|
722
719
|
// J, F, ..., D
|
|
723
720
|
case "LLLLL":
|
|
724
|
-
return
|
|
721
|
+
return n.month(r, {
|
|
725
722
|
width: "narrow",
|
|
726
723
|
context: "standalone"
|
|
727
724
|
});
|
|
728
725
|
// January, February, ..., December
|
|
729
726
|
case "LLLL":
|
|
730
727
|
default:
|
|
731
|
-
return
|
|
728
|
+
return n.month(r, { width: "wide", context: "standalone" });
|
|
732
729
|
}
|
|
733
730
|
},
|
|
734
731
|
// Local week of year
|
|
735
|
-
w: function(
|
|
736
|
-
const a =
|
|
737
|
-
return
|
|
732
|
+
w: function(t, e, n, r) {
|
|
733
|
+
const a = pt(t, r);
|
|
734
|
+
return e === "wo" ? n.ordinalNumber(a, { unit: "week" }) : i(a, e.length);
|
|
738
735
|
},
|
|
739
736
|
// ISO week of year
|
|
740
|
-
I: function(
|
|
741
|
-
const r =
|
|
742
|
-
return
|
|
737
|
+
I: function(t, e, n) {
|
|
738
|
+
const r = bt(t);
|
|
739
|
+
return e === "Io" ? n.ordinalNumber(r, { unit: "week" }) : i(r, e.length);
|
|
743
740
|
},
|
|
744
741
|
// Day of the month
|
|
745
|
-
d: function(
|
|
746
|
-
return
|
|
742
|
+
d: function(t, e, n) {
|
|
743
|
+
return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) : m.d(t, e);
|
|
747
744
|
},
|
|
748
745
|
// Day of year
|
|
749
|
-
D: function(
|
|
750
|
-
const r =
|
|
751
|
-
return
|
|
746
|
+
D: function(t, e, n) {
|
|
747
|
+
const r = yt(t);
|
|
748
|
+
return e === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : i(r, e.length);
|
|
752
749
|
},
|
|
753
750
|
// Day of week
|
|
754
|
-
E: function(
|
|
755
|
-
const r =
|
|
756
|
-
switch (
|
|
751
|
+
E: function(t, e, n) {
|
|
752
|
+
const r = t.getDay();
|
|
753
|
+
switch (e) {
|
|
757
754
|
// Tue
|
|
758
755
|
case "E":
|
|
759
756
|
case "EE":
|
|
760
757
|
case "EEE":
|
|
761
|
-
return
|
|
758
|
+
return n.day(r, {
|
|
762
759
|
width: "abbreviated",
|
|
763
760
|
context: "formatting"
|
|
764
761
|
});
|
|
765
762
|
// T
|
|
766
763
|
case "EEEEE":
|
|
767
|
-
return
|
|
764
|
+
return n.day(r, {
|
|
768
765
|
width: "narrow",
|
|
769
766
|
context: "formatting"
|
|
770
767
|
});
|
|
771
768
|
// Tu
|
|
772
769
|
case "EEEEEE":
|
|
773
|
-
return
|
|
770
|
+
return n.day(r, {
|
|
774
771
|
width: "short",
|
|
775
772
|
context: "formatting"
|
|
776
773
|
});
|
|
777
774
|
// Tuesday
|
|
778
775
|
case "EEEE":
|
|
779
776
|
default:
|
|
780
|
-
return
|
|
777
|
+
return n.day(r, {
|
|
781
778
|
width: "wide",
|
|
782
779
|
context: "formatting"
|
|
783
780
|
});
|
|
784
781
|
}
|
|
785
782
|
},
|
|
786
783
|
// Local day of week
|
|
787
|
-
e: function(
|
|
788
|
-
const a =
|
|
789
|
-
switch (
|
|
784
|
+
e: function(t, e, n, r) {
|
|
785
|
+
const a = t.getDay(), o = (a - r.weekStartsOn + 8) % 7 || 7;
|
|
786
|
+
switch (e) {
|
|
790
787
|
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
|
791
788
|
case "e":
|
|
792
|
-
return String(
|
|
789
|
+
return String(o);
|
|
793
790
|
// Padded numerical value
|
|
794
791
|
case "ee":
|
|
795
|
-
return o
|
|
792
|
+
return i(o, 2);
|
|
796
793
|
// 1st, 2nd, ..., 7th
|
|
797
794
|
case "eo":
|
|
798
|
-
return
|
|
795
|
+
return n.ordinalNumber(o, { unit: "day" });
|
|
799
796
|
case "eee":
|
|
800
|
-
return
|
|
797
|
+
return n.day(a, {
|
|
801
798
|
width: "abbreviated",
|
|
802
799
|
context: "formatting"
|
|
803
800
|
});
|
|
804
801
|
// T
|
|
805
802
|
case "eeeee":
|
|
806
|
-
return
|
|
803
|
+
return n.day(a, {
|
|
807
804
|
width: "narrow",
|
|
808
805
|
context: "formatting"
|
|
809
806
|
});
|
|
810
807
|
// Tu
|
|
811
808
|
case "eeeeee":
|
|
812
|
-
return
|
|
809
|
+
return n.day(a, {
|
|
813
810
|
width: "short",
|
|
814
811
|
context: "formatting"
|
|
815
812
|
});
|
|
816
813
|
// Tuesday
|
|
817
814
|
case "eeee":
|
|
818
815
|
default:
|
|
819
|
-
return
|
|
816
|
+
return n.day(a, {
|
|
820
817
|
width: "wide",
|
|
821
818
|
context: "formatting"
|
|
822
819
|
});
|
|
823
820
|
}
|
|
824
821
|
},
|
|
825
822
|
// Stand-alone local day of week
|
|
826
|
-
c: function(
|
|
827
|
-
const a =
|
|
828
|
-
switch (
|
|
823
|
+
c: function(t, e, n, r) {
|
|
824
|
+
const a = t.getDay(), o = (a - r.weekStartsOn + 8) % 7 || 7;
|
|
825
|
+
switch (e) {
|
|
829
826
|
// Numerical value (same as in `e`)
|
|
830
827
|
case "c":
|
|
831
|
-
return String(
|
|
828
|
+
return String(o);
|
|
832
829
|
// Padded numerical value
|
|
833
830
|
case "cc":
|
|
834
|
-
return o
|
|
831
|
+
return i(o, e.length);
|
|
835
832
|
// 1st, 2nd, ..., 7th
|
|
836
833
|
case "co":
|
|
837
|
-
return
|
|
834
|
+
return n.ordinalNumber(o, { unit: "day" });
|
|
838
835
|
case "ccc":
|
|
839
|
-
return
|
|
836
|
+
return n.day(a, {
|
|
840
837
|
width: "abbreviated",
|
|
841
838
|
context: "standalone"
|
|
842
839
|
});
|
|
843
840
|
// T
|
|
844
841
|
case "ccccc":
|
|
845
|
-
return
|
|
842
|
+
return n.day(a, {
|
|
846
843
|
width: "narrow",
|
|
847
844
|
context: "standalone"
|
|
848
845
|
});
|
|
849
846
|
// Tu
|
|
850
847
|
case "cccccc":
|
|
851
|
-
return
|
|
848
|
+
return n.day(a, {
|
|
852
849
|
width: "short",
|
|
853
850
|
context: "standalone"
|
|
854
851
|
});
|
|
855
852
|
// Tuesday
|
|
856
853
|
case "cccc":
|
|
857
854
|
default:
|
|
858
|
-
return
|
|
855
|
+
return n.day(a, {
|
|
859
856
|
width: "wide",
|
|
860
857
|
context: "standalone"
|
|
861
858
|
});
|
|
862
859
|
}
|
|
863
860
|
},
|
|
864
861
|
// ISO day of week
|
|
865
|
-
i: function(
|
|
866
|
-
const r =
|
|
867
|
-
switch (
|
|
862
|
+
i: function(t, e, n) {
|
|
863
|
+
const r = t.getDay(), a = r === 0 ? 7 : r;
|
|
864
|
+
switch (e) {
|
|
868
865
|
// 2
|
|
869
866
|
case "i":
|
|
870
867
|
return String(a);
|
|
871
868
|
// 02
|
|
872
869
|
case "ii":
|
|
873
|
-
return
|
|
870
|
+
return i(a, e.length);
|
|
874
871
|
// 2nd
|
|
875
872
|
case "io":
|
|
876
|
-
return
|
|
873
|
+
return n.ordinalNumber(a, { unit: "day" });
|
|
877
874
|
// Tue
|
|
878
875
|
case "iii":
|
|
879
|
-
return
|
|
876
|
+
return n.day(r, {
|
|
880
877
|
width: "abbreviated",
|
|
881
878
|
context: "formatting"
|
|
882
879
|
});
|
|
883
880
|
// T
|
|
884
881
|
case "iiiii":
|
|
885
|
-
return
|
|
882
|
+
return n.day(r, {
|
|
886
883
|
width: "narrow",
|
|
887
884
|
context: "formatting"
|
|
888
885
|
});
|
|
889
886
|
// Tu
|
|
890
887
|
case "iiiiii":
|
|
891
|
-
return
|
|
888
|
+
return n.day(r, {
|
|
892
889
|
width: "short",
|
|
893
890
|
context: "formatting"
|
|
894
891
|
});
|
|
895
892
|
// Tuesday
|
|
896
893
|
case "iiii":
|
|
897
894
|
default:
|
|
898
|
-
return
|
|
895
|
+
return n.day(r, {
|
|
899
896
|
width: "wide",
|
|
900
897
|
context: "formatting"
|
|
901
898
|
});
|
|
902
899
|
}
|
|
903
900
|
},
|
|
904
901
|
// AM or PM
|
|
905
|
-
a: function(
|
|
906
|
-
const a =
|
|
907
|
-
switch (
|
|
902
|
+
a: function(t, e, n) {
|
|
903
|
+
const a = t.getHours() / 12 >= 1 ? "pm" : "am";
|
|
904
|
+
switch (e) {
|
|
908
905
|
case "a":
|
|
909
906
|
case "aa":
|
|
910
|
-
return
|
|
907
|
+
return n.dayPeriod(a, {
|
|
911
908
|
width: "abbreviated",
|
|
912
909
|
context: "formatting"
|
|
913
910
|
});
|
|
914
911
|
case "aaa":
|
|
915
|
-
return
|
|
912
|
+
return n.dayPeriod(a, {
|
|
916
913
|
width: "abbreviated",
|
|
917
914
|
context: "formatting"
|
|
918
915
|
}).toLowerCase();
|
|
919
916
|
case "aaaaa":
|
|
920
|
-
return
|
|
917
|
+
return n.dayPeriod(a, {
|
|
921
918
|
width: "narrow",
|
|
922
919
|
context: "formatting"
|
|
923
920
|
});
|
|
924
921
|
case "aaaa":
|
|
925
922
|
default:
|
|
926
|
-
return
|
|
923
|
+
return n.dayPeriod(a, {
|
|
927
924
|
width: "wide",
|
|
928
925
|
context: "formatting"
|
|
929
926
|
});
|
|
930
927
|
}
|
|
931
928
|
},
|
|
932
929
|
// AM, PM, midnight, noon
|
|
933
|
-
b: function(
|
|
934
|
-
const r =
|
|
930
|
+
b: function(t, e, n) {
|
|
931
|
+
const r = t.getHours();
|
|
935
932
|
let a;
|
|
936
|
-
switch (r === 12 ? a =
|
|
933
|
+
switch (r === 12 ? a = w.noon : r === 0 ? a = w.midnight : a = r / 12 >= 1 ? "pm" : "am", e) {
|
|
937
934
|
case "b":
|
|
938
935
|
case "bb":
|
|
939
|
-
return
|
|
936
|
+
return n.dayPeriod(a, {
|
|
940
937
|
width: "abbreviated",
|
|
941
938
|
context: "formatting"
|
|
942
939
|
});
|
|
943
940
|
case "bbb":
|
|
944
|
-
return
|
|
941
|
+
return n.dayPeriod(a, {
|
|
945
942
|
width: "abbreviated",
|
|
946
943
|
context: "formatting"
|
|
947
944
|
}).toLowerCase();
|
|
948
945
|
case "bbbbb":
|
|
949
|
-
return
|
|
946
|
+
return n.dayPeriod(a, {
|
|
950
947
|
width: "narrow",
|
|
951
948
|
context: "formatting"
|
|
952
949
|
});
|
|
953
950
|
case "bbbb":
|
|
954
951
|
default:
|
|
955
|
-
return
|
|
952
|
+
return n.dayPeriod(a, {
|
|
956
953
|
width: "wide",
|
|
957
954
|
context: "formatting"
|
|
958
955
|
});
|
|
959
956
|
}
|
|
960
957
|
},
|
|
961
958
|
// in the morning, in the afternoon, in the evening, at night
|
|
962
|
-
B: function(
|
|
963
|
-
const r =
|
|
959
|
+
B: function(t, e, n) {
|
|
960
|
+
const r = t.getHours();
|
|
964
961
|
let a;
|
|
965
|
-
switch (r >= 17 ? a =
|
|
962
|
+
switch (r >= 17 ? a = w.evening : r >= 12 ? a = w.afternoon : r >= 4 ? a = w.morning : a = w.night, e) {
|
|
966
963
|
case "B":
|
|
967
964
|
case "BB":
|
|
968
965
|
case "BBB":
|
|
969
|
-
return
|
|
966
|
+
return n.dayPeriod(a, {
|
|
970
967
|
width: "abbreviated",
|
|
971
968
|
context: "formatting"
|
|
972
969
|
});
|
|
973
970
|
case "BBBBB":
|
|
974
|
-
return
|
|
971
|
+
return n.dayPeriod(a, {
|
|
975
972
|
width: "narrow",
|
|
976
973
|
context: "formatting"
|
|
977
974
|
});
|
|
978
975
|
case "BBBB":
|
|
979
976
|
default:
|
|
980
|
-
return
|
|
977
|
+
return n.dayPeriod(a, {
|
|
981
978
|
width: "wide",
|
|
982
979
|
context: "formatting"
|
|
983
980
|
});
|
|
984
981
|
}
|
|
985
982
|
},
|
|
986
983
|
// Hour [1-12]
|
|
987
|
-
h: function(
|
|
988
|
-
if (
|
|
989
|
-
let r =
|
|
990
|
-
return r === 0 && (r = 12),
|
|
984
|
+
h: function(t, e, n) {
|
|
985
|
+
if (e === "ho") {
|
|
986
|
+
let r = t.getHours() % 12;
|
|
987
|
+
return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
|
|
991
988
|
}
|
|
992
|
-
return
|
|
989
|
+
return m.h(t, e);
|
|
993
990
|
},
|
|
994
991
|
// Hour [0-23]
|
|
995
|
-
H: function(
|
|
996
|
-
return
|
|
992
|
+
H: function(t, e, n) {
|
|
993
|
+
return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) : m.H(t, e);
|
|
997
994
|
},
|
|
998
995
|
// Hour [0-11]
|
|
999
|
-
K: function(
|
|
1000
|
-
const r =
|
|
1001
|
-
return
|
|
996
|
+
K: function(t, e, n) {
|
|
997
|
+
const r = t.getHours() % 12;
|
|
998
|
+
return e === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : i(r, e.length);
|
|
1002
999
|
},
|
|
1003
1000
|
// Hour [1-24]
|
|
1004
|
-
k: function(
|
|
1005
|
-
let r =
|
|
1006
|
-
return r === 0 && (r = 24),
|
|
1001
|
+
k: function(t, e, n) {
|
|
1002
|
+
let r = t.getHours();
|
|
1003
|
+
return r === 0 && (r = 24), e === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : i(r, e.length);
|
|
1007
1004
|
},
|
|
1008
1005
|
// Minute
|
|
1009
|
-
m: function(
|
|
1010
|
-
return
|
|
1006
|
+
m: function(t, e, n) {
|
|
1007
|
+
return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) : m.m(t, e);
|
|
1011
1008
|
},
|
|
1012
1009
|
// Second
|
|
1013
|
-
s: function(
|
|
1014
|
-
return
|
|
1010
|
+
s: function(t, e, n) {
|
|
1011
|
+
return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) : m.s(t, e);
|
|
1015
1012
|
},
|
|
1016
1013
|
// Fraction of second
|
|
1017
|
-
S: function(
|
|
1018
|
-
return
|
|
1014
|
+
S: function(t, e) {
|
|
1015
|
+
return m.S(t, e);
|
|
1019
1016
|
},
|
|
1020
1017
|
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1021
|
-
X: function(
|
|
1022
|
-
const r =
|
|
1018
|
+
X: function(t, e, n) {
|
|
1019
|
+
const r = t.getTimezoneOffset();
|
|
1023
1020
|
if (r === 0)
|
|
1024
1021
|
return "Z";
|
|
1025
|
-
switch (
|
|
1022
|
+
switch (e) {
|
|
1026
1023
|
// Hours and optional minutes
|
|
1027
1024
|
case "X":
|
|
1028
|
-
return
|
|
1025
|
+
return S(r);
|
|
1029
1026
|
// Hours, minutes and optional seconds without `:` delimiter
|
|
1030
1027
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1031
1028
|
// so this token always has the same output as `XX`
|
|
1032
1029
|
case "XXXX":
|
|
1033
1030
|
case "XX":
|
|
1034
|
-
return
|
|
1031
|
+
return g(r);
|
|
1035
1032
|
// Hours, minutes and optional seconds with `:` delimiter
|
|
1036
1033
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1037
1034
|
// so this token always has the same output as `XXX`
|
|
@@ -1039,22 +1036,22 @@ const g = {
|
|
|
1039
1036
|
case "XXX":
|
|
1040
1037
|
// Hours and minutes with `:` delimiter
|
|
1041
1038
|
default:
|
|
1042
|
-
return
|
|
1039
|
+
return g(r, ":");
|
|
1043
1040
|
}
|
|
1044
1041
|
},
|
|
1045
1042
|
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
1046
|
-
x: function(
|
|
1047
|
-
const r =
|
|
1048
|
-
switch (
|
|
1043
|
+
x: function(t, e, n) {
|
|
1044
|
+
const r = t.getTimezoneOffset();
|
|
1045
|
+
switch (e) {
|
|
1049
1046
|
// Hours and optional minutes
|
|
1050
1047
|
case "x":
|
|
1051
|
-
return
|
|
1048
|
+
return S(r);
|
|
1052
1049
|
// Hours, minutes and optional seconds without `:` delimiter
|
|
1053
1050
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1054
1051
|
// so this token always has the same output as `xx`
|
|
1055
1052
|
case "xxxx":
|
|
1056
1053
|
case "xx":
|
|
1057
|
-
return
|
|
1054
|
+
return g(r);
|
|
1058
1055
|
// Hours, minutes and optional seconds with `:` delimiter
|
|
1059
1056
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1060
1057
|
// so this token always has the same output as `xxx`
|
|
@@ -1062,168 +1059,167 @@ const g = {
|
|
|
1062
1059
|
case "xxx":
|
|
1063
1060
|
// Hours and minutes with `:` delimiter
|
|
1064
1061
|
default:
|
|
1065
|
-
return
|
|
1062
|
+
return g(r, ":");
|
|
1066
1063
|
}
|
|
1067
1064
|
},
|
|
1068
1065
|
// Timezone (GMT)
|
|
1069
|
-
O: function(
|
|
1070
|
-
const r =
|
|
1071
|
-
switch (
|
|
1066
|
+
O: function(t, e, n) {
|
|
1067
|
+
const r = t.getTimezoneOffset();
|
|
1068
|
+
switch (e) {
|
|
1072
1069
|
// Short
|
|
1073
1070
|
case "O":
|
|
1074
1071
|
case "OO":
|
|
1075
1072
|
case "OOO":
|
|
1076
|
-
return "GMT" +
|
|
1073
|
+
return "GMT" + W(r, ":");
|
|
1077
1074
|
// Long
|
|
1078
1075
|
case "OOOO":
|
|
1079
1076
|
default:
|
|
1080
|
-
return "GMT" +
|
|
1077
|
+
return "GMT" + g(r, ":");
|
|
1081
1078
|
}
|
|
1082
1079
|
},
|
|
1083
1080
|
// Timezone (specific non-location)
|
|
1084
|
-
z: function(
|
|
1085
|
-
const r =
|
|
1086
|
-
switch (
|
|
1081
|
+
z: function(t, e, n) {
|
|
1082
|
+
const r = t.getTimezoneOffset();
|
|
1083
|
+
switch (e) {
|
|
1087
1084
|
// Short
|
|
1088
1085
|
case "z":
|
|
1089
1086
|
case "zz":
|
|
1090
1087
|
case "zzz":
|
|
1091
|
-
return "GMT" +
|
|
1088
|
+
return "GMT" + W(r, ":");
|
|
1092
1089
|
// Long
|
|
1093
1090
|
case "zzzz":
|
|
1094
1091
|
default:
|
|
1095
|
-
return "GMT" +
|
|
1092
|
+
return "GMT" + g(r, ":");
|
|
1096
1093
|
}
|
|
1097
1094
|
},
|
|
1098
1095
|
// Seconds timestamp
|
|
1099
|
-
t: function(
|
|
1100
|
-
const r = Math.trunc(+
|
|
1101
|
-
return
|
|
1096
|
+
t: function(t, e, n) {
|
|
1097
|
+
const r = Math.trunc(+t / 1e3);
|
|
1098
|
+
return i(r, e.length);
|
|
1102
1099
|
},
|
|
1103
1100
|
// Milliseconds timestamp
|
|
1104
|
-
T: function(
|
|
1105
|
-
return
|
|
1101
|
+
T: function(t, e, n) {
|
|
1102
|
+
return i(+t, e.length);
|
|
1106
1103
|
}
|
|
1107
1104
|
};
|
|
1108
|
-
function
|
|
1109
|
-
const
|
|
1110
|
-
return
|
|
1105
|
+
function W(t, e = "") {
|
|
1106
|
+
const n = t > 0 ? "-" : "+", r = Math.abs(t), a = Math.trunc(r / 60), o = r % 60;
|
|
1107
|
+
return o === 0 ? n + String(a) : n + String(a) + e + i(o, 2);
|
|
1111
1108
|
}
|
|
1112
|
-
function
|
|
1113
|
-
return
|
|
1109
|
+
function S(t, e) {
|
|
1110
|
+
return t % 60 === 0 ? (t > 0 ? "-" : "+") + i(Math.abs(t) / 60, 2) : g(t, e);
|
|
1114
1111
|
}
|
|
1115
|
-
function
|
|
1116
|
-
const
|
|
1117
|
-
return
|
|
1112
|
+
function g(t, e = "") {
|
|
1113
|
+
const n = t > 0 ? "-" : "+", r = Math.abs(t), a = i(Math.trunc(r / 60), 2), o = i(r % 60, 2);
|
|
1114
|
+
return n + a + e + o;
|
|
1118
1115
|
}
|
|
1119
|
-
const
|
|
1120
|
-
switch (
|
|
1116
|
+
const Y = (t, e) => {
|
|
1117
|
+
switch (t) {
|
|
1121
1118
|
case "P":
|
|
1122
|
-
return
|
|
1119
|
+
return e.date({ width: "short" });
|
|
1123
1120
|
case "PP":
|
|
1124
|
-
return
|
|
1121
|
+
return e.date({ width: "medium" });
|
|
1125
1122
|
case "PPP":
|
|
1126
|
-
return
|
|
1123
|
+
return e.date({ width: "long" });
|
|
1127
1124
|
case "PPPP":
|
|
1128
1125
|
default:
|
|
1129
|
-
return
|
|
1126
|
+
return e.date({ width: "full" });
|
|
1130
1127
|
}
|
|
1131
|
-
},
|
|
1132
|
-
switch (
|
|
1128
|
+
}, F = (t, e) => {
|
|
1129
|
+
switch (t) {
|
|
1133
1130
|
case "p":
|
|
1134
|
-
return
|
|
1131
|
+
return e.time({ width: "short" });
|
|
1135
1132
|
case "pp":
|
|
1136
|
-
return
|
|
1133
|
+
return e.time({ width: "medium" });
|
|
1137
1134
|
case "ppp":
|
|
1138
|
-
return
|
|
1135
|
+
return e.time({ width: "long" });
|
|
1139
1136
|
case "pppp":
|
|
1140
1137
|
default:
|
|
1141
|
-
return
|
|
1138
|
+
return e.time({ width: "full" });
|
|
1142
1139
|
}
|
|
1143
|
-
},
|
|
1144
|
-
const
|
|
1140
|
+
}, Mt = (t, e) => {
|
|
1141
|
+
const n = t.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
|
|
1145
1142
|
if (!a)
|
|
1146
|
-
return
|
|
1147
|
-
let
|
|
1143
|
+
return Y(t, e);
|
|
1144
|
+
let o;
|
|
1148
1145
|
switch (r) {
|
|
1149
1146
|
case "P":
|
|
1150
|
-
|
|
1147
|
+
o = e.dateTime({ width: "short" });
|
|
1151
1148
|
break;
|
|
1152
1149
|
case "PP":
|
|
1153
|
-
|
|
1150
|
+
o = e.dateTime({ width: "medium" });
|
|
1154
1151
|
break;
|
|
1155
1152
|
case "PPP":
|
|
1156
|
-
|
|
1153
|
+
o = e.dateTime({ width: "long" });
|
|
1157
1154
|
break;
|
|
1158
1155
|
case "PPPP":
|
|
1159
1156
|
default:
|
|
1160
|
-
|
|
1157
|
+
o = e.dateTime({ width: "full" });
|
|
1161
1158
|
break;
|
|
1162
1159
|
}
|
|
1163
|
-
return
|
|
1164
|
-
},
|
|
1165
|
-
p:
|
|
1166
|
-
P:
|
|
1167
|
-
},
|
|
1168
|
-
function
|
|
1169
|
-
return
|
|
1160
|
+
return o.replace("{{date}}", Y(r, e)).replace("{{time}}", F(a, e));
|
|
1161
|
+
}, Ot = {
|
|
1162
|
+
p: F,
|
|
1163
|
+
P: Mt
|
|
1164
|
+
}, vt = /^D+$/, kt = /^Y+$/, xt = ["D", "DD", "YY", "YYYY"];
|
|
1165
|
+
function Wt(t) {
|
|
1166
|
+
return vt.test(t);
|
|
1170
1167
|
}
|
|
1171
|
-
function
|
|
1172
|
-
return
|
|
1168
|
+
function St(t) {
|
|
1169
|
+
return kt.test(t);
|
|
1173
1170
|
}
|
|
1174
|
-
function
|
|
1175
|
-
const r =
|
|
1176
|
-
if (console.warn(r),
|
|
1171
|
+
function Yt(t, e, n) {
|
|
1172
|
+
const r = Dt(t, e, n);
|
|
1173
|
+
if (console.warn(r), xt.includes(t)) throw new RangeError(r);
|
|
1177
1174
|
}
|
|
1178
|
-
function
|
|
1179
|
-
const r =
|
|
1180
|
-
return `Use \`${
|
|
1175
|
+
function Dt(t, e, n) {
|
|
1176
|
+
const r = t[0] === "Y" ? "years" : "days of the month";
|
|
1177
|
+
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`;
|
|
1181
1178
|
}
|
|
1182
|
-
const
|
|
1183
|
-
function
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
if (!L(u))
|
|
1179
|
+
const Tt = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Et = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Ft = /^'([^]*?)'?$/, qt = /''/g, Ct = /[a-zA-Z]/;
|
|
1180
|
+
function Xt(t, e, n) {
|
|
1181
|
+
const r = O(), a = r.locale ?? wt, o = r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, s = r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, c = l(t, n?.in);
|
|
1182
|
+
if (!C(c))
|
|
1187
1183
|
throw new RangeError("Invalid time value");
|
|
1188
|
-
let
|
|
1189
|
-
const
|
|
1190
|
-
if (
|
|
1191
|
-
const
|
|
1192
|
-
return
|
|
1184
|
+
let h = e.match(Et).map((d) => {
|
|
1185
|
+
const u = d[0];
|
|
1186
|
+
if (u === "p" || u === "P") {
|
|
1187
|
+
const v = Ot[u];
|
|
1188
|
+
return v(d, a.formatLong);
|
|
1193
1189
|
}
|
|
1194
|
-
return
|
|
1195
|
-
}).join("").match(
|
|
1196
|
-
if (
|
|
1190
|
+
return d;
|
|
1191
|
+
}).join("").match(Tt).map((d) => {
|
|
1192
|
+
if (d === "''")
|
|
1197
1193
|
return { isToken: !1, value: "'" };
|
|
1198
|
-
const
|
|
1199
|
-
if (
|
|
1200
|
-
return { isToken: !1, value:
|
|
1201
|
-
if (
|
|
1202
|
-
return { isToken: !0, value:
|
|
1203
|
-
if (
|
|
1194
|
+
const u = d[0];
|
|
1195
|
+
if (u === "'")
|
|
1196
|
+
return { isToken: !1, value: Nt(d) };
|
|
1197
|
+
if (x[u])
|
|
1198
|
+
return { isToken: !0, value: d };
|
|
1199
|
+
if (u.match(Ct))
|
|
1204
1200
|
throw new RangeError(
|
|
1205
|
-
"Format string contains an unescaped latin alphabet character `" +
|
|
1201
|
+
"Format string contains an unescaped latin alphabet character `" + u + "`"
|
|
1206
1202
|
);
|
|
1207
|
-
return { isToken: !1, value:
|
|
1203
|
+
return { isToken: !1, value: d };
|
|
1208
1204
|
});
|
|
1209
|
-
a.localize.preprocessor && (
|
|
1210
|
-
const
|
|
1211
|
-
firstWeekContainsDate:
|
|
1205
|
+
a.localize.preprocessor && (h = a.localize.preprocessor(c, h));
|
|
1206
|
+
const f = {
|
|
1207
|
+
firstWeekContainsDate: o,
|
|
1212
1208
|
weekStartsOn: s,
|
|
1213
1209
|
locale: a
|
|
1214
1210
|
};
|
|
1215
|
-
return
|
|
1216
|
-
if (!
|
|
1217
|
-
const
|
|
1218
|
-
(
|
|
1219
|
-
const
|
|
1220
|
-
return
|
|
1211
|
+
return h.map((d) => {
|
|
1212
|
+
if (!d.isToken) return d.value;
|
|
1213
|
+
const u = d.value;
|
|
1214
|
+
(St(u) || Wt(u)) && Yt(u, e, String(t));
|
|
1215
|
+
const v = x[u[0]];
|
|
1216
|
+
return v(c, u, a.localize, f);
|
|
1221
1217
|
}).join("");
|
|
1222
1218
|
}
|
|
1223
|
-
function
|
|
1224
|
-
const
|
|
1225
|
-
return
|
|
1219
|
+
function Nt(t) {
|
|
1220
|
+
const e = t.match(Ft);
|
|
1221
|
+
return e ? e[1].replace(qt, "'") : t;
|
|
1226
1222
|
}
|
|
1227
1223
|
export {
|
|
1228
|
-
|
|
1224
|
+
Xt as f
|
|
1229
1225
|
};
|