@stridge/noctis-intl 1.0.0-beta.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/LICENSE +201 -0
- package/README.md +41 -0
- package/dist/date/CalendarDate.d.ts +211 -0
- package/dist/date/CalendarDate.js +340 -0
- package/dist/date/DateFormatter.d.ts +26 -0
- package/dist/date/DateFormatter.js +114 -0
- package/dist/date/calendars/BuddhistCalendar.d.ts +20 -0
- package/dist/date/calendars/BuddhistCalendar.js +33 -0
- package/dist/date/calendars/EthiopicCalendar.d.ts +49 -0
- package/dist/date/calendars/EthiopicCalendar.js +129 -0
- package/dist/date/calendars/GregorianCalendar.d.ts +26 -0
- package/dist/date/calendars/GregorianCalendar.js +117 -0
- package/dist/date/calendars/HebrewCalendar.d.ts +25 -0
- package/dist/date/calendars/HebrewCalendar.js +114 -0
- package/dist/date/calendars/IndianCalendar.d.ts +21 -0
- package/dist/date/calendars/IndianCalendar.js +75 -0
- package/dist/date/calendars/IslamicCalendar.d.ts +55 -0
- package/dist/date/calendars/IslamicCalendar.js +162 -0
- package/dist/date/calendars/JapaneseCalendar.d.ts +26 -0
- package/dist/date/calendars/JapaneseCalendar.js +154 -0
- package/dist/date/calendars/PersianCalendar.d.ts +23 -0
- package/dist/date/calendars/PersianCalendar.js +63 -0
- package/dist/date/calendars/TaiwanCalendar.d.ts +23 -0
- package/dist/date/calendars/TaiwanCalendar.js +51 -0
- package/dist/date/conversion.d.ts +41 -0
- package/dist/date/conversion.js +181 -0
- package/dist/date/createCalendar.d.ts +7 -0
- package/dist/date/createCalendar.js +30 -0
- package/dist/date/manipulation.js +274 -0
- package/dist/date/queries.d.ts +92 -0
- package/dist/date/queries.js +233 -0
- package/dist/date/string.d.ts +36 -0
- package/dist/date/string.js +162 -0
- package/dist/date/types.d.ts +138 -0
- package/dist/date/utils.d.ts +4 -0
- package/dist/date/utils.js +6 -0
- package/dist/date/weekStartData.js +100 -0
- package/dist/date.d.ts +17 -0
- package/dist/date.js +16 -0
- package/dist/i18n/context.d.ts +17 -0
- package/dist/i18n/context.js +13 -0
- package/dist/i18n/use-collator.d.ts +8 -0
- package/dist/i18n/use-collator.js +19 -0
- package/dist/i18n/use-date-formatter.d.ts +14 -0
- package/dist/i18n/use-date-formatter.js +25 -0
- package/dist/i18n/use-deep-memo.d.ts +8 -0
- package/dist/i18n/use-deep-memo.js +15 -0
- package/dist/i18n/use-filter.d.ts +17 -0
- package/dist/i18n/use-filter.js +49 -0
- package/dist/i18n/use-list-formatter.d.ts +5 -0
- package/dist/i18n/use-list-formatter.js +11 -0
- package/dist/i18n/use-locale.d.ts +7 -0
- package/dist/i18n/use-locale.js +13 -0
- package/dist/i18n/use-localized-string-formatter.d.ts +13 -0
- package/dist/i18n/use-localized-string-formatter.js +30 -0
- package/dist/i18n/use-number-formatter.d.ts +14 -0
- package/dist/i18n/use-number-formatter.js +15 -0
- package/dist/i18n/utils.d.ts +15 -0
- package/dist/i18n/utils.js +50 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +21 -0
- package/dist/messages/en.d.ts +6 -0
- package/dist/messages/en.js +68 -0
- package/dist/messages/fa.d.ts +6 -0
- package/dist/messages/fa.js +68 -0
- package/dist/number/NumberFormatter.d.ts +32 -0
- package/dist/number/NumberFormatter.js +135 -0
- package/dist/number/NumberParser.d.ts +30 -0
- package/dist/number/NumberParser.js +234 -0
- package/dist/number.d.ts +3 -0
- package/dist/number.js +3 -0
- package/dist/react.d.ts +17 -0
- package/dist/react.js +17 -0
- package/dist/ssr/use-is-ssr.d.ts +8 -0
- package/dist/ssr/use-is-ssr.js +15 -0
- package/dist/string/LocalizedStringDictionary.d.ts +22 -0
- package/dist/string/LocalizedStringDictionary.js +58 -0
- package/dist/string/LocalizedStringFormatter.d.ts +22 -0
- package/dist/string/LocalizedStringFormatter.js +46 -0
- package/dist/string.d.ts +3 -0
- package/dist/string.js +3 -0
- package/package.json +80 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { weekStartData } from "./weekStartData.js";
|
|
2
|
+
import { fromAbsolute, toAbsolute, toCalendar, toCalendarDate } from "./conversion.js";
|
|
3
|
+
//#region src/date/queries.ts
|
|
4
|
+
/** Returns whether the given dates occur on the same day, regardless of the time or calendar system. */
|
|
5
|
+
function isSameDay(a, b) {
|
|
6
|
+
b = toCalendar(b, a.calendar);
|
|
7
|
+
return a.era === b.era && a.year === b.year && a.month === b.month && a.day === b.day;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Returns whether the given dates occur in the same month, using the calendar system of the first
|
|
11
|
+
* date.
|
|
12
|
+
*/
|
|
13
|
+
function isSameMonth(a, b) {
|
|
14
|
+
b = toCalendar(b, a.calendar);
|
|
15
|
+
a = startOfMonth(a);
|
|
16
|
+
b = startOfMonth(b);
|
|
17
|
+
return a.era === b.era && a.year === b.year && a.month === b.month;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Returns whether the given dates occur in the same year, using the calendar system of the first
|
|
21
|
+
* date.
|
|
22
|
+
*/
|
|
23
|
+
function isSameYear(a, b) {
|
|
24
|
+
b = toCalendar(b, a.calendar);
|
|
25
|
+
a = startOfYear(a);
|
|
26
|
+
b = startOfYear(b);
|
|
27
|
+
return a.era === b.era && a.year === b.year;
|
|
28
|
+
}
|
|
29
|
+
/** Returns whether the given dates occur on the same day, and are of the same calendar system. */
|
|
30
|
+
function isEqualDay(a, b) {
|
|
31
|
+
return isEqualCalendar(a.calendar, b.calendar) && isSameDay(a, b);
|
|
32
|
+
}
|
|
33
|
+
/** Returns whether the given dates occur in the same month, and are of the same calendar system. */
|
|
34
|
+
function isEqualMonth(a, b) {
|
|
35
|
+
return isEqualCalendar(a.calendar, b.calendar) && isSameMonth(a, b);
|
|
36
|
+
}
|
|
37
|
+
/** Returns whether the given dates occur in the same year, and are of the same calendar system. */
|
|
38
|
+
function isEqualYear(a, b) {
|
|
39
|
+
return isEqualCalendar(a.calendar, b.calendar) && isSameYear(a, b);
|
|
40
|
+
}
|
|
41
|
+
/** Returns whether two calendars are the same. */
|
|
42
|
+
function isEqualCalendar(a, b) {
|
|
43
|
+
return a.isEqual?.(b) ?? b.isEqual?.(a) ?? a.identifier === b.identifier;
|
|
44
|
+
}
|
|
45
|
+
/** Returns whether the date is today in the given time zone. */
|
|
46
|
+
function isToday(date, timeZone) {
|
|
47
|
+
return isSameDay(date, today(timeZone));
|
|
48
|
+
}
|
|
49
|
+
const DAY_MAP = {
|
|
50
|
+
sun: 0,
|
|
51
|
+
mon: 1,
|
|
52
|
+
tue: 2,
|
|
53
|
+
wed: 3,
|
|
54
|
+
thu: 4,
|
|
55
|
+
fri: 5,
|
|
56
|
+
sat: 6
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Returns the day of week for the given date and locale. Days are numbered from zero to six,
|
|
60
|
+
* where zero is the first day of the week in the given locale. For example, in the United States,
|
|
61
|
+
* the first day of the week is Sunday, but in France it is Monday.
|
|
62
|
+
*/
|
|
63
|
+
function getDayOfWeek(date, locale, firstDayOfWeek) {
|
|
64
|
+
let julian = date.calendar.toJulianDay(date);
|
|
65
|
+
let weekStart = firstDayOfWeek ? DAY_MAP[firstDayOfWeek] : getWeekStart(locale);
|
|
66
|
+
let dayOfWeek = Math.ceil(julian + 1 - weekStart) % 7;
|
|
67
|
+
if (dayOfWeek < 0) dayOfWeek += 7;
|
|
68
|
+
return dayOfWeek;
|
|
69
|
+
}
|
|
70
|
+
/** Returns the current time in the given time zone. */
|
|
71
|
+
function now(timeZone) {
|
|
72
|
+
return fromAbsolute(Date.now(), timeZone);
|
|
73
|
+
}
|
|
74
|
+
/** Returns today's date in the given time zone. */
|
|
75
|
+
function today(timeZone) {
|
|
76
|
+
return toCalendarDate(now(timeZone));
|
|
77
|
+
}
|
|
78
|
+
function compareDate(a, b) {
|
|
79
|
+
return a.calendar.toJulianDay(a) - b.calendar.toJulianDay(b);
|
|
80
|
+
}
|
|
81
|
+
function compareTime(a, b) {
|
|
82
|
+
return timeToMs(a) - timeToMs(b);
|
|
83
|
+
}
|
|
84
|
+
function timeToMs(a) {
|
|
85
|
+
return a.hour * 60 * 60 * 1e3 + a.minute * 60 * 1e3 + a.second * 1e3 + a.millisecond;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Returns the number of hours in the given date and time zone.
|
|
89
|
+
* Usually this is 24, but it could be 23 or 25 if the date is on a daylight saving transition.
|
|
90
|
+
*/
|
|
91
|
+
function getHoursInDay(a, timeZone) {
|
|
92
|
+
let ms = toAbsolute(a, timeZone);
|
|
93
|
+
return (toAbsolute(a.add({ days: 1 }), timeZone) - ms) / 36e5;
|
|
94
|
+
}
|
|
95
|
+
let localTimeZone = null;
|
|
96
|
+
let localTimeZoneOverride = false;
|
|
97
|
+
/** Returns the time zone identifier for the current user. */
|
|
98
|
+
function getLocalTimeZone() {
|
|
99
|
+
if (localTimeZone == null) localTimeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
100
|
+
return localTimeZone;
|
|
101
|
+
}
|
|
102
|
+
/** Sets the time zone identifier for the current user. */
|
|
103
|
+
function setLocalTimeZone(timeZone) {
|
|
104
|
+
localTimeZoneOverride = true;
|
|
105
|
+
localTimeZone = timeZone;
|
|
106
|
+
}
|
|
107
|
+
/** Resets the time zone identifier for the current user. */
|
|
108
|
+
function resetLocalTimeZone() {
|
|
109
|
+
localTimeZoneOverride = false;
|
|
110
|
+
localTimeZone = null;
|
|
111
|
+
}
|
|
112
|
+
/** Returns whether the local time zone has been explicitly overridden via `setLocalTimeZone`. */
|
|
113
|
+
function isLocalTimeZoneOverridden() {
|
|
114
|
+
return localTimeZoneOverride;
|
|
115
|
+
}
|
|
116
|
+
function startOfMonth(date) {
|
|
117
|
+
return date.subtract({ days: date.day - 1 });
|
|
118
|
+
}
|
|
119
|
+
function endOfMonth(date) {
|
|
120
|
+
return date.add({ days: date.calendar.getDaysInMonth(date) - date.day });
|
|
121
|
+
}
|
|
122
|
+
function startOfYear(date) {
|
|
123
|
+
return startOfMonth(date.subtract({ months: date.month - 1 }));
|
|
124
|
+
}
|
|
125
|
+
function endOfYear(date) {
|
|
126
|
+
return endOfMonth(date.add({ months: date.calendar.getMonthsInYear(date) - date.month }));
|
|
127
|
+
}
|
|
128
|
+
function getMinimumMonthInYear(date) {
|
|
129
|
+
if (date.calendar.getMinimumMonthInYear) return date.calendar.getMinimumMonthInYear(date);
|
|
130
|
+
return 1;
|
|
131
|
+
}
|
|
132
|
+
function getMinimumDayInMonth(date) {
|
|
133
|
+
if (date.calendar.getMinimumDayInMonth) return date.calendar.getMinimumDayInMonth(date);
|
|
134
|
+
return 1;
|
|
135
|
+
}
|
|
136
|
+
function startOfWeek(date, locale, firstDayOfWeek) {
|
|
137
|
+
let dayOfWeek = getDayOfWeek(date, locale, firstDayOfWeek);
|
|
138
|
+
return date.subtract({ days: dayOfWeek });
|
|
139
|
+
}
|
|
140
|
+
function endOfWeek(date, locale, firstDayOfWeek) {
|
|
141
|
+
return startOfWeek(date, locale, firstDayOfWeek).add({ days: 6 });
|
|
142
|
+
}
|
|
143
|
+
const cachedRegions = /* @__PURE__ */ new Map();
|
|
144
|
+
const cachedWeekInfo = /* @__PURE__ */ new Map();
|
|
145
|
+
function getRegion(locale) {
|
|
146
|
+
if (Intl.Locale) {
|
|
147
|
+
let region = cachedRegions.get(locale);
|
|
148
|
+
if (!region) {
|
|
149
|
+
region = new Intl.Locale(locale).maximize().region;
|
|
150
|
+
if (region) cachedRegions.set(locale, region);
|
|
151
|
+
}
|
|
152
|
+
return region;
|
|
153
|
+
}
|
|
154
|
+
let part = locale.split("-")[1];
|
|
155
|
+
return part === "u" ? void 0 : part;
|
|
156
|
+
}
|
|
157
|
+
function getWeekStart(locale) {
|
|
158
|
+
let weekInfo = cachedWeekInfo.get(locale);
|
|
159
|
+
if (!weekInfo) {
|
|
160
|
+
if (Intl.Locale) {
|
|
161
|
+
let localeInst = new Intl.Locale(locale);
|
|
162
|
+
if ("getWeekInfo" in localeInst) {
|
|
163
|
+
weekInfo = localeInst.getWeekInfo();
|
|
164
|
+
if (weekInfo) {
|
|
165
|
+
cachedWeekInfo.set(locale, weekInfo);
|
|
166
|
+
return weekInfo.firstDay;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
let region = getRegion(locale);
|
|
171
|
+
if (locale.includes("-fw-")) {
|
|
172
|
+
let day = locale.split("-fw-")[1].split("-")[0];
|
|
173
|
+
if (day === "mon") weekInfo = { firstDay: 1 };
|
|
174
|
+
else if (day === "tue") weekInfo = { firstDay: 2 };
|
|
175
|
+
else if (day === "wed") weekInfo = { firstDay: 3 };
|
|
176
|
+
else if (day === "thu") weekInfo = { firstDay: 4 };
|
|
177
|
+
else if (day === "fri") weekInfo = { firstDay: 5 };
|
|
178
|
+
else if (day === "sat") weekInfo = { firstDay: 6 };
|
|
179
|
+
else weekInfo = { firstDay: 0 };
|
|
180
|
+
} else if (locale.includes("-ca-iso8601")) weekInfo = { firstDay: 1 };
|
|
181
|
+
else weekInfo = { firstDay: region ? weekStartData[region] || 0 : 0 };
|
|
182
|
+
cachedWeekInfo.set(locale, weekInfo);
|
|
183
|
+
}
|
|
184
|
+
return weekInfo.firstDay;
|
|
185
|
+
}
|
|
186
|
+
/** Returns the number of weeks in the given month and locale. */
|
|
187
|
+
function getWeeksInMonth(date, locale, firstDayOfWeek) {
|
|
188
|
+
let days = date.calendar.getDaysInMonth(date);
|
|
189
|
+
return Math.ceil((getDayOfWeek(startOfMonth(date), locale, firstDayOfWeek) + days) / 7);
|
|
190
|
+
}
|
|
191
|
+
/** Returns the lesser of the two provider dates. */
|
|
192
|
+
function minDate(a, b) {
|
|
193
|
+
if (a && b) return a.compare(b) <= 0 ? a : b;
|
|
194
|
+
return a || b;
|
|
195
|
+
}
|
|
196
|
+
/** Returns the greater of the two provider dates. */
|
|
197
|
+
function maxDate(a, b) {
|
|
198
|
+
if (a && b) return a.compare(b) >= 0 ? a : b;
|
|
199
|
+
return a || b;
|
|
200
|
+
}
|
|
201
|
+
const WEEKEND_DATA = {
|
|
202
|
+
AF: [4, 5],
|
|
203
|
+
AE: [5, 6],
|
|
204
|
+
BH: [5, 6],
|
|
205
|
+
DZ: [5, 6],
|
|
206
|
+
EG: [5, 6],
|
|
207
|
+
IL: [5, 6],
|
|
208
|
+
IQ: [5, 6],
|
|
209
|
+
IR: [5, 5],
|
|
210
|
+
JO: [5, 6],
|
|
211
|
+
KW: [5, 6],
|
|
212
|
+
LY: [5, 6],
|
|
213
|
+
OM: [5, 6],
|
|
214
|
+
QA: [5, 6],
|
|
215
|
+
SA: [5, 6],
|
|
216
|
+
SD: [5, 6],
|
|
217
|
+
SY: [5, 6],
|
|
218
|
+
YE: [5, 6]
|
|
219
|
+
};
|
|
220
|
+
/** Returns whether the given date is on a weekend in the given locale. */
|
|
221
|
+
function isWeekend(date, locale) {
|
|
222
|
+
let julian = date.calendar.toJulianDay(date);
|
|
223
|
+
let dayOfWeek = Math.ceil(julian + 1) % 7;
|
|
224
|
+
if (dayOfWeek < 0) dayOfWeek += 7;
|
|
225
|
+
let [start, end] = WEEKEND_DATA[getRegion(locale)] || [6, 0];
|
|
226
|
+
return dayOfWeek === start || dayOfWeek === end;
|
|
227
|
+
}
|
|
228
|
+
/** Returns whether the given date is on a weekday in the given locale. */
|
|
229
|
+
function isWeekday(date, locale) {
|
|
230
|
+
return !isWeekend(date, locale);
|
|
231
|
+
}
|
|
232
|
+
//#endregion
|
|
233
|
+
export { compareDate, compareTime, endOfMonth, endOfWeek, endOfYear, getDayOfWeek, getHoursInDay, getLocalTimeZone, getMinimumDayInMonth, getMinimumMonthInYear, getWeeksInMonth, isEqualCalendar, isEqualDay, isEqualMonth, isEqualYear, isLocalTimeZoneOverridden, isSameDay, isSameMonth, isSameYear, isToday, isWeekday, isWeekend, maxDate, minDate, now, resetLocalTimeZone, setLocalTimeZone, startOfMonth, startOfWeek, startOfYear, today };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { CalendarDate, CalendarDateTime, Time, ZonedDateTime } from "./CalendarDate.js";
|
|
2
|
+
import { DateTimeDuration, Disambiguation } from "./types.js";
|
|
3
|
+
|
|
4
|
+
//#region src/date/string.d.ts
|
|
5
|
+
/** Parses an ISO 8601 time string. */
|
|
6
|
+
declare function parseTime(value: string): Time;
|
|
7
|
+
/** Parses an ISO 8601 date string, with no time components. */
|
|
8
|
+
declare function parseDate(value: string): CalendarDate;
|
|
9
|
+
/** Parses an ISO 8601 date and time string, with no time zone. */
|
|
10
|
+
declare function parseDateTime(value: string): CalendarDateTime;
|
|
11
|
+
/**
|
|
12
|
+
* Parses an ISO 8601 date and time string with a time zone extension and optional UTC offset (e.g.
|
|
13
|
+
* "2021-11-07T00:45[America/Los_Angeles]" or "2021-11-07T00:45-07:00[America/Los_Angeles]").
|
|
14
|
+
* Ambiguous times due to daylight saving time transitions are resolved according to the
|
|
15
|
+
* `disambiguation` parameter.
|
|
16
|
+
*/
|
|
17
|
+
declare function parseZonedDateTime(value: string, disambiguation?: Disambiguation): ZonedDateTime;
|
|
18
|
+
/**
|
|
19
|
+
* Parses an ISO 8601 date and time string with a UTC offset (e.g. "2021-11-07T07:45:00Z"
|
|
20
|
+
* or "2021-11-07T07:45:00-07:00"). The result is converted to the provided time zone.
|
|
21
|
+
*/
|
|
22
|
+
declare function parseAbsolute(value: string, timeZone: string): ZonedDateTime;
|
|
23
|
+
/**
|
|
24
|
+
* Parses an ISO 8601 date and time string with a UTC offset (e.g. "2021-11-07T07:45:00Z"
|
|
25
|
+
* or "2021-11-07T07:45:00-07:00"). The result is converted to the user's local time zone.
|
|
26
|
+
*/
|
|
27
|
+
declare function parseAbsoluteToLocal(value: string): ZonedDateTime;
|
|
28
|
+
/**
|
|
29
|
+
* Parses an ISO 8601 duration string (e.g. "P3Y6M6W4DT12H30M5S").
|
|
30
|
+
*
|
|
31
|
+
* @param value An ISO 8601 duration string.
|
|
32
|
+
* @returns A DateTimeDuration object.
|
|
33
|
+
*/
|
|
34
|
+
declare function parseDuration(value: string): Required<DateTimeDuration>;
|
|
35
|
+
//#endregion
|
|
36
|
+
export { parseAbsolute, parseAbsoluteToLocal, parseDate, parseDateTime, parseDuration, parseTime, parseZonedDateTime };
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { GregorianCalendar } from "./calendars/GregorianCalendar.js";
|
|
2
|
+
import { getLocalTimeZone } from "./queries.js";
|
|
3
|
+
import { epochFromDate, fromAbsolute, possibleAbsolutes, toAbsolute, toCalendar, toCalendarDateTime, toTimeZone } from "./conversion.js";
|
|
4
|
+
import { CalendarDate, CalendarDateTime, Time, ZonedDateTime } from "./CalendarDate.js";
|
|
5
|
+
//#region src/date/string.ts
|
|
6
|
+
const TIME_RE = /^(\d{2})(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?$/;
|
|
7
|
+
const DATE_RE = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/;
|
|
8
|
+
const DATE_TIME_RE = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?$/;
|
|
9
|
+
const ZONED_DATE_TIME_RE = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:([+-]\d{2})(?::?(\d{2}))?(?::?(\d{2}))?)?\[(.*?)\]$/;
|
|
10
|
+
const ABSOLUTE_RE = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;
|
|
11
|
+
const DATE_TIME_DURATION_RE = /^((?<negative>-)|\+)?P((?<years>\d*)Y)?((?<months>\d*)M)?((?<weeks>\d*)W)?((?<days>\d*)D)?((?<time>T)((?<hours>\d*[.,]?\d{1,9})H)?((?<minutes>\d*[.,]?\d{1,9})M)?((?<seconds>\d*[.,]?\d{1,9})S)?)?$/;
|
|
12
|
+
const requiredDurationTimeGroups = [
|
|
13
|
+
"hours",
|
|
14
|
+
"minutes",
|
|
15
|
+
"seconds"
|
|
16
|
+
];
|
|
17
|
+
const requiredDurationGroups = [
|
|
18
|
+
"years",
|
|
19
|
+
"months",
|
|
20
|
+
"weeks",
|
|
21
|
+
"days",
|
|
22
|
+
...requiredDurationTimeGroups
|
|
23
|
+
];
|
|
24
|
+
/** Parses an ISO 8601 time string. */
|
|
25
|
+
function parseTime(value) {
|
|
26
|
+
let m = value.match(TIME_RE);
|
|
27
|
+
if (!m) throw new Error("Invalid ISO 8601 time string: " + value);
|
|
28
|
+
return new Time(parseNumber(m[1], 0, 23), m[2] ? parseNumber(m[2], 0, 59) : 0, m[3] ? parseNumber(m[3], 0, 59) : 0, m[4] ? parseNumber(m[4], 0, Infinity) * 1e3 : 0);
|
|
29
|
+
}
|
|
30
|
+
/** Parses an ISO 8601 date string, with no time components. */
|
|
31
|
+
function parseDate(value) {
|
|
32
|
+
let m = value.match(DATE_RE);
|
|
33
|
+
if (!m) {
|
|
34
|
+
if (ABSOLUTE_RE.test(value)) throw new Error(`Invalid ISO 8601 date string: ${value}. Use parseAbsolute() instead.`);
|
|
35
|
+
throw new Error("Invalid ISO 8601 date string: " + value);
|
|
36
|
+
}
|
|
37
|
+
let date = new CalendarDate(parseNumber(m[1], 0, 9999), parseNumber(m[2], 1, 12), 1);
|
|
38
|
+
date.day = parseNumber(m[3], 1, date.calendar.getDaysInMonth(date));
|
|
39
|
+
return date;
|
|
40
|
+
}
|
|
41
|
+
/** Parses an ISO 8601 date and time string, with no time zone. */
|
|
42
|
+
function parseDateTime(value) {
|
|
43
|
+
let m = value.match(DATE_TIME_RE);
|
|
44
|
+
if (!m) {
|
|
45
|
+
if (ABSOLUTE_RE.test(value)) throw new Error(`Invalid ISO 8601 date time string: ${value}. Use parseAbsolute() instead.`);
|
|
46
|
+
throw new Error("Invalid ISO 8601 date time string: " + value);
|
|
47
|
+
}
|
|
48
|
+
let year = parseNumber(m[1], -9999, 9999);
|
|
49
|
+
let date = new CalendarDateTime(year < 1 ? "BC" : "AD", year < 1 ? -year + 1 : year, parseNumber(m[2], 1, 12), 1, m[4] ? parseNumber(m[4], 0, 23) : 0, m[5] ? parseNumber(m[5], 0, 59) : 0, m[6] ? parseNumber(m[6], 0, 59) : 0, m[7] ? parseNumber(m[7], 0, Infinity) * 1e3 : 0);
|
|
50
|
+
date.day = parseNumber(m[3], 0, date.calendar.getDaysInMonth(date));
|
|
51
|
+
return date;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Parses an ISO 8601 date and time string with a time zone extension and optional UTC offset (e.g.
|
|
55
|
+
* "2021-11-07T00:45[America/Los_Angeles]" or "2021-11-07T00:45-07:00[America/Los_Angeles]").
|
|
56
|
+
* Ambiguous times due to daylight saving time transitions are resolved according to the
|
|
57
|
+
* `disambiguation` parameter.
|
|
58
|
+
*/
|
|
59
|
+
function parseZonedDateTime(value, disambiguation) {
|
|
60
|
+
let m = value.match(ZONED_DATE_TIME_RE);
|
|
61
|
+
if (!m) throw new Error("Invalid ISO 8601 date time string: " + value);
|
|
62
|
+
let year = parseNumber(m[1], -9999, 9999);
|
|
63
|
+
let date = new ZonedDateTime(year < 1 ? "BC" : "AD", year < 1 ? -year + 1 : year, parseNumber(m[2], 1, 12), 1, m[11], 0, m[4] ? parseNumber(m[4], 0, 23) : 0, m[5] ? parseNumber(m[5], 0, 59) : 0, m[6] ? parseNumber(m[6], 0, 59) : 0, m[7] ? parseNumber(m[7], 0, Infinity) * 1e3 : 0);
|
|
64
|
+
date.day = parseNumber(m[3], 0, date.calendar.getDaysInMonth(date));
|
|
65
|
+
let plainDateTime = toCalendarDateTime(date);
|
|
66
|
+
let ms;
|
|
67
|
+
if (m[8]) {
|
|
68
|
+
let hourOffset = parseNumber(m[8], -23, 23);
|
|
69
|
+
date.offset = Math.sign(hourOffset) * (Math.abs(hourOffset) * 60 * 60 * 1e3 + parseNumber(m[9] ?? "0", 0, 59) * 60 * 1e3 + parseNumber(m[10] ?? "0", 0, 59) * 1e3);
|
|
70
|
+
ms = epochFromDate(date) - date.offset;
|
|
71
|
+
if (!possibleAbsolutes(plainDateTime, date.timeZone).includes(ms)) throw new Error(`Offset ${offsetToString(date.offset)} is invalid for ${dateTimeToString(date)} in ${date.timeZone}`);
|
|
72
|
+
} else ms = toAbsolute(toCalendarDateTime(plainDateTime), date.timeZone, disambiguation);
|
|
73
|
+
return fromAbsolute(ms, date.timeZone);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Parses an ISO 8601 date and time string with a UTC offset (e.g. "2021-11-07T07:45:00Z"
|
|
77
|
+
* or "2021-11-07T07:45:00-07:00"). The result is converted to the provided time zone.
|
|
78
|
+
*/
|
|
79
|
+
function parseAbsolute(value, timeZone) {
|
|
80
|
+
let m = value.match(ABSOLUTE_RE);
|
|
81
|
+
if (!m) throw new Error("Invalid ISO 8601 date time string: " + value);
|
|
82
|
+
let year = parseNumber(m[1], -9999, 9999);
|
|
83
|
+
let date = new ZonedDateTime(year < 1 ? "BC" : "AD", year < 1 ? -year + 1 : year, parseNumber(m[2], 1, 12), 1, timeZone, 0, m[4] ? parseNumber(m[4], 0, 23) : 0, m[5] ? parseNumber(m[5], 0, 59) : 0, m[6] ? parseNumber(m[6], 0, 59) : 0, m[7] ? parseNumber(m[7], 0, Infinity) * 1e3 : 0);
|
|
84
|
+
date.day = parseNumber(m[3], 0, date.calendar.getDaysInMonth(date));
|
|
85
|
+
if (m[8]) date.offset = parseNumber(m[8], -23, 23) * 60 * 60 * 1e3 + parseNumber(m[9] ?? "0", 0, 59) * 60 * 1e3;
|
|
86
|
+
return toTimeZone(date, timeZone);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Parses an ISO 8601 date and time string with a UTC offset (e.g. "2021-11-07T07:45:00Z"
|
|
90
|
+
* or "2021-11-07T07:45:00-07:00"). The result is converted to the user's local time zone.
|
|
91
|
+
*/
|
|
92
|
+
function parseAbsoluteToLocal(value) {
|
|
93
|
+
return parseAbsolute(value, getLocalTimeZone());
|
|
94
|
+
}
|
|
95
|
+
function parseNumber(value, min, max) {
|
|
96
|
+
let val = Number(value);
|
|
97
|
+
if (val < min || val > max) throw new RangeError(`Value out of range: ${min} <= ${val} <= ${max}`);
|
|
98
|
+
return val;
|
|
99
|
+
}
|
|
100
|
+
function timeToString(time) {
|
|
101
|
+
return `${String(time.hour).padStart(2, "0")}:${String(time.minute).padStart(2, "0")}:${String(time.second).padStart(2, "0")}${time.millisecond ? String(time.millisecond / 1e3).slice(1) : ""}`;
|
|
102
|
+
}
|
|
103
|
+
function dateToString(date) {
|
|
104
|
+
let gregorianDate = toCalendar(date, new GregorianCalendar());
|
|
105
|
+
let year;
|
|
106
|
+
if (gregorianDate.era === "BC") year = gregorianDate.year === 1 ? "0000" : "-" + String(Math.abs(1 - gregorianDate.year)).padStart(6, "00");
|
|
107
|
+
else year = String(gregorianDate.year).padStart(4, "0");
|
|
108
|
+
return `${year}-${String(gregorianDate.month).padStart(2, "0")}-${String(gregorianDate.day).padStart(2, "0")}`;
|
|
109
|
+
}
|
|
110
|
+
function dateTimeToString(date) {
|
|
111
|
+
return `${dateToString(date)}T${timeToString(date)}`;
|
|
112
|
+
}
|
|
113
|
+
function offsetToString(offset) {
|
|
114
|
+
let sign = Math.sign(offset) < 0 ? "-" : "+";
|
|
115
|
+
offset = Math.abs(offset);
|
|
116
|
+
let offsetHours = Math.floor(offset / (3600 * 1e3));
|
|
117
|
+
let offsetMinutes = Math.floor(offset % (3600 * 1e3) / (60 * 1e3));
|
|
118
|
+
let offsetSeconds = Math.floor(offset % (3600 * 1e3) % (60 * 1e3) / 1e3);
|
|
119
|
+
let stringOffset = `${sign}${String(offsetHours).padStart(2, "0")}:${String(offsetMinutes).padStart(2, "0")}`;
|
|
120
|
+
if (offsetSeconds !== 0) stringOffset += `:${String(offsetSeconds).padStart(2, "0")}`;
|
|
121
|
+
return stringOffset;
|
|
122
|
+
}
|
|
123
|
+
function zonedDateTimeToString(date) {
|
|
124
|
+
return `${dateTimeToString(date)}${offsetToString(date.offset)}[${date.timeZone}]`;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Parses an ISO 8601 duration string (e.g. "P3Y6M6W4DT12H30M5S").
|
|
128
|
+
*
|
|
129
|
+
* @param value An ISO 8601 duration string.
|
|
130
|
+
* @returns A DateTimeDuration object.
|
|
131
|
+
*/
|
|
132
|
+
function parseDuration(value) {
|
|
133
|
+
const match = value.match(DATE_TIME_DURATION_RE);
|
|
134
|
+
if (!match) throw new Error(`Invalid ISO 8601 Duration string: ${value}`);
|
|
135
|
+
const parseDurationGroup = (group, isNegative) => {
|
|
136
|
+
if (!group) return 0;
|
|
137
|
+
try {
|
|
138
|
+
return (isNegative ? -1 : 1) * Number(group.replace(",", "."));
|
|
139
|
+
} catch {
|
|
140
|
+
throw new Error(`Invalid ISO 8601 Duration string: ${value}`);
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
const isNegative = !!match.groups?.negative;
|
|
144
|
+
if (!requiredDurationGroups.some((group) => match.groups?.[group])) throw new Error(`Invalid ISO 8601 Duration string: ${value}`);
|
|
145
|
+
if (match.groups?.time) {
|
|
146
|
+
if (!requiredDurationTimeGroups.some((group) => match.groups?.[group])) throw new Error(`Invalid ISO 8601 Duration string: ${value}`);
|
|
147
|
+
}
|
|
148
|
+
const duration = {
|
|
149
|
+
years: parseDurationGroup(match.groups?.years, isNegative),
|
|
150
|
+
months: parseDurationGroup(match.groups?.months, isNegative),
|
|
151
|
+
weeks: parseDurationGroup(match.groups?.weeks, isNegative),
|
|
152
|
+
days: parseDurationGroup(match.groups?.days, isNegative),
|
|
153
|
+
hours: parseDurationGroup(match.groups?.hours, isNegative),
|
|
154
|
+
minutes: parseDurationGroup(match.groups?.minutes, isNegative),
|
|
155
|
+
seconds: parseDurationGroup(match.groups?.seconds, isNegative)
|
|
156
|
+
};
|
|
157
|
+
if (duration.hours !== void 0 && duration.hours % 1 !== 0 && (duration.minutes || duration.seconds)) throw new Error(`Invalid ISO 8601 Duration string: ${value} - only the smallest unit can be fractional`);
|
|
158
|
+
if (duration.minutes !== void 0 && duration.minutes % 1 !== 0 && duration.seconds) throw new Error(`Invalid ISO 8601 Duration string: ${value} - only the smallest unit can be fractional`);
|
|
159
|
+
return duration;
|
|
160
|
+
}
|
|
161
|
+
//#endregion
|
|
162
|
+
export { dateTimeToString, dateToString, parseAbsolute, parseAbsoluteToLocal, parseDate, parseDateTime, parseDuration, parseTime, parseZonedDateTime, timeToString, zonedDateTimeToString };
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { CalendarDate } from "./CalendarDate.js";
|
|
2
|
+
|
|
3
|
+
//#region src/date/types.d.ts
|
|
4
|
+
/** An interface that is compatible with any object with date fields. */
|
|
5
|
+
interface AnyCalendarDate {
|
|
6
|
+
readonly calendar: Calendar;
|
|
7
|
+
readonly era: string;
|
|
8
|
+
readonly year: number;
|
|
9
|
+
readonly month: number;
|
|
10
|
+
readonly day: number;
|
|
11
|
+
copy(): this;
|
|
12
|
+
}
|
|
13
|
+
/** An interface that is compatible with any object with time fields. */
|
|
14
|
+
interface AnyTime {
|
|
15
|
+
readonly hour: number;
|
|
16
|
+
readonly minute: number;
|
|
17
|
+
readonly second: number;
|
|
18
|
+
readonly millisecond: number;
|
|
19
|
+
copy(): this;
|
|
20
|
+
}
|
|
21
|
+
/** An interface that is compatible with any object with both date and time fields. */
|
|
22
|
+
interface AnyDateTime extends AnyCalendarDate, AnyTime {}
|
|
23
|
+
type CalendarIdentifier = "gregory" | "buddhist" | "chinese" | "coptic" | "dangi" | "ethioaa" | "ethiopic" | "hebrew" | "indian" | "islamic" | "islamic-umalqura" | "islamic-tbla" | "islamic-civil" | "islamic-rgsa" | "iso8601" | "japanese" | "persian" | "roc";
|
|
24
|
+
/**
|
|
25
|
+
* The Calendar interface represents a calendar system, including information
|
|
26
|
+
* about how days, months, years, and eras are organized, and methods to perform
|
|
27
|
+
* arithmetic on dates.
|
|
28
|
+
*/
|
|
29
|
+
interface Calendar {
|
|
30
|
+
/**
|
|
31
|
+
* A string identifier for the calendar, as defined by Unicode CLDR. See
|
|
32
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/supportedValuesOf#supported_calendar_types).
|
|
33
|
+
*/
|
|
34
|
+
identifier: CalendarIdentifier;
|
|
35
|
+
/** Creates a CalendarDate in this calendar from the given Julian day number. */
|
|
36
|
+
fromJulianDay(jd: number): CalendarDate;
|
|
37
|
+
/** Converts a date in this calendar to a Julian day number. */
|
|
38
|
+
toJulianDay(date: AnyCalendarDate): number;
|
|
39
|
+
/** Returns the number of days in the month of the given date. */
|
|
40
|
+
getDaysInMonth(date: AnyCalendarDate): number;
|
|
41
|
+
/** Returns the number of months in the year of the given date. */
|
|
42
|
+
getMonthsInYear(date: AnyCalendarDate): number;
|
|
43
|
+
/** Returns the number of years in the era of the given date. */
|
|
44
|
+
getYearsInEra(date: AnyCalendarDate): number;
|
|
45
|
+
/** Returns a list of era identifiers for the calendar. */
|
|
46
|
+
getEras(): string[];
|
|
47
|
+
/**
|
|
48
|
+
* Returns the minimum month number of the given date's year.
|
|
49
|
+
* Normally, this is 1, but in some calendars such as the Japanese,
|
|
50
|
+
* eras may begin in the middle of a year.
|
|
51
|
+
*/
|
|
52
|
+
getMinimumMonthInYear?(date: AnyCalendarDate): number;
|
|
53
|
+
/**
|
|
54
|
+
* Returns the minimum day number of the given date's month.
|
|
55
|
+
* Normally, this is 1, but in some calendars such as the Japanese,
|
|
56
|
+
* eras may begin in the middle of a month.
|
|
57
|
+
*/
|
|
58
|
+
getMinimumDayInMonth?(date: AnyCalendarDate): number;
|
|
59
|
+
/** Returns the maximum months across all years. */
|
|
60
|
+
getMaximumMonthsInYear(): number;
|
|
61
|
+
/** Returns the maximum days across all months. */
|
|
62
|
+
getMaximumDaysInMonth(): number;
|
|
63
|
+
/**
|
|
64
|
+
* Returns a date that is the first day of the month for the given date.
|
|
65
|
+
* This is used to determine the month that the given date falls in, if
|
|
66
|
+
* the calendar has months that do not align with the standard calendar months
|
|
67
|
+
* (e.g. fiscal calendars).
|
|
68
|
+
*/
|
|
69
|
+
getFormattableMonth?(date: AnyCalendarDate): CalendarDate;
|
|
70
|
+
/** Returns whether the given calendar is the same as this calendar. */
|
|
71
|
+
isEqual?(calendar: Calendar): boolean;
|
|
72
|
+
/** @private */
|
|
73
|
+
balanceDate?(date: AnyCalendarDate): void;
|
|
74
|
+
/** @private */
|
|
75
|
+
balanceYearMonth?(date: AnyCalendarDate, previousDate: AnyCalendarDate): void;
|
|
76
|
+
/** @private */
|
|
77
|
+
constrainDate?(date: AnyCalendarDate): void;
|
|
78
|
+
/** @private */
|
|
79
|
+
isInverseEra?(date: AnyCalendarDate): boolean;
|
|
80
|
+
}
|
|
81
|
+
/** Represents an amount of time in calendar-specific units, for use when performing arithmetic. */
|
|
82
|
+
interface DateDuration {
|
|
83
|
+
/** The number of years to add or subtract. */
|
|
84
|
+
years?: number;
|
|
85
|
+
/** The number of months to add or subtract. */
|
|
86
|
+
months?: number;
|
|
87
|
+
/** The number of weeks to add or subtract. */
|
|
88
|
+
weeks?: number;
|
|
89
|
+
/** The number of days to add or subtract. */
|
|
90
|
+
days?: number;
|
|
91
|
+
}
|
|
92
|
+
/** Represents an amount of time, for use whe performing arithmetic. */
|
|
93
|
+
interface TimeDuration {
|
|
94
|
+
/** The number of hours to add or subtract. */
|
|
95
|
+
hours?: number;
|
|
96
|
+
/** The number of minutes to add or subtract. */
|
|
97
|
+
minutes?: number;
|
|
98
|
+
/** The number of seconds to add or subtract. */
|
|
99
|
+
seconds?: number;
|
|
100
|
+
/** The number of milliseconds to add or subtract. */
|
|
101
|
+
milliseconds?: number;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Represents an amount of time with both date and time components, for use when performing
|
|
105
|
+
* arithmetic.
|
|
106
|
+
*/
|
|
107
|
+
interface DateTimeDuration extends DateDuration, TimeDuration {}
|
|
108
|
+
interface DateFields {
|
|
109
|
+
era?: string;
|
|
110
|
+
year?: number;
|
|
111
|
+
month?: number;
|
|
112
|
+
day?: number;
|
|
113
|
+
}
|
|
114
|
+
interface TimeFields {
|
|
115
|
+
hour?: number;
|
|
116
|
+
minute?: number;
|
|
117
|
+
second?: number;
|
|
118
|
+
millisecond?: number;
|
|
119
|
+
}
|
|
120
|
+
type DateField = keyof DateFields;
|
|
121
|
+
type TimeField = keyof TimeFields;
|
|
122
|
+
type Disambiguation = "compatible" | "earlier" | "later" | "reject";
|
|
123
|
+
interface CycleOptions {
|
|
124
|
+
/** Whether to round the field value to the nearest interval of the amount. */
|
|
125
|
+
round?: boolean;
|
|
126
|
+
}
|
|
127
|
+
interface CycleTimeOptions extends CycleOptions {
|
|
128
|
+
/**
|
|
129
|
+
* Whether to use 12 or 24 hour time. If 12 hour time is chosen, the resulting value
|
|
130
|
+
* will remain in the same day period as the original value (e.g. if the value is AM,
|
|
131
|
+
* the resulting value also be AM).
|
|
132
|
+
*
|
|
133
|
+
* @default 24
|
|
134
|
+
*/
|
|
135
|
+
hourCycle?: 12 | 24;
|
|
136
|
+
}
|
|
137
|
+
//#endregion
|
|
138
|
+
export { AnyCalendarDate, AnyDateTime, AnyTime, Calendar, CalendarIdentifier, CycleOptions, CycleTimeOptions, DateDuration, DateField, DateFields, DateTimeDuration, Disambiguation, TimeDuration, TimeField, TimeFields };
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
//#region src/date/weekStartData.ts
|
|
2
|
+
const weekStartData = {
|
|
3
|
+
"001": 1,
|
|
4
|
+
AD: 1,
|
|
5
|
+
AE: 6,
|
|
6
|
+
AF: 6,
|
|
7
|
+
AI: 1,
|
|
8
|
+
AL: 1,
|
|
9
|
+
AM: 1,
|
|
10
|
+
AN: 1,
|
|
11
|
+
AR: 1,
|
|
12
|
+
AT: 1,
|
|
13
|
+
AU: 1,
|
|
14
|
+
AX: 1,
|
|
15
|
+
AZ: 1,
|
|
16
|
+
BA: 1,
|
|
17
|
+
BE: 1,
|
|
18
|
+
BG: 1,
|
|
19
|
+
BH: 6,
|
|
20
|
+
BM: 1,
|
|
21
|
+
BN: 1,
|
|
22
|
+
BY: 1,
|
|
23
|
+
CH: 1,
|
|
24
|
+
CL: 1,
|
|
25
|
+
CM: 1,
|
|
26
|
+
CN: 1,
|
|
27
|
+
CR: 1,
|
|
28
|
+
CY: 1,
|
|
29
|
+
CZ: 1,
|
|
30
|
+
DE: 1,
|
|
31
|
+
DJ: 6,
|
|
32
|
+
DK: 1,
|
|
33
|
+
DZ: 6,
|
|
34
|
+
EC: 1,
|
|
35
|
+
EE: 1,
|
|
36
|
+
EG: 6,
|
|
37
|
+
ES: 1,
|
|
38
|
+
FI: 1,
|
|
39
|
+
FJ: 1,
|
|
40
|
+
FO: 1,
|
|
41
|
+
FR: 1,
|
|
42
|
+
GB: 1,
|
|
43
|
+
GE: 1,
|
|
44
|
+
GF: 1,
|
|
45
|
+
GP: 1,
|
|
46
|
+
GR: 1,
|
|
47
|
+
HR: 1,
|
|
48
|
+
HU: 1,
|
|
49
|
+
IE: 1,
|
|
50
|
+
IQ: 6,
|
|
51
|
+
IR: 6,
|
|
52
|
+
IS: 1,
|
|
53
|
+
IT: 1,
|
|
54
|
+
JO: 6,
|
|
55
|
+
KG: 1,
|
|
56
|
+
KW: 6,
|
|
57
|
+
KZ: 1,
|
|
58
|
+
LB: 1,
|
|
59
|
+
LI: 1,
|
|
60
|
+
LK: 1,
|
|
61
|
+
LT: 1,
|
|
62
|
+
LU: 1,
|
|
63
|
+
LV: 1,
|
|
64
|
+
LY: 6,
|
|
65
|
+
MC: 1,
|
|
66
|
+
MD: 1,
|
|
67
|
+
ME: 1,
|
|
68
|
+
MK: 1,
|
|
69
|
+
MN: 1,
|
|
70
|
+
MQ: 1,
|
|
71
|
+
MV: 5,
|
|
72
|
+
MY: 1,
|
|
73
|
+
NL: 1,
|
|
74
|
+
NO: 1,
|
|
75
|
+
NZ: 1,
|
|
76
|
+
OM: 6,
|
|
77
|
+
PL: 1,
|
|
78
|
+
QA: 6,
|
|
79
|
+
RE: 1,
|
|
80
|
+
RO: 1,
|
|
81
|
+
RS: 1,
|
|
82
|
+
RU: 1,
|
|
83
|
+
SD: 6,
|
|
84
|
+
SE: 1,
|
|
85
|
+
SI: 1,
|
|
86
|
+
SK: 1,
|
|
87
|
+
SM: 1,
|
|
88
|
+
SY: 6,
|
|
89
|
+
TJ: 1,
|
|
90
|
+
TM: 1,
|
|
91
|
+
TR: 1,
|
|
92
|
+
UA: 1,
|
|
93
|
+
UY: 1,
|
|
94
|
+
UZ: 1,
|
|
95
|
+
VA: 1,
|
|
96
|
+
VN: 1,
|
|
97
|
+
XK: 1
|
|
98
|
+
};
|
|
99
|
+
//#endregion
|
|
100
|
+
export { weekStartData };
|