rrule-temporal 1.0.0 → 1.1.0
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/README.md +108 -6
- package/dist/chunk-6VZV7PDA.js +1252 -0
- package/dist/index.cjs +88 -51
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +1 -1
- package/dist/totext.cjs +544 -84
- package/dist/totext.js +456 -33
- package/package.json +3 -2
package/dist/totext.cjs
CHANGED
|
@@ -2,7 +2,21 @@
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __spreadValues = (a, b) => {
|
|
10
|
+
for (var prop in b || (b = {}))
|
|
11
|
+
if (__hasOwnProp.call(b, prop))
|
|
12
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13
|
+
if (__getOwnPropSymbols)
|
|
14
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
+
if (__propIsEnum.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
}
|
|
18
|
+
return a;
|
|
19
|
+
};
|
|
6
20
|
var __export = (target, all) => {
|
|
7
21
|
for (var name in all)
|
|
8
22
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -34,9 +48,7 @@ function parseDateValues(dateValues, tzid) {
|
|
|
34
48
|
for (const dateValue of dateValues) {
|
|
35
49
|
if (/Z$/.test(dateValue)) {
|
|
36
50
|
const iso = `${dateValue.slice(0, 4)}-${dateValue.slice(4, 6)}-${dateValue.slice(6, 8)}T${dateValue.slice(9, 15)}Z`;
|
|
37
|
-
dates.push(import_polyfill.Temporal.Instant.from(iso).toZonedDateTimeISO(
|
|
38
|
-
tzid || "UTC"
|
|
39
|
-
));
|
|
51
|
+
dates.push(import_polyfill.Temporal.Instant.from(iso).toZonedDateTimeISO(tzid || "UTC"));
|
|
40
52
|
} else {
|
|
41
53
|
const isoDate = `${dateValue.slice(0, 4)}-${dateValue.slice(4, 6)}-${dateValue.slice(6, 8)}T${dateValue.slice(9)}`;
|
|
42
54
|
dates.push(import_polyfill.Temporal.PlainDateTime.from(isoDate).toZonedDateTime(tzid));
|
|
@@ -44,24 +56,24 @@ function parseDateValues(dateValues, tzid) {
|
|
|
44
56
|
}
|
|
45
57
|
return dates;
|
|
46
58
|
}
|
|
47
|
-
function parseRRuleString(input,
|
|
48
|
-
|
|
59
|
+
function parseRRuleString(input, targetTimezone) {
|
|
60
|
+
var _a, _b;
|
|
61
|
+
const unfoldedInput = unfoldLine(input).trim();
|
|
49
62
|
let dtstart;
|
|
50
63
|
let tzid = "UTC";
|
|
51
64
|
let rruleLine;
|
|
52
65
|
let exDate = [];
|
|
53
66
|
let rDate = [];
|
|
54
67
|
if (/^DTSTART/mi.test(unfoldedInput)) {
|
|
55
|
-
const lines = unfoldedInput.split(/\
|
|
68
|
+
const lines = unfoldedInput.split(/\s+/);
|
|
56
69
|
const dtLine = lines[0];
|
|
57
70
|
const rrLine = lines.find((line) => line.match(/^RRULE:/i));
|
|
58
71
|
const exLines = lines.filter((line) => line.match(/^EXDATE/i));
|
|
59
72
|
const rLines = lines.filter((line) => line.match(/^RDATE/i));
|
|
60
|
-
const m = dtLine
|
|
73
|
+
const m = dtLine == null ? void 0 : dtLine.match(/DTSTART(?:;TZID=([^:]+))?:(\d{8}T\d{6}Z?)/i);
|
|
61
74
|
if (!m) throw new Error("Invalid DTSTART in ICS snippet");
|
|
62
|
-
tzid = m[1]
|
|
63
|
-
|
|
64
|
-
dtstart = import_polyfill.Temporal.PlainDateTime.from(isoDate).toZonedDateTime(tzid);
|
|
75
|
+
tzid = (_b = (_a = m[1]) != null ? _a : targetTimezone) != null ? _b : tzid;
|
|
76
|
+
dtstart = parseDateValues([m[2]], tzid)[0];
|
|
65
77
|
rruleLine = rrLine;
|
|
66
78
|
for (const exLine of exLines) {
|
|
67
79
|
const exMatch = exLine.match(/EXDATE(?:;TZID=([^:]+))?:(.+)/i);
|
|
@@ -80,11 +92,7 @@ function parseRRuleString(input, fallbackDtstart) {
|
|
|
80
92
|
}
|
|
81
93
|
}
|
|
82
94
|
} else {
|
|
83
|
-
|
|
84
|
-
throw new Error("dtstart required when parsing RRULE alone");
|
|
85
|
-
dtstart = fallbackDtstart;
|
|
86
|
-
tzid = fallbackDtstart.timeZoneId;
|
|
87
|
-
rruleLine = unfoldedInput.replace(/^RRULE:/i, "RRULE:");
|
|
95
|
+
throw new Error("dtstart required when parsing RRULE alone");
|
|
88
96
|
}
|
|
89
97
|
const parts = rruleLine ? rruleLine.replace(/^RRULE:/i, "").split(";") : [];
|
|
90
98
|
const opts = {
|
|
@@ -155,19 +163,16 @@ function parseRRuleString(input, fallbackDtstart) {
|
|
|
155
163
|
return opts;
|
|
156
164
|
}
|
|
157
165
|
var RRuleTemporal = class {
|
|
158
|
-
tzid;
|
|
159
|
-
originalDtstart;
|
|
160
|
-
opts;
|
|
161
|
-
maxIterations;
|
|
162
|
-
includeDtstart;
|
|
163
166
|
constructor(params) {
|
|
167
|
+
var _a, _b, _c, _d, _e;
|
|
164
168
|
let manual;
|
|
165
169
|
if ("rruleString" in params) {
|
|
166
|
-
|
|
167
|
-
this.tzid =
|
|
168
|
-
this.originalDtstart =
|
|
170
|
+
const parsed = parseRRuleString(params.rruleString, params.tzid);
|
|
171
|
+
this.tzid = (_b = (_a = parsed.tzid) != null ? _a : params.tzid) != null ? _b : "UTC";
|
|
172
|
+
this.originalDtstart = parsed.dtstart;
|
|
173
|
+
manual = __spreadValues(__spreadValues({}, params), parsed);
|
|
169
174
|
} else {
|
|
170
|
-
manual = {
|
|
175
|
+
manual = __spreadValues({}, params);
|
|
171
176
|
if (typeof manual.dtstart === "string") {
|
|
172
177
|
throw new Error("Manual dtstart must be a ZonedDateTime");
|
|
173
178
|
}
|
|
@@ -176,7 +181,7 @@ var RRuleTemporal = class {
|
|
|
176
181
|
this.originalDtstart = manual.dtstart;
|
|
177
182
|
}
|
|
178
183
|
if (!manual.freq) throw new Error("RRULE must include FREQ");
|
|
179
|
-
manual.interval = manual.interval
|
|
184
|
+
manual.interval = (_c = manual.interval) != null ? _c : 1;
|
|
180
185
|
if (manual.interval <= 0) {
|
|
181
186
|
throw new Error("Cannot create RRule: interval must be greater than 0");
|
|
182
187
|
}
|
|
@@ -184,8 +189,8 @@ var RRuleTemporal = class {
|
|
|
184
189
|
throw new Error("Manual until must be a ZonedDateTime");
|
|
185
190
|
}
|
|
186
191
|
this.opts = this.sanitizeOpts(manual);
|
|
187
|
-
this.maxIterations = manual.maxIterations
|
|
188
|
-
this.includeDtstart = manual.includeDtstart
|
|
192
|
+
this.maxIterations = (_d = manual.maxIterations) != null ? _d : 1e4;
|
|
193
|
+
this.includeDtstart = (_e = manual.includeDtstart) != null ? _e : false;
|
|
189
194
|
}
|
|
190
195
|
sanitizeOpts(opts) {
|
|
191
196
|
const validDay = /^([+-]?\d{1,2})?(MO|TU|WE|TH|FR|SA|SU)$/;
|
|
@@ -253,9 +258,10 @@ var RRuleTemporal = class {
|
|
|
253
258
|
* present the original date is returned unchanged.
|
|
254
259
|
*/
|
|
255
260
|
expandByTime(base) {
|
|
256
|
-
|
|
257
|
-
const
|
|
258
|
-
const
|
|
261
|
+
var _a, _b, _c;
|
|
262
|
+
const hours = (_a = this.opts.byHour) != null ? _a : [base.hour];
|
|
263
|
+
const minutes = (_b = this.opts.byMinute) != null ? _b : [base.minute];
|
|
264
|
+
const seconds = (_c = this.opts.bySecond) != null ? _c : [base.second];
|
|
259
265
|
const out = [];
|
|
260
266
|
for (const h of hours) {
|
|
261
267
|
for (const m of minutes) {
|
|
@@ -329,8 +335,9 @@ var RRuleTemporal = class {
|
|
|
329
335
|
return dt;
|
|
330
336
|
}
|
|
331
337
|
computeFirst() {
|
|
338
|
+
var _a;
|
|
332
339
|
let zdt = this.originalDtstart;
|
|
333
|
-
if (this.opts.byDay
|
|
340
|
+
if ((_a = this.opts.byDay) == null ? void 0 : _a.length) {
|
|
334
341
|
const dayMap = {
|
|
335
342
|
MO: 1,
|
|
336
343
|
TU: 2,
|
|
@@ -347,7 +354,8 @@ var RRuleTemporal = class {
|
|
|
347
354
|
);
|
|
348
355
|
} else {
|
|
349
356
|
deltas = this.opts.byDay.map((tok) => {
|
|
350
|
-
|
|
357
|
+
var _a2;
|
|
358
|
+
const wdTok = (_a2 = tok.match(/(MO|TU|WE|TH|FR|SA|SU)$/)) == null ? void 0 : _a2[1];
|
|
351
359
|
return wdTok ? (dayMap[wdTok] - zdt.dayOfWeek + 7) % 7 : null;
|
|
352
360
|
}).filter((d) => d !== null);
|
|
353
361
|
}
|
|
@@ -369,6 +377,7 @@ var RRuleTemporal = class {
|
|
|
369
377
|
}
|
|
370
378
|
// inside class RRuleTemporal:
|
|
371
379
|
generateWeeklyOccurrences(sample) {
|
|
380
|
+
var _a;
|
|
372
381
|
const dayMap = {
|
|
373
382
|
MO: 1,
|
|
374
383
|
TU: 2,
|
|
@@ -378,7 +387,7 @@ var RRuleTemporal = class {
|
|
|
378
387
|
SA: 6,
|
|
379
388
|
SU: 7
|
|
380
389
|
};
|
|
381
|
-
const tokens = this.opts.byDay
|
|
390
|
+
const tokens = ((_a = this.opts.byDay) == null ? void 0 : _a.length) ? [...this.opts.byDay] : [Object.entries(dayMap).find(([, d]) => d === sample.dayOfWeek)[0]];
|
|
382
391
|
const occs = tokens.flatMap((tok) => {
|
|
383
392
|
const targetDow = dayMap[tok];
|
|
384
393
|
const delta = (targetDow - sample.dayOfWeek + 7) % 7;
|
|
@@ -451,7 +460,7 @@ var RRuleTemporal = class {
|
|
|
451
460
|
const { byWeekNo, wkst } = this.opts;
|
|
452
461
|
if (!byWeekNo) return true;
|
|
453
462
|
const dayMap = { MO: 1, TU: 2, WE: 3, TH: 4, FR: 5, SA: 6, SU: 7 };
|
|
454
|
-
const startDow = dayMap[wkst
|
|
463
|
+
const startDow = dayMap[wkst != null ? wkst : "MO"];
|
|
455
464
|
const jan1 = zdt.with({ month: 1, day: 1 });
|
|
456
465
|
const delta = (jan1.dayOfWeek - startDow + 7) % 7;
|
|
457
466
|
const firstWeekStart = jan1.subtract({ days: delta });
|
|
@@ -470,6 +479,7 @@ var RRuleTemporal = class {
|
|
|
470
479
|
* @returns An array of Temporal.ZonedDateTime objects representing all occurrences of the rule.
|
|
471
480
|
*/
|
|
472
481
|
all(iterator) {
|
|
482
|
+
var _a;
|
|
473
483
|
if (!this.opts.count && !this.opts.until && !iterator) {
|
|
474
484
|
throw new Error("all() requires iterator when no COUNT/UNTIL");
|
|
475
485
|
}
|
|
@@ -494,7 +504,7 @@ var RRuleTemporal = class {
|
|
|
494
504
|
throw new Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`);
|
|
495
505
|
}
|
|
496
506
|
const occs = this.generateMonthlyOccurrences(monthCursor);
|
|
497
|
-
if (monthCursor.month === start.month && occs.some((o) => import_polyfill.Temporal.ZonedDateTime.compare(o, start) < 0)) {
|
|
507
|
+
if (monthCursor.month === start.month && occs.some((o) => import_polyfill.Temporal.ZonedDateTime.compare(o, start) < 0) && occs.some((o) => import_polyfill.Temporal.ZonedDateTime.compare(o, start) === 0)) {
|
|
498
508
|
monthCursor = monthCursor.add({ months: this.opts.interval });
|
|
499
509
|
continue outer_month;
|
|
500
510
|
}
|
|
@@ -545,7 +555,7 @@ var RRuleTemporal = class {
|
|
|
545
555
|
let firstOccurrence = firstWeekDates.reduce(
|
|
546
556
|
(a, b) => import_polyfill.Temporal.ZonedDateTime.compare(a, b) <= 0 ? a : b
|
|
547
557
|
);
|
|
548
|
-
const wkstDay = dayMap[this.opts.wkst || "MO"]
|
|
558
|
+
const wkstDay = (_a = dayMap[this.opts.wkst || "MO"]) != null ? _a : 1;
|
|
549
559
|
const firstOccWeekOffset = (firstOccurrence.dayOfWeek - wkstDay + 7) % 7;
|
|
550
560
|
let weekCursor = firstOccurrence.subtract({ days: firstOccWeekOffset });
|
|
551
561
|
let matchCount2 = 0;
|
|
@@ -1022,7 +1032,7 @@ var RRuleTemporal = class {
|
|
|
1022
1032
|
toString() {
|
|
1023
1033
|
const iso = this.originalDtstart.toString({ smallestUnit: "second" }).replace(/[-:]/g, "");
|
|
1024
1034
|
const dtLine = `DTSTART;TZID=${this.tzid}:${iso.slice(0, 15)}`;
|
|
1025
|
-
const
|
|
1035
|
+
const rule = [];
|
|
1026
1036
|
const {
|
|
1027
1037
|
freq,
|
|
1028
1038
|
interval,
|
|
@@ -1030,29 +1040,52 @@ var RRuleTemporal = class {
|
|
|
1030
1040
|
until,
|
|
1031
1041
|
byHour,
|
|
1032
1042
|
byMinute,
|
|
1043
|
+
bySecond,
|
|
1033
1044
|
byDay,
|
|
1034
1045
|
byMonth,
|
|
1035
|
-
byMonthDay
|
|
1046
|
+
byMonthDay,
|
|
1047
|
+
bySetPos,
|
|
1048
|
+
byWeekNo,
|
|
1049
|
+
byYearDay,
|
|
1050
|
+
wkst,
|
|
1051
|
+
rDate,
|
|
1052
|
+
exDate
|
|
1036
1053
|
} = this.opts;
|
|
1037
|
-
|
|
1038
|
-
if (interval !== 1)
|
|
1039
|
-
if (count !== void 0)
|
|
1054
|
+
rule.push(`FREQ=${freq}`);
|
|
1055
|
+
if (interval !== 1) rule.push(`INTERVAL=${interval}`);
|
|
1056
|
+
if (count !== void 0) rule.push(`COUNT=${count}`);
|
|
1040
1057
|
if (until) {
|
|
1041
1058
|
const u = until.toInstant().toString().replace(/[-:]/g, "");
|
|
1042
|
-
|
|
1043
|
-
}
|
|
1044
|
-
if (byHour)
|
|
1045
|
-
if (byMinute)
|
|
1046
|
-
if (
|
|
1047
|
-
if (
|
|
1048
|
-
if (
|
|
1049
|
-
|
|
1059
|
+
rule.push(`UNTIL=${u.slice(0, 15)}Z`);
|
|
1060
|
+
}
|
|
1061
|
+
if (byHour) rule.push(`BYHOUR=${byHour.join(",")}`);
|
|
1062
|
+
if (byMinute) rule.push(`BYMINUTE=${byMinute.join(",")}`);
|
|
1063
|
+
if (bySecond) rule.push(`BYSECOND=${bySecond.join(",")}`);
|
|
1064
|
+
if (byDay) rule.push(`BYDAY=${byDay.join(",")}`);
|
|
1065
|
+
if (byMonth) rule.push(`BYMONTH=${byMonth.join(",")}`);
|
|
1066
|
+
if (byMonthDay) rule.push(`BYMONTHDAY=${byMonthDay.join(",")}`);
|
|
1067
|
+
if (bySetPos) rule.push(`BYSETPOS=${bySetPos.join(",")}`);
|
|
1068
|
+
if (byWeekNo) rule.push(`BYWEEKNO=${byWeekNo.join(",")}`);
|
|
1069
|
+
if (byYearDay) rule.push(`BYYEARDAY=${byYearDay.join(",")}`);
|
|
1070
|
+
if (wkst) rule.push(`WKST=${wkst}`);
|
|
1071
|
+
const lines = [dtLine, `RRULE:${rule.join(";")}`];
|
|
1072
|
+
if (rDate) {
|
|
1073
|
+
lines.push(`RDATE:${this.joinDates(rDate)}`);
|
|
1074
|
+
}
|
|
1075
|
+
if (exDate) {
|
|
1076
|
+
lines.push(`EXDATE:${this.joinDates(exDate)}`);
|
|
1077
|
+
}
|
|
1078
|
+
return lines.join("\n");
|
|
1079
|
+
}
|
|
1080
|
+
joinDates(dates) {
|
|
1081
|
+
return dates.map((d) => d.toInstant().toString().replace(/[-:]/g, "").slice(0, 15) + "Z");
|
|
1050
1082
|
}
|
|
1051
1083
|
/**
|
|
1052
1084
|
* Given any date in a month, return all the ZonedDateTimes in that month
|
|
1053
1085
|
* matching your opts.byDay and opts.byMonth (or the single "same day" if no BYDAY).
|
|
1054
1086
|
*/
|
|
1055
1087
|
generateMonthlyOccurrences(sample) {
|
|
1088
|
+
var _a;
|
|
1056
1089
|
const { byDay, byMonth, byMonthDay } = this.opts;
|
|
1057
1090
|
if (byMonth && !byMonth.includes(sample.month)) return [];
|
|
1058
1091
|
const lastDay = sample.with({ day: 1 }).add({ months: 1 }).subtract({ days: 1 }).day;
|
|
@@ -1088,12 +1121,12 @@ var RRuleTemporal = class {
|
|
|
1088
1121
|
let cursor = sample.with({ day: 1 });
|
|
1089
1122
|
while (cursor.month === sample.month) {
|
|
1090
1123
|
const dow = cursor.dayOfWeek;
|
|
1091
|
-
(buckets[dow]
|
|
1124
|
+
(buckets[dow] || (buckets[dow] = [])).push(cursor.day);
|
|
1092
1125
|
cursor = cursor.add({ days: 1 });
|
|
1093
1126
|
}
|
|
1094
1127
|
const byDayHits = [];
|
|
1095
1128
|
for (const { ord, wd } of tokens) {
|
|
1096
|
-
const list2 = buckets[wd]
|
|
1129
|
+
const list2 = (_a = buckets[wd]) != null ? _a : [];
|
|
1097
1130
|
if (!list2.length) continue;
|
|
1098
1131
|
if (ord === 0) {
|
|
1099
1132
|
for (const d of list2) byDayHits.push(d);
|
|
@@ -1121,6 +1154,7 @@ var RRuleTemporal = class {
|
|
|
1121
1154
|
* if BYMONTH is not specified.
|
|
1122
1155
|
*/
|
|
1123
1156
|
generateYearlyOccurrences(sample) {
|
|
1157
|
+
var _a;
|
|
1124
1158
|
const months = this.opts.byMonth ? [...this.opts.byMonth].sort((a, b) => a - b) : [this.originalDtstart.month];
|
|
1125
1159
|
let occs = [];
|
|
1126
1160
|
if (this.opts.byDay && this.opts.byDay.some((t) => /\d{2}/.test(t))) {
|
|
@@ -1184,7 +1218,10 @@ var RRuleTemporal = class {
|
|
|
1184
1218
|
const firstWeekStart = jan1.subtract({ days: delta });
|
|
1185
1219
|
const lastWeekDiff = sample.with({ month: 12, day: 31 }).toPlainDate().since(firstWeekStart.toPlainDate()).days;
|
|
1186
1220
|
const lastWeek = Math.floor(lastWeekDiff / 7) + 1;
|
|
1187
|
-
const tokens = this.opts.byDay
|
|
1221
|
+
const tokens = ((_a = this.opts.byDay) == null ? void 0 : _a.length) ? this.opts.byDay.map((tok) => {
|
|
1222
|
+
var _a2;
|
|
1223
|
+
return (_a2 = tok.match(/(MO|TU|WE|TH|FR|SA|SU)$/)) == null ? void 0 : _a2[1];
|
|
1224
|
+
}) : [this.opts.wkst || "MO"];
|
|
1188
1225
|
for (const weekNo of this.opts.byWeekNo) {
|
|
1189
1226
|
const weekIndex = weekNo > 0 ? weekNo - 1 : lastWeek + weekNo;
|
|
1190
1227
|
const weekStart = firstWeekStart.add({ weeks: weekIndex });
|
|
@@ -1257,21 +1294,443 @@ var en = {
|
|
|
1257
1294
|
"October",
|
|
1258
1295
|
"November",
|
|
1259
1296
|
"December"
|
|
1260
|
-
]
|
|
1297
|
+
],
|
|
1298
|
+
units: {
|
|
1299
|
+
year: { singular: "year", plural: "years" },
|
|
1300
|
+
month: { singular: "month", plural: "months" },
|
|
1301
|
+
week: { singular: "week", plural: "weeks" },
|
|
1302
|
+
day: { singular: "day", plural: "days" },
|
|
1303
|
+
hour: { singular: "hour", plural: "hours" },
|
|
1304
|
+
minute: { singular: "minute", plural: "minutes" },
|
|
1305
|
+
second: { singular: "second", plural: "seconds" }
|
|
1306
|
+
},
|
|
1307
|
+
words: {
|
|
1308
|
+
every: "every",
|
|
1309
|
+
weekday: "weekday",
|
|
1310
|
+
on: "on",
|
|
1311
|
+
in: "in",
|
|
1312
|
+
on_the: "on the",
|
|
1313
|
+
day_of_month: "day of the month",
|
|
1314
|
+
day_of_year: "day of the year",
|
|
1315
|
+
in_week: "in week",
|
|
1316
|
+
at: "at",
|
|
1317
|
+
at_minute: "at minute",
|
|
1318
|
+
at_second: "at second",
|
|
1319
|
+
until: "until",
|
|
1320
|
+
for: "for",
|
|
1321
|
+
time: "time",
|
|
1322
|
+
times: "times",
|
|
1323
|
+
instance: "instance",
|
|
1324
|
+
week_starts_on: "week starts on",
|
|
1325
|
+
with: "with",
|
|
1326
|
+
additional_date: "additional date",
|
|
1327
|
+
additional_dates: "additional dates",
|
|
1328
|
+
excluding: "excluding",
|
|
1329
|
+
date: "date",
|
|
1330
|
+
dates: "dates",
|
|
1331
|
+
and: "and",
|
|
1332
|
+
last: "last"
|
|
1333
|
+
},
|
|
1334
|
+
ordinal: (n) => {
|
|
1335
|
+
const abs = Math.abs(n);
|
|
1336
|
+
const suffix = abs % 10 === 1 && abs % 100 !== 11 ? "st" : abs % 10 === 2 && abs % 100 !== 12 ? "nd" : abs % 10 === 3 && abs % 100 !== 13 ? "rd" : "th";
|
|
1337
|
+
return n < 0 ? `last` : `${abs}${suffix}`;
|
|
1338
|
+
}
|
|
1339
|
+
};
|
|
1340
|
+
var es = {
|
|
1341
|
+
weekdayNames: ["lunes", "martes", "mi\xE9rcoles", "jueves", "viernes", "s\xE1bado", "domingo"],
|
|
1342
|
+
monthNames: [
|
|
1343
|
+
"enero",
|
|
1344
|
+
"febrero",
|
|
1345
|
+
"marzo",
|
|
1346
|
+
"abril",
|
|
1347
|
+
"mayo",
|
|
1348
|
+
"junio",
|
|
1349
|
+
"julio",
|
|
1350
|
+
"agosto",
|
|
1351
|
+
"septiembre",
|
|
1352
|
+
"octubre",
|
|
1353
|
+
"noviembre",
|
|
1354
|
+
"diciembre"
|
|
1355
|
+
],
|
|
1356
|
+
units: {
|
|
1357
|
+
year: { singular: "a\xF1o", plural: "a\xF1os" },
|
|
1358
|
+
month: { singular: "mes", plural: "meses" },
|
|
1359
|
+
week: { singular: "semana", plural: "semanas" },
|
|
1360
|
+
day: { singular: "d\xEDa", plural: "d\xEDas" },
|
|
1361
|
+
hour: { singular: "hora", plural: "horas" },
|
|
1362
|
+
minute: { singular: "minuto", plural: "minutos" },
|
|
1363
|
+
second: { singular: "segundo", plural: "segundos" }
|
|
1364
|
+
},
|
|
1365
|
+
words: {
|
|
1366
|
+
every: "cada",
|
|
1367
|
+
weekday: "d\xEDa de la semana",
|
|
1368
|
+
on: "en",
|
|
1369
|
+
in: "en",
|
|
1370
|
+
on_the: "el",
|
|
1371
|
+
day_of_month: "d\xEDa del mes",
|
|
1372
|
+
day_of_year: "d\xEDa del a\xF1o",
|
|
1373
|
+
in_week: "en la semana",
|
|
1374
|
+
at: "a las",
|
|
1375
|
+
at_minute: "en el minuto",
|
|
1376
|
+
at_second: "en el segundo",
|
|
1377
|
+
until: "hasta",
|
|
1378
|
+
for: "durante",
|
|
1379
|
+
time: "vez",
|
|
1380
|
+
times: "veces",
|
|
1381
|
+
instance: "ocasi\xF3n",
|
|
1382
|
+
week_starts_on: "la semana comienza el",
|
|
1383
|
+
with: "con",
|
|
1384
|
+
additional_date: "fecha adicional",
|
|
1385
|
+
additional_dates: "fechas adicionales",
|
|
1386
|
+
excluding: "excluyendo",
|
|
1387
|
+
date: "fecha",
|
|
1388
|
+
dates: "fechas",
|
|
1389
|
+
and: "y",
|
|
1390
|
+
last: "\xFAltimo"
|
|
1391
|
+
},
|
|
1392
|
+
ordinal: (n) => n < 0 ? "\xFAltimo" : `${Math.abs(n)}\xBA`
|
|
1393
|
+
};
|
|
1394
|
+
var hi = {
|
|
1395
|
+
weekdayNames: ["\u0938\u094B\u092E\u0935\u093E\u0930", "\u092E\u0902\u0917\u0932\u0935\u093E\u0930", "\u092C\u0941\u0927\u0935\u093E\u0930", "\u0917\u0941\u0930\u0941\u0935\u093E\u0930", "\u0936\u0941\u0915\u094D\u0930\u0935\u093E\u0930", "\u0936\u0928\u093F\u0935\u093E\u0930", "\u0930\u0935\u093F\u0935\u093E\u0930"],
|
|
1396
|
+
monthNames: [
|
|
1397
|
+
"\u091C\u0928\u0935\u0930\u0940",
|
|
1398
|
+
"\u092B\u0930\u0935\u0930\u0940",
|
|
1399
|
+
"\u092E\u093E\u0930\u094D\u091A",
|
|
1400
|
+
"\u0905\u092A\u094D\u0930\u0948\u0932",
|
|
1401
|
+
"\u092E\u0908",
|
|
1402
|
+
"\u091C\u0942\u0928",
|
|
1403
|
+
"\u091C\u0941\u0932\u093E\u0908",
|
|
1404
|
+
"\u0905\u0917\u0938\u094D\u0924",
|
|
1405
|
+
"\u0938\u093F\u0924\u0902\u092C\u0930",
|
|
1406
|
+
"\u0905\u0915\u094D\u091F\u0942\u092C\u0930",
|
|
1407
|
+
"\u0928\u0935\u0902\u092C\u0930",
|
|
1408
|
+
"\u0926\u093F\u0938\u0902\u092C\u0930"
|
|
1409
|
+
],
|
|
1410
|
+
units: {
|
|
1411
|
+
year: { singular: "\u0938\u093E\u0932", plural: "\u0938\u093E\u0932" },
|
|
1412
|
+
month: { singular: "\u092E\u0939\u0940\u0928\u093E", plural: "\u092E\u0939\u0940\u0928\u0947" },
|
|
1413
|
+
week: { singular: "\u0938\u092A\u094D\u0924\u093E\u0939", plural: "\u0938\u092A\u094D\u0924\u093E\u0939" },
|
|
1414
|
+
day: { singular: "\u0926\u093F\u0928", plural: "\u0926\u093F\u0928" },
|
|
1415
|
+
hour: { singular: "\u0918\u0902\u091F\u093E", plural: "\u0918\u0902\u091F\u0947" },
|
|
1416
|
+
minute: { singular: "\u092E\u093F\u0928\u091F", plural: "\u092E\u093F\u0928\u091F" },
|
|
1417
|
+
second: { singular: "\u0938\u0947\u0915\u0902\u0921", plural: "\u0938\u0947\u0915\u0902\u0921" }
|
|
1418
|
+
},
|
|
1419
|
+
words: {
|
|
1420
|
+
every: "\u0939\u0930",
|
|
1421
|
+
weekday: "\u0938\u092A\u094D\u0924\u093E\u0939 \u0915\u093E \u0926\u093F\u0928",
|
|
1422
|
+
on: "\u0915\u094B",
|
|
1423
|
+
in: "\u092E\u0947\u0902",
|
|
1424
|
+
on_the: "\u0915\u094B",
|
|
1425
|
+
day_of_month: "\u092E\u0939\u0940\u0928\u0947 \u0915\u093E \u0926\u093F\u0928",
|
|
1426
|
+
day_of_year: "\u0938\u093E\u0932 \u0915\u093E \u0926\u093F\u0928",
|
|
1427
|
+
in_week: "\u0938\u092A\u094D\u0924\u093E\u0939",
|
|
1428
|
+
at: "\u092A\u0930",
|
|
1429
|
+
at_minute: "\u092E\u093F\u0928\u091F \u092A\u0930",
|
|
1430
|
+
at_second: "\u0938\u0947\u0915\u0902\u0921 \u092A\u0930",
|
|
1431
|
+
until: "\u0924\u0915",
|
|
1432
|
+
for: "\u0915\u0947 \u0932\u093F\u090F",
|
|
1433
|
+
time: "\u092C\u093E\u0930",
|
|
1434
|
+
times: "\u092C\u093E\u0930",
|
|
1435
|
+
instance: "\u092C\u093E\u0930",
|
|
1436
|
+
week_starts_on: "\u0938\u092A\u094D\u0924\u093E\u0939 \u0936\u0941\u0930\u0942 \u0939\u094B\u0924\u093E \u0939\u0948",
|
|
1437
|
+
with: "\u0938\u093E\u0925",
|
|
1438
|
+
additional_date: "\u0905\u0924\u093F\u0930\u093F\u0915\u094D\u0924 \u0924\u093E\u0930\u0940\u0916",
|
|
1439
|
+
additional_dates: "\u0905\u0924\u093F\u0930\u093F\u0915\u094D\u0924 \u0924\u093E\u0930\u0940\u0916\u0947\u0902",
|
|
1440
|
+
excluding: "\u0915\u094B \u091B\u094B\u0921\u093C\u0915\u0930",
|
|
1441
|
+
date: "\u0924\u093E\u0930\u0940\u0916",
|
|
1442
|
+
dates: "\u0924\u093E\u0930\u0940\u0916\u0947\u0902",
|
|
1443
|
+
and: "\u0914\u0930",
|
|
1444
|
+
last: "\u0906\u0916\u093F\u0930\u0940"
|
|
1445
|
+
},
|
|
1446
|
+
ordinal: (n) => n < 0 ? "\u0906\u0916\u093F\u0930\u0940" : `${Math.abs(n)}\u0935\u093E\u0902`
|
|
1447
|
+
};
|
|
1448
|
+
var yue = {
|
|
1449
|
+
weekdayNames: ["\u661F\u671F\u4E00", "\u661F\u671F\u4E8C", "\u661F\u671F\u4E09", "\u661F\u671F\u56DB", "\u661F\u671F\u4E94", "\u661F\u671F\u516D", "\u661F\u671F\u65E5"],
|
|
1450
|
+
monthNames: [
|
|
1451
|
+
"\u4E00\u6708",
|
|
1452
|
+
"\u4E8C\u6708",
|
|
1453
|
+
"\u4E09\u6708",
|
|
1454
|
+
"\u56DB\u6708",
|
|
1455
|
+
"\u4E94\u6708",
|
|
1456
|
+
"\u516D\u6708",
|
|
1457
|
+
"\u4E03\u6708",
|
|
1458
|
+
"\u516B\u6708",
|
|
1459
|
+
"\u4E5D\u6708",
|
|
1460
|
+
"\u5341\u6708",
|
|
1461
|
+
"\u5341\u4E00\u6708",
|
|
1462
|
+
"\u5341\u4E8C\u6708"
|
|
1463
|
+
],
|
|
1464
|
+
units: {
|
|
1465
|
+
year: { singular: "\u5E74", plural: "\u5E74" },
|
|
1466
|
+
month: { singular: "\u6708", plural: "\u6708" },
|
|
1467
|
+
week: { singular: "\u9031", plural: "\u9031" },
|
|
1468
|
+
day: { singular: "\u65E5", plural: "\u65E5" },
|
|
1469
|
+
hour: { singular: "\u5C0F\u6642", plural: "\u5C0F\u6642" },
|
|
1470
|
+
minute: { singular: "\u5206\u9418", plural: "\u5206\u9418" },
|
|
1471
|
+
second: { singular: "\u79D2", plural: "\u79D2" }
|
|
1472
|
+
},
|
|
1473
|
+
words: {
|
|
1474
|
+
every: "\u6BCF",
|
|
1475
|
+
weekday: "\u5E73\u65E5",
|
|
1476
|
+
on: "\u5728",
|
|
1477
|
+
in: "\u65BC",
|
|
1478
|
+
on_the: "\u5728",
|
|
1479
|
+
day_of_month: "\u6708\u7684\u65E5\u5B50",
|
|
1480
|
+
day_of_year: "\u5E74\u7684\u65E5\u5B50",
|
|
1481
|
+
in_week: "\u7B2C",
|
|
1482
|
+
at: "\u5728",
|
|
1483
|
+
at_minute: "\u5728\u7B2C",
|
|
1484
|
+
at_second: "\u5728\u7B2C",
|
|
1485
|
+
until: "\u76F4\u5230",
|
|
1486
|
+
for: "\u5171",
|
|
1487
|
+
time: "\u6B21",
|
|
1488
|
+
times: "\u6B21",
|
|
1489
|
+
instance: "\u6B21",
|
|
1490
|
+
week_starts_on: "\u661F\u671F\u958B\u59CB\u65BC",
|
|
1491
|
+
with: "\u5E36\u6709",
|
|
1492
|
+
additional_date: "\u984D\u5916\u65E5\u671F",
|
|
1493
|
+
additional_dates: "\u984D\u5916\u65E5\u671F",
|
|
1494
|
+
excluding: "\u6392\u9664",
|
|
1495
|
+
date: "\u65E5\u671F",
|
|
1496
|
+
dates: "\u65E5\u671F",
|
|
1497
|
+
and: "\u548C",
|
|
1498
|
+
last: "\u6700\u5F8C"
|
|
1499
|
+
},
|
|
1500
|
+
ordinal: (n) => n < 0 ? "\u6700\u5F8C" : `\u7B2C${Math.abs(n)}`
|
|
1261
1501
|
};
|
|
1262
|
-
var
|
|
1502
|
+
var ar = {
|
|
1503
|
+
weekdayNames: [
|
|
1504
|
+
"\u0627\u0644\u0627\u062B\u0646\u064A\u0646",
|
|
1505
|
+
"\u0627\u0644\u062B\u0644\u0627\u062B\u0627\u0621",
|
|
1506
|
+
"\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621",
|
|
1507
|
+
"\u0627\u0644\u062E\u0645\u064A\u0633",
|
|
1508
|
+
"\u0627\u0644\u062C\u0645\u0639\u0629",
|
|
1509
|
+
"\u0627\u0644\u0633\u0628\u062A",
|
|
1510
|
+
"\u0627\u0644\u0623\u062D\u062F"
|
|
1511
|
+
],
|
|
1512
|
+
monthNames: [
|
|
1513
|
+
"\u064A\u0646\u0627\u064A\u0631",
|
|
1514
|
+
"\u0641\u0628\u0631\u0627\u064A\u0631",
|
|
1515
|
+
"\u0645\u0627\u0631\u0633",
|
|
1516
|
+
"\u0623\u0628\u0631\u064A\u0644",
|
|
1517
|
+
"\u0645\u0627\u064A\u0648",
|
|
1518
|
+
"\u064A\u0648\u0646\u064A\u0648",
|
|
1519
|
+
"\u064A\u0648\u0644\u064A\u0648",
|
|
1520
|
+
"\u0623\u063A\u0633\u0637\u0633",
|
|
1521
|
+
"\u0633\u0628\u062A\u0645\u0628\u0631",
|
|
1522
|
+
"\u0623\u0643\u062A\u0648\u0628\u0631",
|
|
1523
|
+
"\u0646\u0648\u0641\u0645\u0628\u0631",
|
|
1524
|
+
"\u062F\u064A\u0633\u0645\u0628\u0631"
|
|
1525
|
+
],
|
|
1526
|
+
units: {
|
|
1527
|
+
year: { singular: "\u0633\u0646\u0629", plural: "\u0633\u0646\u0648\u0627\u062A" },
|
|
1528
|
+
month: { singular: "\u0634\u0647\u0631", plural: "\u0623\u0634\u0647\u0631" },
|
|
1529
|
+
week: { singular: "\u0623\u0633\u0628\u0648\u0639", plural: "\u0623\u0633\u0627\u0628\u064A\u0639" },
|
|
1530
|
+
day: { singular: "\u064A\u0648\u0645", plural: "\u0623\u064A\u0627\u0645" },
|
|
1531
|
+
hour: { singular: "\u0633\u0627\u0639\u0629", plural: "\u0633\u0627\u0639\u0627\u062A" },
|
|
1532
|
+
minute: { singular: "\u062F\u0642\u064A\u0642\u0629", plural: "\u062F\u0642\u0627\u0626\u0642" },
|
|
1533
|
+
second: { singular: "\u062B\u0627\u0646\u064A\u0629", plural: "\u062B\u0648\u0627\u0646\u064A" }
|
|
1534
|
+
},
|
|
1535
|
+
words: {
|
|
1536
|
+
every: "\u0643\u0644",
|
|
1537
|
+
weekday: "\u064A\u0648\u0645 \u0645\u0646 \u0623\u064A\u0627\u0645 \u0627\u0644\u0623\u0633\u0628\u0648\u0639",
|
|
1538
|
+
on: "\u0641\u064A",
|
|
1539
|
+
in: "\u0641\u064A",
|
|
1540
|
+
on_the: "\u0641\u064A \u0627\u0644\u0640",
|
|
1541
|
+
day_of_month: "\u064A\u0648\u0645 \u0645\u0646 \u0627\u0644\u0634\u0647\u0631",
|
|
1542
|
+
day_of_year: "\u064A\u0648\u0645 \u0645\u0646 \u0627\u0644\u0633\u0646\u0629",
|
|
1543
|
+
in_week: "\u0641\u064A \u0627\u0644\u0623\u0633\u0628\u0648\u0639",
|
|
1544
|
+
at: "\u0639\u0646\u062F",
|
|
1545
|
+
at_minute: "\u0641\u064A \u0627\u0644\u062F\u0642\u064A\u0642\u0629",
|
|
1546
|
+
at_second: "\u0641\u064A \u0627\u0644\u062B\u0627\u0646\u064A\u0629",
|
|
1547
|
+
until: "\u062D\u062A\u0649",
|
|
1548
|
+
for: "\u0644\u0645\u062F\u0629",
|
|
1549
|
+
time: "\u0645\u0631\u0629",
|
|
1550
|
+
times: "\u0645\u0631\u0627\u062A",
|
|
1551
|
+
instance: "\u0645\u0631\u0629",
|
|
1552
|
+
week_starts_on: "\u064A\u0628\u062F\u0623 \u0627\u0644\u0623\u0633\u0628\u0648\u0639 \u064A\u0648\u0645",
|
|
1553
|
+
with: "\u0645\u0639",
|
|
1554
|
+
additional_date: "\u062A\u0627\u0631\u064A\u062E \u0625\u0636\u0627\u0641\u064A",
|
|
1555
|
+
additional_dates: "\u062A\u0648\u0627\u0631\u064A\u062E \u0625\u0636\u0627\u0641\u064A\u0629",
|
|
1556
|
+
excluding: "\u0628\u0627\u0633\u062A\u062B\u0646\u0627\u0621",
|
|
1557
|
+
date: "\u062A\u0627\u0631\u064A\u062E",
|
|
1558
|
+
dates: "\u062A\u0648\u0627\u0631\u064A\u062E",
|
|
1559
|
+
and: "\u0648",
|
|
1560
|
+
last: "\u0627\u0644\u0623\u062E\u064A\u0631"
|
|
1561
|
+
},
|
|
1562
|
+
ordinal: (n) => {
|
|
1563
|
+
if (n < 0) return "\u0627\u0644\u0623\u062E\u064A\u0631";
|
|
1564
|
+
const abs = Math.abs(n);
|
|
1565
|
+
const map = {
|
|
1566
|
+
1: "\u0627\u0644\u0623\u0648\u0644",
|
|
1567
|
+
2: "\u0627\u0644\u062B\u0627\u0646\u064A",
|
|
1568
|
+
3: "\u0627\u0644\u062B\u0627\u0644\u062B",
|
|
1569
|
+
4: "\u0627\u0644\u0631\u0627\u0628\u0639",
|
|
1570
|
+
5: "\u0627\u0644\u062E\u0627\u0645\u0633",
|
|
1571
|
+
6: "\u0627\u0644\u0633\u0627\u062F\u0633",
|
|
1572
|
+
7: "\u0627\u0644\u0633\u0627\u0628\u0639",
|
|
1573
|
+
8: "\u0627\u0644\u062B\u0627\u0645\u0646",
|
|
1574
|
+
9: "\u0627\u0644\u062A\u0627\u0633\u0639",
|
|
1575
|
+
10: "\u0627\u0644\u0639\u0627\u0634\u0631",
|
|
1576
|
+
11: "\u0627\u0644\u062D\u0627\u062F\u064A \u0639\u0634\u0631",
|
|
1577
|
+
12: "\u0627\u0644\u062B\u0627\u0646\u064A \u0639\u0634\u0631",
|
|
1578
|
+
13: "\u0627\u0644\u062B\u0627\u0644\u062B \u0639\u0634\u0631"
|
|
1579
|
+
};
|
|
1580
|
+
return map[abs] || abs.toString();
|
|
1581
|
+
}
|
|
1582
|
+
};
|
|
1583
|
+
var he = {
|
|
1584
|
+
weekdayNames: [
|
|
1585
|
+
"\u05D9\u05D5\u05DD \u05E9\u05E0\u05D9",
|
|
1586
|
+
"\u05D9\u05D5\u05DD \u05E9\u05DC\u05D9\u05E9\u05D9",
|
|
1587
|
+
"\u05D9\u05D5\u05DD \u05E8\u05D1\u05D9\u05E2\u05D9",
|
|
1588
|
+
"\u05D9\u05D5\u05DD \u05D7\u05DE\u05D9\u05E9\u05D9",
|
|
1589
|
+
"\u05D9\u05D5\u05DD \u05E9\u05D9\u05E9\u05D9",
|
|
1590
|
+
"\u05D9\u05D5\u05DD \u05E9\u05D1\u05EA",
|
|
1591
|
+
"\u05D9\u05D5\u05DD \u05E8\u05D0\u05E9\u05D5\u05DF"
|
|
1592
|
+
],
|
|
1593
|
+
monthNames: [
|
|
1594
|
+
"\u05D9\u05E0\u05D5\u05D0\u05E8",
|
|
1595
|
+
"\u05E4\u05D1\u05E8\u05D5\u05D0\u05E8",
|
|
1596
|
+
"\u05DE\u05E8\u05E5",
|
|
1597
|
+
"\u05D0\u05E4\u05E8\u05D9\u05DC",
|
|
1598
|
+
"\u05DE\u05D0\u05D9",
|
|
1599
|
+
"\u05D9\u05D5\u05E0\u05D9",
|
|
1600
|
+
"\u05D9\u05D5\u05DC\u05D9",
|
|
1601
|
+
"\u05D0\u05D5\u05D2\u05D5\u05E1\u05D8",
|
|
1602
|
+
"\u05E1\u05E4\u05D8\u05DE\u05D1\u05E8",
|
|
1603
|
+
"\u05D0\u05D5\u05E7\u05D8\u05D5\u05D1\u05E8",
|
|
1604
|
+
"\u05E0\u05D5\u05D1\u05DE\u05D1\u05E8",
|
|
1605
|
+
"\u05D3\u05E6\u05DE\u05D1\u05E8"
|
|
1606
|
+
],
|
|
1607
|
+
units: {
|
|
1608
|
+
year: { singular: "\u05E9\u05E0\u05D4", plural: "\u05E9\u05E0\u05D9\u05DD" },
|
|
1609
|
+
month: { singular: "\u05D7\u05D5\u05D3\u05E9", plural: "\u05D7\u05D5\u05D3\u05E9\u05D9\u05DD" },
|
|
1610
|
+
week: { singular: "\u05E9\u05D1\u05D5\u05E2", plural: "\u05E9\u05D1\u05D5\u05E2\u05D5\u05EA" },
|
|
1611
|
+
day: { singular: "\u05D9\u05D5\u05DD", plural: "\u05D9\u05DE\u05D9\u05DD" },
|
|
1612
|
+
hour: { singular: "\u05E9\u05E2\u05D4", plural: "\u05E9\u05E2\u05D5\u05EA" },
|
|
1613
|
+
minute: { singular: "\u05D3\u05E7\u05D4", plural: "\u05D3\u05E7\u05D5\u05EA" },
|
|
1614
|
+
second: { singular: "\u05E9\u05E0\u05D9\u05D4", plural: "\u05E9\u05E0\u05D9\u05D5\u05EA" }
|
|
1615
|
+
},
|
|
1616
|
+
words: {
|
|
1617
|
+
every: "\u05DB\u05DC",
|
|
1618
|
+
weekday: "\u05D9\u05D5\u05DD \u05D7\u05D5\u05DC",
|
|
1619
|
+
on: "\u05D1",
|
|
1620
|
+
in: "\u05D1",
|
|
1621
|
+
on_the: "\u05D1",
|
|
1622
|
+
day_of_month: "\u05D9\u05D5\u05DD \u05D1\u05D7\u05D5\u05D3\u05E9",
|
|
1623
|
+
day_of_year: "\u05D9\u05D5\u05DD \u05D1\u05E9\u05E0\u05D4",
|
|
1624
|
+
in_week: "\u05D1\u05E9\u05D1\u05D5\u05E2",
|
|
1625
|
+
at: "\u05D1\u05E9\u05E2\u05D4",
|
|
1626
|
+
at_minute: "\u05D1\u05D3\u05E7\u05D4",
|
|
1627
|
+
at_second: "\u05D1\u05E9\u05E0\u05D9\u05D4",
|
|
1628
|
+
until: "\u05E2\u05D3",
|
|
1629
|
+
for: "\u05D1\u05DE\u05E9\u05DA",
|
|
1630
|
+
time: "\u05E4\u05E2\u05DD",
|
|
1631
|
+
times: "\u05E4\u05E2\u05DE\u05D9\u05DD",
|
|
1632
|
+
instance: "\u05E4\u05E2\u05DD",
|
|
1633
|
+
week_starts_on: "\u05E9\u05D1\u05D5\u05E2 \u05DE\u05EA\u05D7\u05D9\u05DC \u05D1",
|
|
1634
|
+
with: "\u05E2\u05DD",
|
|
1635
|
+
additional_date: "\u05EA\u05D0\u05E8\u05D9\u05DA \u05E0\u05D5\u05E1\u05E3",
|
|
1636
|
+
additional_dates: "\u05EA\u05D0\u05E8\u05D9\u05DB\u05D9\u05DD \u05E0\u05D5\u05E1\u05E4\u05D9\u05DD",
|
|
1637
|
+
excluding: "\u05DC\u05DE\u05E2\u05D8",
|
|
1638
|
+
date: "\u05EA\u05D0\u05E8\u05D9\u05DA",
|
|
1639
|
+
dates: "\u05EA\u05D0\u05E8\u05D9\u05DB\u05D9\u05DD",
|
|
1640
|
+
and: "\u05D5",
|
|
1641
|
+
last: "\u05D0\u05D7\u05E8\u05D5\u05DF"
|
|
1642
|
+
},
|
|
1643
|
+
ordinal: (n) => {
|
|
1644
|
+
if (n < 0) return "\u05D0\u05D7\u05E8\u05D5\u05DF";
|
|
1645
|
+
const abs = Math.abs(n);
|
|
1646
|
+
const map = {
|
|
1647
|
+
1: "\u05E8\u05D0\u05E9\u05D5\u05DF",
|
|
1648
|
+
2: "\u05E9\u05E0\u05D9",
|
|
1649
|
+
3: "\u05E9\u05DC\u05D9\u05E9\u05D9",
|
|
1650
|
+
4: "\u05E8\u05D1\u05D9\u05E2\u05D9",
|
|
1651
|
+
5: "\u05D7\u05DE\u05D9\u05E9\u05D9",
|
|
1652
|
+
6: "\u05E9\u05D9\u05E9\u05D9",
|
|
1653
|
+
7: "\u05E9\u05D1\u05D9\u05E2\u05D9",
|
|
1654
|
+
8: "\u05E9\u05DE\u05D9\u05E0\u05D9",
|
|
1655
|
+
9: "\u05EA\u05E9\u05D9\u05E2\u05D9",
|
|
1656
|
+
10: "\u05E2\u05E9\u05D9\u05E8\u05D9",
|
|
1657
|
+
11: "\u05D0\u05D7\u05D3 \u05E2\u05E9\u05E8",
|
|
1658
|
+
12: "\u05E9\u05E0\u05D9\u05DD \u05E2\u05E9\u05E8",
|
|
1659
|
+
13: "\u05E9\u05DC\u05D5\u05E9\u05D4 \u05E2\u05E9\u05E8"
|
|
1660
|
+
};
|
|
1661
|
+
return map[abs] || abs.toString();
|
|
1662
|
+
}
|
|
1663
|
+
};
|
|
1664
|
+
var zh = {
|
|
1665
|
+
weekdayNames: ["\u661F\u671F\u4E00", "\u661F\u671F\u4E8C", "\u661F\u671F\u4E09", "\u661F\u671F\u56DB", "\u661F\u671F\u4E94", "\u661F\u671F\u516D", "\u661F\u671F\u65E5"],
|
|
1666
|
+
monthNames: [
|
|
1667
|
+
"\u4E00\u6708",
|
|
1668
|
+
"\u4E8C\u6708",
|
|
1669
|
+
"\u4E09\u6708",
|
|
1670
|
+
"\u56DB\u6708",
|
|
1671
|
+
"\u4E94\u6708",
|
|
1672
|
+
"\u516D\u6708",
|
|
1673
|
+
"\u4E03\u6708",
|
|
1674
|
+
"\u516B\u6708",
|
|
1675
|
+
"\u4E5D\u6708",
|
|
1676
|
+
"\u5341\u6708",
|
|
1677
|
+
"\u5341\u4E00\u6708",
|
|
1678
|
+
"\u5341\u4E8C\u6708"
|
|
1679
|
+
],
|
|
1680
|
+
units: {
|
|
1681
|
+
year: { singular: "\u5E74", plural: "\u5E74" },
|
|
1682
|
+
month: { singular: "\u6708", plural: "\u6708" },
|
|
1683
|
+
week: { singular: "\u5468", plural: "\u5468" },
|
|
1684
|
+
day: { singular: "\u65E5", plural: "\u65E5" },
|
|
1685
|
+
hour: { singular: "\u5C0F\u65F6", plural: "\u5C0F\u65F6" },
|
|
1686
|
+
minute: { singular: "\u5206\u949F", plural: "\u5206\u949F" },
|
|
1687
|
+
second: { singular: "\u79D2", plural: "\u79D2" }
|
|
1688
|
+
},
|
|
1689
|
+
words: {
|
|
1690
|
+
every: "\u6BCF",
|
|
1691
|
+
weekday: "\u5DE5\u4F5C\u65E5",
|
|
1692
|
+
on: "\u5728",
|
|
1693
|
+
in: "\u5728",
|
|
1694
|
+
on_the: "\u5728",
|
|
1695
|
+
day_of_month: "\u6708\u7684\u65E5\u5B50",
|
|
1696
|
+
day_of_year: "\u5E74\u7684\u65E5\u5B50",
|
|
1697
|
+
in_week: "\u7B2C",
|
|
1698
|
+
at: "\u5728",
|
|
1699
|
+
at_minute: "\u5728\u7B2C",
|
|
1700
|
+
at_second: "\u5728\u7B2C",
|
|
1701
|
+
until: "\u76F4\u5230",
|
|
1702
|
+
for: "\u5171",
|
|
1703
|
+
time: "\u6B21",
|
|
1704
|
+
times: "\u6B21",
|
|
1705
|
+
instance: "\u6B21",
|
|
1706
|
+
week_starts_on: "\u661F\u671F\u5F00\u59CB\u4E8E",
|
|
1707
|
+
with: "\u5E26\u6709",
|
|
1708
|
+
additional_date: "\u989D\u5916\u65E5\u671F",
|
|
1709
|
+
additional_dates: "\u989D\u5916\u65E5\u671F",
|
|
1710
|
+
excluding: "\u6392\u9664",
|
|
1711
|
+
date: "\u65E5\u671F",
|
|
1712
|
+
dates: "\u65E5\u671F",
|
|
1713
|
+
and: "\u548C",
|
|
1714
|
+
last: "\u6700\u540E"
|
|
1715
|
+
},
|
|
1716
|
+
ordinal: (n) => n < 0 ? "\u6700\u540E" : `\u7B2C${Math.abs(n)}`
|
|
1717
|
+
};
|
|
1718
|
+
var ALL_LOCALES = { en, es, hi, yue, ar, he, zh };
|
|
1263
1719
|
var env = process.env.TOTEXT_LANGS;
|
|
1264
1720
|
var active = env ? env.split(",").map((s) => s.trim()).filter(Boolean) : Object.keys(ALL_LOCALES);
|
|
1265
1721
|
var LOCALES = {};
|
|
1266
1722
|
for (const l of active) {
|
|
1267
1723
|
if (ALL_LOCALES[l]) LOCALES[l] = ALL_LOCALES[l];
|
|
1268
1724
|
}
|
|
1269
|
-
function
|
|
1725
|
+
function defaultOrdinal(n) {
|
|
1270
1726
|
const abs = Math.abs(n);
|
|
1271
1727
|
const suffix = abs % 10 === 1 && abs % 100 !== 11 ? "st" : abs % 10 === 2 && abs % 100 !== 12 ? "nd" : abs % 10 === 3 && abs % 100 !== 13 ? "rd" : "th";
|
|
1272
1728
|
return n < 0 ? `last` : `${abs}${suffix}`;
|
|
1273
1729
|
}
|
|
1274
|
-
function
|
|
1730
|
+
function ordinal(n, locale) {
|
|
1731
|
+
return locale.ordinal ? locale.ordinal(n) : defaultOrdinal(n);
|
|
1732
|
+
}
|
|
1733
|
+
function list(arr, mapFn = (x) => `${x}`, final) {
|
|
1275
1734
|
const mapped = arr.map(mapFn);
|
|
1276
1735
|
if (mapped.length === 1) return mapped[0];
|
|
1277
1736
|
return mapped.slice(0, -1).join(", ") + ` ${final} ` + mapped[mapped.length - 1];
|
|
@@ -1293,8 +1752,8 @@ function formatByDayToken(tok, locale) {
|
|
|
1293
1752
|
const idx = weekdayMap[m[2]];
|
|
1294
1753
|
const name = locale.weekdayNames[idx];
|
|
1295
1754
|
if (ord === 0) return name;
|
|
1296
|
-
if (ord === -1) return
|
|
1297
|
-
return `${ordinal(ord)} ${name}`;
|
|
1755
|
+
if (ord === -1) return `${locale.words.last} ${name}`;
|
|
1756
|
+
return `${ordinal(ord, locale)} ${name}`;
|
|
1298
1757
|
}
|
|
1299
1758
|
function formatTime(hour, minute = 0, second = 0) {
|
|
1300
1759
|
const hr12 = (hour + 11) % 12 + 1;
|
|
@@ -1316,12 +1775,12 @@ function tzAbbreviation(zdt) {
|
|
|
1316
1775
|
hour: "numeric"
|
|
1317
1776
|
}).formatToParts(new Date(zdt.epochMilliseconds));
|
|
1318
1777
|
const tzPart = parts.find((p) => p.type === "timeZoneName");
|
|
1319
|
-
return tzPart
|
|
1778
|
+
return (tzPart == null ? void 0 : tzPart.value) || zdt.timeZoneId;
|
|
1320
1779
|
}
|
|
1321
1780
|
function toText(input, locale) {
|
|
1322
1781
|
const rule = typeof input === "string" ? new RRuleTemporal({ rruleString: input }) : input;
|
|
1323
1782
|
const opts = rule.options();
|
|
1324
|
-
const lang = (locale
|
|
1783
|
+
const lang = (locale != null ? locale : Intl.DateTimeFormat().resolvedOptions().locale).split("-")[0];
|
|
1325
1784
|
const data = LOCALES[lang] || en;
|
|
1326
1785
|
const {
|
|
1327
1786
|
freq,
|
|
@@ -1341,8 +1800,8 @@ function toText(input, locale) {
|
|
|
1341
1800
|
rDate,
|
|
1342
1801
|
exDate
|
|
1343
1802
|
} = opts;
|
|
1344
|
-
const parts = [
|
|
1345
|
-
const
|
|
1803
|
+
const parts = [data.words.every];
|
|
1804
|
+
const baseKey = {
|
|
1346
1805
|
YEARLY: "year",
|
|
1347
1806
|
MONTHLY: "month",
|
|
1348
1807
|
WEEKLY: "week",
|
|
@@ -1351,70 +1810,71 @@ function toText(input, locale) {
|
|
|
1351
1810
|
MINUTELY: "minute",
|
|
1352
1811
|
SECONDLY: "second"
|
|
1353
1812
|
}[freq];
|
|
1354
|
-
const
|
|
1813
|
+
const base = data.units[baseKey];
|
|
1814
|
+
const daysNormalized = byDay == null ? void 0 : byDay.map((d) => d.toUpperCase());
|
|
1355
1815
|
const isWeekdays = daysNormalized && daysNormalized.length === 5 && ["MO", "TU", "WE", "TH", "FR"].every((d) => daysNormalized.includes(d));
|
|
1356
1816
|
const isEveryday = daysNormalized && daysNormalized.length === 7 && ["MO", "TU", "WE", "TH", "FR", "SA", "SU"].every((d) => daysNormalized.includes(d));
|
|
1357
1817
|
if (freq === "WEEKLY" && interval === 1 && isWeekdays) {
|
|
1358
|
-
parts.push(
|
|
1818
|
+
parts.push(data.words.weekday);
|
|
1359
1819
|
} else if (freq === "WEEKLY" && interval === 1 && isEveryday) {
|
|
1360
|
-
parts.push(
|
|
1820
|
+
parts.push(data.units.day.singular);
|
|
1361
1821
|
} else {
|
|
1362
1822
|
if (interval !== 1) {
|
|
1363
|
-
parts.push(interval.toString(), base
|
|
1823
|
+
parts.push(interval.toString(), base.plural);
|
|
1364
1824
|
} else {
|
|
1365
|
-
parts.push(base);
|
|
1825
|
+
parts.push(base.singular);
|
|
1366
1826
|
}
|
|
1367
1827
|
}
|
|
1368
1828
|
if (freq === "WEEKLY" && byDay && !isWeekdays && !isEveryday) {
|
|
1369
|
-
parts.push(
|
|
1829
|
+
parts.push(data.words.on, list(byDay, (t) => formatByDayToken(t, data), data.words.and));
|
|
1370
1830
|
} else if (byDay && freq !== "WEEKLY") {
|
|
1371
|
-
parts.push(
|
|
1831
|
+
parts.push(data.words.on, list(byDay, (t) => formatByDayToken(t, data), data.words.and));
|
|
1372
1832
|
}
|
|
1373
1833
|
if (byMonth) {
|
|
1374
|
-
parts.push(
|
|
1834
|
+
parts.push(data.words.in, list(byMonth, (m) => data.monthNames[m - 1], data.words.and));
|
|
1375
1835
|
}
|
|
1376
1836
|
if (byMonthDay) {
|
|
1377
|
-
parts.push(
|
|
1837
|
+
parts.push(data.words.on_the, list(byMonthDay, (d) => ordinal(d, data), data.words.and), data.words.day_of_month);
|
|
1378
1838
|
}
|
|
1379
1839
|
if (byYearDay) {
|
|
1380
|
-
parts.push(
|
|
1840
|
+
parts.push(data.words.on_the, list(byYearDay, (d) => ordinal(d, data), data.words.and), data.words.day_of_year);
|
|
1381
1841
|
}
|
|
1382
1842
|
if (byWeekNo) {
|
|
1383
|
-
parts.push(
|
|
1843
|
+
parts.push(data.words.in_week, list(byWeekNo, (n) => n.toString(), data.words.and));
|
|
1384
1844
|
}
|
|
1385
1845
|
if (byHour) {
|
|
1386
|
-
const minutes = byMinute
|
|
1387
|
-
const seconds = bySecond
|
|
1846
|
+
const minutes = byMinute != null ? byMinute : [0];
|
|
1847
|
+
const seconds = bySecond != null ? bySecond : [0];
|
|
1388
1848
|
const times = byHour.flatMap(
|
|
1389
1849
|
(h) => minutes.flatMap((m) => seconds.map((s) => formatTime(h, m, s)))
|
|
1390
1850
|
);
|
|
1391
|
-
parts.push(
|
|
1851
|
+
parts.push(data.words.at, list(times, void 0, data.words.and));
|
|
1392
1852
|
parts.push(tzAbbreviation(opts.dtstart));
|
|
1393
1853
|
}
|
|
1394
1854
|
if (!byHour && byMinute) {
|
|
1395
|
-
parts.push(
|
|
1855
|
+
parts.push(data.words.at_minute, list(byMinute, void 0, data.words.and));
|
|
1396
1856
|
}
|
|
1397
1857
|
if (!byHour && !byMinute && bySecond) {
|
|
1398
|
-
parts.push(
|
|
1858
|
+
parts.push(data.words.at_second, list(bySecond, void 0, data.words.and));
|
|
1399
1859
|
}
|
|
1400
1860
|
if (until) {
|
|
1401
1861
|
const monthName = data.monthNames[until.month - 1];
|
|
1402
|
-
parts.push(
|
|
1862
|
+
parts.push(data.words.until, `${monthName} ${until.day}, ${until.year}`);
|
|
1403
1863
|
} else if (count !== void 0) {
|
|
1404
|
-
parts.push(
|
|
1864
|
+
parts.push(data.words.for, count.toString(), count === 1 ? data.words.time : data.words.times);
|
|
1405
1865
|
}
|
|
1406
1866
|
if (bySetPos) {
|
|
1407
|
-
parts.push(
|
|
1867
|
+
parts.push(data.words.on_the, list(bySetPos, (n) => ordinal(n, data), data.words.and), data.words.instance);
|
|
1408
1868
|
}
|
|
1409
1869
|
if (wkst) {
|
|
1410
1870
|
const wkName = formatByDayToken(wkst, data);
|
|
1411
|
-
parts.push(
|
|
1871
|
+
parts.push(data.words.week_starts_on, wkName);
|
|
1412
1872
|
}
|
|
1413
1873
|
if (rDate && rDate.length) {
|
|
1414
|
-
parts.push(
|
|
1874
|
+
parts.push(data.words.with, `${rDate.length}`, rDate.length === 1 ? data.words.additional_date : data.words.additional_dates);
|
|
1415
1875
|
}
|
|
1416
1876
|
if (exDate && exDate.length) {
|
|
1417
|
-
parts.push(
|
|
1877
|
+
parts.push(data.words.excluding, `${exDate.length}`, exDate.length === 1 ? data.words.date : data.words.dates);
|
|
1418
1878
|
}
|
|
1419
1879
|
return parts.join(" ");
|
|
1420
1880
|
}
|