@fragiola/primitives 0.0.0-stage → 0.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/CHANGELOG.md +63 -0
- package/LICENSE +21 -0
- package/README.md +50 -2
- package/dist/async-list-Bv6ff5Oj.js +81 -0
- package/dist/async-list-Bv6ff5Oj.js.map +1 -0
- package/dist/async-list.d.ts +2 -0
- package/dist/async-list.js +1 -0
- package/dist/calendar-keys-DGYpjLwv.d.ts +12 -0
- package/dist/calendar-system-B5U5HcPQ.d.ts +415 -0
- package/dist/calendar-systems-Daa6Q_ca.js +659 -0
- package/dist/calendar-systems-Daa6Q_ca.js.map +1 -0
- package/dist/calendar-systems.d.ts +3 -0
- package/dist/calendar-systems.js +1 -0
- package/dist/carousel-LRbWqbAx.js +375 -0
- package/dist/carousel-LRbWqbAx.js.map +1 -0
- package/dist/carousel.d.ts +2 -0
- package/dist/carousel.js +1 -0
- package/dist/cascade-B155Xvvv.js +64 -0
- package/dist/cascade-B155Xvvv.js.map +1 -0
- package/dist/cascade.d.ts +2 -0
- package/dist/cascade.js +1 -0
- package/dist/clipboard-Cy2cbGEW.js +33 -0
- package/dist/clipboard-Cy2cbGEW.js.map +1 -0
- package/dist/clipboard.d.ts +2 -0
- package/dist/clipboard.js +1 -0
- package/dist/collection-Dbk-PB5S.js +609 -0
- package/dist/collection-Dbk-PB5S.js.map +1 -0
- package/dist/collection.d.ts +2 -0
- package/dist/collection.js +3 -0
- package/dist/color-sURV5Irg.js +699 -0
- package/dist/color-sURV5Irg.js.map +1 -0
- package/dist/color.d.ts +2 -0
- package/dist/color.js +1 -0
- package/dist/command-DueCXi65.js +104 -0
- package/dist/command-DueCXi65.js.map +1 -0
- package/dist/command.d.ts +2 -0
- package/dist/command.js +1 -0
- package/dist/date-CrbFSJKQ.js +215 -0
- package/dist/date-CrbFSJKQ.js.map +1 -0
- package/dist/date.d.ts +4 -0
- package/dist/date.js +1 -0
- package/dist/direction-CTnVLpmd.d.ts +8 -0
- package/dist/direction-DJDPvnxJ.js +13 -0
- package/dist/direction-DJDPvnxJ.js.map +1 -0
- package/dist/direction.d.ts +2 -0
- package/dist/direction.js +1 -0
- package/dist/drag-session-CSr06B5v.js +41 -0
- package/dist/drag-session-CSr06B5v.js.map +1 -0
- package/dist/file-DSLtfzbi.js +263 -0
- package/dist/file-DSLtfzbi.js.map +1 -0
- package/dist/file.d.ts +2 -0
- package/dist/file.js +1 -0
- package/dist/focus-BI-VvM0f.js +75 -0
- package/dist/focus-BI-VvM0f.js.map +1 -0
- package/dist/focus.d.ts +2 -0
- package/dist/focus.js +3 -0
- package/dist/form-DovwKtqz.js +501 -0
- package/dist/form-DovwKtqz.js.map +1 -0
- package/dist/form.d.ts +2 -0
- package/dist/form.js +1 -0
- package/dist/hover-BakyPYnC.js +62 -0
- package/dist/hover-BakyPYnC.js.map +1 -0
- package/dist/hover.d.ts +2 -0
- package/dist/hover.js +1 -0
- package/dist/id-B0Y8iZrc.js +13 -0
- package/dist/id-B0Y8iZrc.js.map +1 -0
- package/dist/id.d.ts +2 -0
- package/dist/id.js +1 -0
- package/dist/image-D4X_yRYw.js +44 -0
- package/dist/image-D4X_yRYw.js.map +1 -0
- package/dist/image.d.ts +2 -0
- package/dist/image.js +1 -0
- package/dist/index-B0rwIZw9.d.ts +51 -0
- package/dist/index-B4wF1isn.d.ts +128 -0
- package/dist/index-BHiBRE01.d.ts +20 -0
- package/dist/index-BNlMm-0u.d.ts +17 -0
- package/dist/index-BapNrjY9.d.ts +48 -0
- package/dist/index-Bd-tVb7C.d.ts +6 -0
- package/dist/index-BjE8nDiX.d.ts +125 -0
- package/dist/index-BpbT-FsX.d.ts +117 -0
- package/dist/index-CBgGcTeX.d.ts +37 -0
- package/dist/index-CGThV_Md.d.ts +100 -0
- package/dist/index-CMig3TXL.d.ts +28 -0
- package/dist/index-CWFRduRd.d.ts +212 -0
- package/dist/index-CkrHWyU_.d.ts +33 -0
- package/dist/index-Cwu6f7y1.d.ts +18 -0
- package/dist/index-D10LDdR6.d.ts +139 -0
- package/dist/index-D146vm21.d.ts +104 -0
- package/dist/index-DGKhEvNr.d.ts +107 -0
- package/dist/index-DbAu4s16.d.ts +48 -0
- package/dist/index-DdaCj6IO.d.ts +54 -0
- package/dist/index-DeHcNdjC.d.ts +68 -0
- package/dist/index-DeR4ncrW.d.ts +93 -0
- package/dist/index-HIksgK0e.d.ts +70 -0
- package/dist/index-IZB0mlZl.d.ts +71 -0
- package/dist/index-IfDZj87U.d.ts +28 -0
- package/dist/index-SrTuVBms.d.ts +75 -0
- package/dist/index-T9UcYvkf.d.ts +339 -0
- package/dist/index-fRTojAoR.d.ts +31 -0
- package/dist/index-fuLUke9n.d.ts +6 -0
- package/dist/index-l63esAck.d.ts +104 -0
- package/dist/index-raSUg9U7.d.ts +38 -0
- package/dist/index-twgzPKvZ.d.ts +278 -0
- package/dist/index-wBpjRykh.d.ts +125 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.js +42 -0
- package/dist/inert-DlGToy3q.js +80 -0
- package/dist/inert-DlGToy3q.js.map +1 -0
- package/dist/inert.d.ts +2 -0
- package/dist/inert.js +1 -0
- package/dist/layer-stack-BEtzaFC1.js +118 -0
- package/dist/layer-stack-BEtzaFC1.js.map +1 -0
- package/dist/layers-C-N4rrZX.js +24 -0
- package/dist/layers-C-N4rrZX.js.map +1 -0
- package/dist/layers.d.ts +2 -0
- package/dist/layers.js +3 -0
- package/dist/list-navigation-CbWv4DK5.js +40 -0
- package/dist/list-navigation-CbWv4DK5.js.map +1 -0
- package/dist/month-year-BG5imFUq.js +108 -0
- package/dist/month-year-BG5imFUq.js.map +1 -0
- package/dist/month-year.d.ts +3 -0
- package/dist/month-year.js +1 -0
- package/dist/number-BFUio97d.js +316 -0
- package/dist/number-BFUio97d.js.map +1 -0
- package/dist/number.d.ts +2 -0
- package/dist/number.js +1 -0
- package/dist/overlay-BwPyiM3T.js +78 -0
- package/dist/overlay-BwPyiM3T.js.map +1 -0
- package/dist/overlay.d.ts +2 -0
- package/dist/overlay.js +1 -0
- package/dist/pagination-BkVzaIGP.js +51 -0
- package/dist/pagination-BkVzaIGP.js.map +1 -0
- package/dist/pagination.d.ts +2 -0
- package/dist/pagination.js +1 -0
- package/dist/plain-date-idQH1P6X.d.ts +29 -0
- package/dist/plain-date-time-B8PGahhe.d.ts +99 -0
- package/dist/pointer-CuDtD9XA.js +189 -0
- package/dist/pointer-CuDtD9XA.js.map +1 -0
- package/dist/pointer.d.ts +2 -0
- package/dist/pointer.js +3 -0
- package/dist/positioning-DDUQ75mB.js +148 -0
- package/dist/positioning-DDUQ75mB.js.map +1 -0
- package/dist/positioning.d.ts +2 -0
- package/dist/positioning.js +1 -0
- package/dist/presence-BhKDOmII.js +86 -0
- package/dist/presence-BhKDOmII.js.map +1 -0
- package/dist/presence.d.ts +2 -0
- package/dist/presence.js +1 -0
- package/dist/range-o0_GBhyY.js +158 -0
- package/dist/range-o0_GBhyY.js.map +1 -0
- package/dist/range.d.ts +2 -0
- package/dist/range.js +1 -0
- package/dist/scroll-area-BYNhv36t.js +447 -0
- package/dist/scroll-area-BYNhv36t.js.map +1 -0
- package/dist/scroll-area.d.ts +2 -0
- package/dist/scroll-area.js +1 -0
- package/dist/scroll-lock-JzRNOA1O.js +42 -0
- package/dist/scroll-lock-JzRNOA1O.js.map +1 -0
- package/dist/scroll-lock.d.ts +2 -0
- package/dist/scroll-lock.js +1 -0
- package/dist/segments-eRu5G_Bd.js +587 -0
- package/dist/segments-eRu5G_Bd.js.map +1 -0
- package/dist/segments.d.ts +3 -0
- package/dist/segments.js +1 -0
- package/dist/selection-Cor67w_V.js +287 -0
- package/dist/selection-Cor67w_V.js.map +1 -0
- package/dist/selection.d.ts +2 -0
- package/dist/selection.js +1 -0
- package/dist/swipe.d.ts +2 -0
- package/dist/swipe.js +1 -0
- package/dist/tabbable-BPiLssIv.js +35 -0
- package/dist/tabbable-BPiLssIv.js.map +1 -0
- package/dist/time-Ct6oq9kt.js +208 -0
- package/dist/time-Ct6oq9kt.js.map +1 -0
- package/dist/time-zone-DegkzwST.js +305 -0
- package/dist/time-zone-DegkzwST.js.map +1 -0
- package/dist/time-zone.d.ts +2 -0
- package/dist/time-zone.js +1 -0
- package/dist/time.d.ts +2 -0
- package/dist/time.js +1 -0
- package/dist/toast-BjRpJalM.js +400 -0
- package/dist/toast-BjRpJalM.js.map +1 -0
- package/dist/toast.d.ts +2 -0
- package/dist/toast.js +1 -0
- package/dist/unit-grid-DJy8lb5D.d.ts +21 -0
- package/dist/virtual-BlX1RuHD.js +306 -0
- package/dist/virtual-BlX1RuHD.js.map +1 -0
- package/dist/virtual.d.ts +2 -0
- package/dist/virtual.js +1 -0
- package/dist/watch-swipe-BIucfr9O.js +301 -0
- package/dist/watch-swipe-BIucfr9O.js.map +1 -0
- package/package.json +234 -3
|
@@ -0,0 +1,659 @@
|
|
|
1
|
+
// src/calendar-systems/epoch-day.ts
|
|
2
|
+
const DAY = 864e5;
|
|
3
|
+
/** A UTC `Date` at midnight of an ISO date, years 0–99 included (`Date.UTC` reads them as 19xx). */
|
|
4
|
+
function utcMidnight(date) {
|
|
5
|
+
const utc = /* @__PURE__ */ new Date(0);
|
|
6
|
+
utc.setUTCFullYear(date.year, date.month - 1, date.day);
|
|
7
|
+
return utc;
|
|
8
|
+
}
|
|
9
|
+
/** The days from 1970-01-01 to an ISO date. */
|
|
10
|
+
function toEpochDay(date) {
|
|
11
|
+
return Math.round(utcMidnight(date).getTime() / DAY);
|
|
12
|
+
}
|
|
13
|
+
/** The date `days` later (the `/date` math, kept here: this entry imports no other's code). */
|
|
14
|
+
function addDays(date, days) {
|
|
15
|
+
return fromEpochDay(toEpochDay(date) + days);
|
|
16
|
+
}
|
|
17
|
+
/** The first day of the date's week, given the locale's first day (0 = Sunday). */
|
|
18
|
+
function startOfWeek(date, firstDayOfWeek) {
|
|
19
|
+
const day = toEpochDay(date);
|
|
20
|
+
return fromEpochDay(day - (((day + 4) % 7 + 7) % 7 - firstDayOfWeek + 7) % 7);
|
|
21
|
+
}
|
|
22
|
+
/** The ISO date `days` after 1970-01-01. */
|
|
23
|
+
function fromEpochDay(days) {
|
|
24
|
+
const utc = /* @__PURE__ */ new Date(days * DAY);
|
|
25
|
+
return {
|
|
26
|
+
year: utc.getUTCFullYear(),
|
|
27
|
+
month: utc.getUTCMonth() + 1,
|
|
28
|
+
day: utc.getUTCDate()
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
// src/calendar-systems/calendar-units.ts
|
|
32
|
+
const pad = (value, size) => String(Math.abs(value)).padStart(size, "0");
|
|
33
|
+
function isoText(date, id) {
|
|
34
|
+
return `${date.year < 0 ? "-" : ""}${pad(date.year, 4)}-${pad(date.month, 2)}-${pad(date.day, 2)}[u-ca=${id}]`;
|
|
35
|
+
}
|
|
36
|
+
/** Today, in the page's local time. */
|
|
37
|
+
function localToday() {
|
|
38
|
+
const now = /* @__PURE__ */ new Date();
|
|
39
|
+
return {
|
|
40
|
+
year: now.getFullYear(),
|
|
41
|
+
month: now.getMonth() + 1,
|
|
42
|
+
day: now.getDate()
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function between(first, next) {
|
|
46
|
+
const start = toEpochDay(first);
|
|
47
|
+
return Array.from({ length: toEpochDay(next) - start }, (_, offset) => fromEpochDay(start + offset));
|
|
48
|
+
}
|
|
49
|
+
/** The enabled day of `days` nearest to `place`. */
|
|
50
|
+
function nearestDay(days, place, enabled) {
|
|
51
|
+
const at = toEpochDay(place);
|
|
52
|
+
const distance = (date) => Math.abs(toEpochDay(date) - at);
|
|
53
|
+
return days.filter(enabled).sort((a, b) => distance(a) - distance(b))[0];
|
|
54
|
+
}
|
|
55
|
+
/** A year page's size: 12 years from a multiple of 12, as the ISO calendar's (`/month-year`). */
|
|
56
|
+
const YEARS = 12;
|
|
57
|
+
/** A page of `count` items from `start`, in rows of `columns`. */
|
|
58
|
+
function rowsOf(start, count, columns) {
|
|
59
|
+
const size = Math.max(1, Math.floor(columns));
|
|
60
|
+
const rows = [];
|
|
61
|
+
for (let offset = 0; offset < count; offset += size) rows.push(Array.from({ length: Math.min(size, count - offset) }, (_, column) => start + offset + column));
|
|
62
|
+
return rows;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The item a key moves to on a page (`/month-year`'s `unitKeyTarget`, kept here: this entry
|
|
66
|
+
* imports no other's code), Page Up and Down by `pageMove`.
|
|
67
|
+
*/
|
|
68
|
+
function pagedKeyTarget(key, focused, { rtl, columns }, page, count, pageMove) {
|
|
69
|
+
const size = Math.max(1, Math.floor(columns));
|
|
70
|
+
const rowStart = page + Math.floor((focused - page) / size) * size;
|
|
71
|
+
switch (key) {
|
|
72
|
+
case "ArrowRight": return focused + (rtl ? -1 : 1);
|
|
73
|
+
case "ArrowLeft": return focused + (rtl ? 1 : -1);
|
|
74
|
+
case "ArrowDown": return focused + size;
|
|
75
|
+
case "ArrowUp": return focused - size;
|
|
76
|
+
case "Home": return rowStart;
|
|
77
|
+
case "End": return Math.min(rowStart + size, page + count) - 1;
|
|
78
|
+
case "PageDown": return pageMove(1);
|
|
79
|
+
case "PageUp": return pageMove(-1);
|
|
80
|
+
default: return null;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/** The months of a system, a page being one of its years. */
|
|
84
|
+
function monthUnits(system) {
|
|
85
|
+
const yearStart = (index) => system.monthIndex({
|
|
86
|
+
year: system.fromMonthIndex(index).year,
|
|
87
|
+
month: 1
|
|
88
|
+
});
|
|
89
|
+
const pageSize = (start) => system.monthsInYear(system.fromMonthIndex(start).year);
|
|
90
|
+
const first = (index) => system.monthStart(system.fromMonthIndex(index));
|
|
91
|
+
const fromDate = (date) => system.monthIndex(system.yearMonthOf(date));
|
|
92
|
+
return {
|
|
93
|
+
index: (item) => system.monthIndex({
|
|
94
|
+
year: item.year,
|
|
95
|
+
month: item.month ?? 1
|
|
96
|
+
}),
|
|
97
|
+
item: (index) => system.fromMonthIndex(index),
|
|
98
|
+
pageStart: yearStart,
|
|
99
|
+
pageSize,
|
|
100
|
+
page: (start, delta) => delta > 0 ? start + pageSize(start) : yearStart(start - 1),
|
|
101
|
+
today: () => fromDate(localToday()),
|
|
102
|
+
rows: (start, columns) => rowsOf(start, pageSize(start), columns),
|
|
103
|
+
keyTarget: (key, focused, options) => {
|
|
104
|
+
const page = yearStart(focused);
|
|
105
|
+
return pagedKeyTarget(key, focused, options, page, pageSize(page), (delta) => system.monthIndex(system.yearMonthOf(system.addYears(first(focused), delta))));
|
|
106
|
+
},
|
|
107
|
+
fromDate,
|
|
108
|
+
days: (index) => between(first(index), first(index + 1)),
|
|
109
|
+
nearest: (index, focused, enabled) => nearestDay(between(first(index), first(index + 1)), system.fromFields({
|
|
110
|
+
...system.fromMonthIndex(index),
|
|
111
|
+
day: system.fields(focused).day
|
|
112
|
+
}), enabled),
|
|
113
|
+
text: (locale, index) => system.format(locale, first(index), { month: "long" }),
|
|
114
|
+
name: (locale, index) => system.format(locale, first(index), {
|
|
115
|
+
month: "long",
|
|
116
|
+
year: "numeric"
|
|
117
|
+
}),
|
|
118
|
+
heading: (locale, start) => system.format(locale, first(start), { year: "numeric" }),
|
|
119
|
+
iso: (index) => isoText(first(index), system.id)
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
/** The years of a system, in pages of 12 from a multiple of 12. */
|
|
123
|
+
function yearUnits(system) {
|
|
124
|
+
const first = (year) => system.monthStart({
|
|
125
|
+
year,
|
|
126
|
+
month: 1
|
|
127
|
+
});
|
|
128
|
+
const pageStart = (year) => Math.floor(year / YEARS) * YEARS;
|
|
129
|
+
const fromDate = (date) => system.fields(date).year;
|
|
130
|
+
return {
|
|
131
|
+
index: (item) => item.year,
|
|
132
|
+
item: (index) => ({ year: index }),
|
|
133
|
+
pageStart,
|
|
134
|
+
pageSize: () => YEARS,
|
|
135
|
+
page: (start, delta) => start + delta * YEARS,
|
|
136
|
+
today: () => fromDate(localToday()),
|
|
137
|
+
rows: (start, columns) => rowsOf(start, YEARS, columns),
|
|
138
|
+
keyTarget: (key, focused, options) => pagedKeyTarget(key, focused, options, pageStart(focused), YEARS, (delta) => focused + delta * YEARS),
|
|
139
|
+
fromDate,
|
|
140
|
+
days: (year) => between(first(year), first(year + 1)),
|
|
141
|
+
nearest: (year, focused, enabled) => nearestDay(between(first(year), first(year + 1)), system.addYears(focused, year - system.fields(focused).year), enabled),
|
|
142
|
+
text: (locale, year) => system.format(locale, first(year), { year: "numeric" }),
|
|
143
|
+
name: (locale, year) => system.format(locale, first(year), { year: "numeric" }),
|
|
144
|
+
heading: (locale, start) => system.formatRange(locale, first(start), first(start + YEARS - 1), { year: "numeric" }),
|
|
145
|
+
iso: (year) => isoText(first(year), system.id)
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
// src/calendar-systems/segment-hooks.ts
|
|
149
|
+
/** The system of a format the hooks are called through. */
|
|
150
|
+
function systemOf(format) {
|
|
151
|
+
return format.calendar;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* The arithmetic year of the values: the year segment is an era's year where the era is edited
|
|
155
|
+
* (the current era while it is a placeholder), else the system's year; `undefined` while the
|
|
156
|
+
* year is a placeholder.
|
|
157
|
+
*/
|
|
158
|
+
function calendarYear(format, values) {
|
|
159
|
+
if (values.year === void 0) return;
|
|
160
|
+
return format.eras ? systemOf(format).yearOfEra(values.era ?? format.eras.length - 1, values.year) : values.year;
|
|
161
|
+
}
|
|
162
|
+
/** The values' year, or a year of the system's longest months while it is a placeholder. */
|
|
163
|
+
function sampleYear(format, values) {
|
|
164
|
+
return calendarYear(format, values) ?? systemOf(format).referenceYear();
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* The format in the system: its era is editable where the system has several (a Japanese date's),
|
|
168
|
+
* with the eras' names (`era: "short"`), oldest first.
|
|
169
|
+
*/
|
|
170
|
+
function segmentCalendarFormat(format) {
|
|
171
|
+
const system = systemOf(format);
|
|
172
|
+
const count = system.eraCount();
|
|
173
|
+
const editable = format.types;
|
|
174
|
+
const types = format.parts.map((part) => part.type).filter((type) => type === "era" ? count > 1 : editable.includes(type));
|
|
175
|
+
return {
|
|
176
|
+
...format,
|
|
177
|
+
types,
|
|
178
|
+
eras: types.includes("era") ? Array.from({ length: count }, (_, era) => system.eraName(format.locale, era)) : void 0
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
/** The range of the era, the month (13 in a Hebrew leap year) and the day; none for the time. */
|
|
182
|
+
function segmentCalendarRange(format, values, type) {
|
|
183
|
+
const system = systemOf(format);
|
|
184
|
+
switch (type) {
|
|
185
|
+
case "era": return {
|
|
186
|
+
min: 0,
|
|
187
|
+
max: (format.eras?.length ?? 1) - 1,
|
|
188
|
+
digits: 0
|
|
189
|
+
};
|
|
190
|
+
case "month": return {
|
|
191
|
+
min: 1,
|
|
192
|
+
max: system.monthsInYear(sampleYear(format, values)),
|
|
193
|
+
digits: 2
|
|
194
|
+
};
|
|
195
|
+
case "day": {
|
|
196
|
+
if (values.month === void 0) return {
|
|
197
|
+
min: 1,
|
|
198
|
+
max: 31,
|
|
199
|
+
digits: 2
|
|
200
|
+
};
|
|
201
|
+
const year = sampleYear(format, values);
|
|
202
|
+
return {
|
|
203
|
+
min: 1,
|
|
204
|
+
max: system.daysInMonth(year, Math.min(values.month, system.monthsInYear(year))),
|
|
205
|
+
digits: 2
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
default: return;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* The values, completed where they are placeholders, as the UTC date `Intl` formats: the longest
|
|
213
|
+
* year (a day set with no year keeps the longest month), an era set with no year its second year
|
|
214
|
+
* (wholly in it).
|
|
215
|
+
*/
|
|
216
|
+
function segmentCalendarSample(format, values) {
|
|
217
|
+
const system = systemOf(format);
|
|
218
|
+
const date = utcMidnight(system.fromFields({
|
|
219
|
+
year: calendarYear(format, values) ?? (values.era === void 0 ? system.referenceYear() : system.yearOfEra(values.era, 2)),
|
|
220
|
+
month: values.month ?? 1,
|
|
221
|
+
day: values.day ?? 1
|
|
222
|
+
}));
|
|
223
|
+
date.setUTCHours(values.hour ?? (values.dayPeriod === 1 ? 12 : 0), values.minute ?? 0, values.second ?? 0);
|
|
224
|
+
return date;
|
|
225
|
+
}
|
|
226
|
+
/** A value with its ISO date as the system's fields (the era's year where the era is edited). */
|
|
227
|
+
function segmentCalendarFields(format, value) {
|
|
228
|
+
if (value.year === void 0 || value.month === void 0 || value.day === void 0) return value;
|
|
229
|
+
const fields = systemOf(format).fields(value);
|
|
230
|
+
return {
|
|
231
|
+
...value,
|
|
232
|
+
era: fields.era,
|
|
233
|
+
year: format.eras ? fields.eraYear : fields.year,
|
|
234
|
+
month: fields.month,
|
|
235
|
+
day: fields.day
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
/** The ISO date of the values' fields; `null` while a date segment is a placeholder. */
|
|
239
|
+
function segmentCalendarDate(format, values) {
|
|
240
|
+
const year = calendarYear(format, values);
|
|
241
|
+
const { month, day } = values;
|
|
242
|
+
return year === void 0 || month === void 0 || day === void 0 ? null : systemOf(format).fromFields({
|
|
243
|
+
year,
|
|
244
|
+
month,
|
|
245
|
+
day
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
// src/calendar-systems/calendar-system.ts
|
|
249
|
+
/** The longest-months year near the system's year of 2000-01-01, searched over a 19-year cycle. */
|
|
250
|
+
function longestYear(engine) {
|
|
251
|
+
const base = engine.fields(toEpochDay({
|
|
252
|
+
year: 2e3,
|
|
253
|
+
month: 1,
|
|
254
|
+
day: 1
|
|
255
|
+
})).year;
|
|
256
|
+
let best = base;
|
|
257
|
+
let bestDays = -1;
|
|
258
|
+
for (let year = base; year < base + 19; year++) {
|
|
259
|
+
const days = engine.monthStart(year + 1, 1) - engine.monthStart(year, 1);
|
|
260
|
+
if (days > bestDays) {
|
|
261
|
+
best = year;
|
|
262
|
+
bestDays = days;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
return best;
|
|
266
|
+
}
|
|
267
|
+
/** The system's object over an engine: the generic math every component calls. */
|
|
268
|
+
function createCalendarSystem(engine) {
|
|
269
|
+
const { id } = engine;
|
|
270
|
+
let reference;
|
|
271
|
+
const units = {};
|
|
272
|
+
const monthsInYear = (year) => engine.monthsInYear(year);
|
|
273
|
+
const daysInMonth = (year, month) => {
|
|
274
|
+
return (month >= monthsInYear(year) ? engine.monthStart(year + 1, 1) : engine.monthStart(year, month + 1)) - engine.monthStart(year, month);
|
|
275
|
+
};
|
|
276
|
+
const fields = (date) => engine.fields(toEpochDay(date));
|
|
277
|
+
const fromFields = (input) => {
|
|
278
|
+
const year = input.era !== void 0 && input.eraYear !== void 0 ? engine.yearOfEra(input.era, input.eraYear) : input.year ?? 1;
|
|
279
|
+
const month = Math.min(Math.max(1, input.month), monthsInYear(year));
|
|
280
|
+
const day = Math.min(Math.max(1, input.day), daysInMonth(year, month));
|
|
281
|
+
return fromEpochDay(engine.monthStart(year, month) + day - 1);
|
|
282
|
+
};
|
|
283
|
+
const monthIndex = (month) => engine.monthsBefore(month.year) + month.month - 1;
|
|
284
|
+
const fromMonthIndex = (index) => {
|
|
285
|
+
let year = Math.floor(index / 12);
|
|
286
|
+
while (engine.monthsBefore(year) > index) year--;
|
|
287
|
+
while (engine.monthsBefore(year + 1) <= index) year++;
|
|
288
|
+
return {
|
|
289
|
+
year,
|
|
290
|
+
month: index - engine.monthsBefore(year) + 1
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
const yearMonthOf = (date) => {
|
|
294
|
+
const { year, month } = fields(date);
|
|
295
|
+
return {
|
|
296
|
+
year,
|
|
297
|
+
month
|
|
298
|
+
};
|
|
299
|
+
};
|
|
300
|
+
const addMonths = (date, months) => {
|
|
301
|
+
const { day } = fields(date);
|
|
302
|
+
const target = fromMonthIndex(monthIndex(yearMonthOf(date)) + months);
|
|
303
|
+
return fromFields({
|
|
304
|
+
...target,
|
|
305
|
+
day
|
|
306
|
+
});
|
|
307
|
+
};
|
|
308
|
+
const addYears = (date, years) => {
|
|
309
|
+
const { year, month, day } = fields(date);
|
|
310
|
+
const leap = engine.leapMonth;
|
|
311
|
+
let target = month;
|
|
312
|
+
if (leap > 0) {
|
|
313
|
+
const code = monthsInYear(year) > 12 && month >= leap ? month === leap ? leap - .5 : month - 1 : month;
|
|
314
|
+
target = monthsInYear(year + years) > 12 ? code === leap - .5 ? leap : code >= leap ? code + 1 : code : Math.ceil(code);
|
|
315
|
+
}
|
|
316
|
+
return fromFields({
|
|
317
|
+
year: year + years,
|
|
318
|
+
month: target,
|
|
319
|
+
day
|
|
320
|
+
});
|
|
321
|
+
};
|
|
322
|
+
const formatter = (locale, options) => new Intl.DateTimeFormat(system.locale(locale), {
|
|
323
|
+
...options,
|
|
324
|
+
timeZone: "UTC"
|
|
325
|
+
});
|
|
326
|
+
const startOfMonth = (date) => fromFields({
|
|
327
|
+
...yearMonthOf(date),
|
|
328
|
+
day: 1
|
|
329
|
+
});
|
|
330
|
+
const system = {
|
|
331
|
+
id,
|
|
332
|
+
locale: (locale) => new Intl.Locale(locale, { calendar: id }).toString(),
|
|
333
|
+
fields,
|
|
334
|
+
fromFields,
|
|
335
|
+
eraCount: () => engine.eraCount(),
|
|
336
|
+
yearOfEra: (era, eraYear) => engine.yearOfEra(era, eraYear),
|
|
337
|
+
eraName: (locale, era) => formatter(locale, {
|
|
338
|
+
era: "short",
|
|
339
|
+
year: "numeric"
|
|
340
|
+
}).formatToParts(utcMidnight(fromEpochDay(engine.eraSample(era)))).find((part) => part.type === "era")?.value ?? "",
|
|
341
|
+
monthsInYear,
|
|
342
|
+
daysInMonth,
|
|
343
|
+
referenceYear: () => {
|
|
344
|
+
reference ??= longestYear(engine);
|
|
345
|
+
return reference;
|
|
346
|
+
},
|
|
347
|
+
startOfMonth,
|
|
348
|
+
endOfMonth: (date) => {
|
|
349
|
+
const month = yearMonthOf(date);
|
|
350
|
+
return fromFields({
|
|
351
|
+
...month,
|
|
352
|
+
day: daysInMonth(month.year, month.month)
|
|
353
|
+
});
|
|
354
|
+
},
|
|
355
|
+
addMonths,
|
|
356
|
+
addYears,
|
|
357
|
+
monthsBetween: (a, b) => monthIndex(yearMonthOf(b)) - monthIndex(yearMonthOf(a)),
|
|
358
|
+
isSameMonth: (a, b) => monthIndex(yearMonthOf(a)) === monthIndex(yearMonthOf(b)),
|
|
359
|
+
monthGrid: (date, firstDayOfWeek) => {
|
|
360
|
+
let cursor = startOfWeek(startOfMonth(date), firstDayOfWeek);
|
|
361
|
+
return Array.from({ length: 6 }, () => Array.from({ length: 7 }, () => {
|
|
362
|
+
const day = cursor;
|
|
363
|
+
cursor = addDays(cursor, 1);
|
|
364
|
+
return day;
|
|
365
|
+
}));
|
|
366
|
+
},
|
|
367
|
+
keyTarget: (key, focused, { rtl, firstDayOfWeek, shiftKey }) => {
|
|
368
|
+
switch (key) {
|
|
369
|
+
case "ArrowRight": return addDays(focused, rtl ? -1 : 1);
|
|
370
|
+
case "ArrowLeft": return addDays(focused, rtl ? 1 : -1);
|
|
371
|
+
case "ArrowDown": return addDays(focused, 7);
|
|
372
|
+
case "ArrowUp": return addDays(focused, -7);
|
|
373
|
+
case "Home": return startOfWeek(focused, firstDayOfWeek);
|
|
374
|
+
case "End": return addDays(startOfWeek(focused, firstDayOfWeek), 6);
|
|
375
|
+
case "PageDown": return shiftKey ? addYears(focused, 1) : addMonths(focused, 1);
|
|
376
|
+
case "PageUp": return shiftKey ? addYears(focused, -1) : addMonths(focused, -1);
|
|
377
|
+
default: return null;
|
|
378
|
+
}
|
|
379
|
+
},
|
|
380
|
+
monthIndex,
|
|
381
|
+
fromMonthIndex,
|
|
382
|
+
monthStart: (month) => fromFields({
|
|
383
|
+
...month,
|
|
384
|
+
day: 1
|
|
385
|
+
}),
|
|
386
|
+
yearMonthOf,
|
|
387
|
+
fullDate: (locale, date) => formatter(locale, {
|
|
388
|
+
weekday: "long",
|
|
389
|
+
year: "numeric",
|
|
390
|
+
month: "long",
|
|
391
|
+
day: "numeric"
|
|
392
|
+
}).format(utcMidnight(date)),
|
|
393
|
+
format: (locale, date, options) => formatter(locale, options).format(utcMidnight(date)),
|
|
394
|
+
formatRange: (locale, start, end, options) => formatter(locale, options).formatRange(utcMidnight(start), utcMidnight(end)).replace(/[\u00a0\u2009\u202f]/g, " "),
|
|
395
|
+
units: (kind) => {
|
|
396
|
+
units[kind] ??= kind === "month" ? monthUnits(system) : yearUnits(system);
|
|
397
|
+
return units[kind];
|
|
398
|
+
},
|
|
399
|
+
segmentFormat: segmentCalendarFormat,
|
|
400
|
+
segmentRange: segmentCalendarRange,
|
|
401
|
+
segmentSample: segmentCalendarSample,
|
|
402
|
+
segmentValuesOf: segmentCalendarFields,
|
|
403
|
+
segmentsToDate: segmentCalendarDate
|
|
404
|
+
};
|
|
405
|
+
return system;
|
|
406
|
+
}
|
|
407
|
+
// src/calendar-systems/intl-engine.ts
|
|
408
|
+
/**
|
|
409
|
+
* A system computed by `Intl` (spec/calendar-systems.md, "How a system is computed"): ICU does the
|
|
410
|
+
* math, this probes it. A day's year and day of the month come from `formatToParts` in the
|
|
411
|
+
* system (`en`, Latin digits); a month starts on its day 1, a year on its first month; the month
|
|
412
|
+
* starts of each year are found once and cached, so a month's place counts from its year's first
|
|
413
|
+
* month (the Hebrew calendar writes its months by name). `monthsBefore` is the system's rule:
|
|
414
|
+
* 12 months a year, 13 (Coptic, Ethiopic), or the Hebrew 19-year cycle.
|
|
415
|
+
*/
|
|
416
|
+
function intlEngine(id, months, leapMonth = 0) {
|
|
417
|
+
let format;
|
|
418
|
+
const probes = /* @__PURE__ */ new Map();
|
|
419
|
+
const starts = /* @__PURE__ */ new Map();
|
|
420
|
+
let mainEra;
|
|
421
|
+
let meanYear = 0;
|
|
422
|
+
const reference = toEpochDay({
|
|
423
|
+
year: 2e3,
|
|
424
|
+
month: 1,
|
|
425
|
+
day: 1
|
|
426
|
+
});
|
|
427
|
+
const probe = (day) => {
|
|
428
|
+
let found = probes.get(day);
|
|
429
|
+
if (found === void 0) {
|
|
430
|
+
format ??= new Intl.DateTimeFormat(`en-u-ca-${id}-nu-latn`, {
|
|
431
|
+
era: "short",
|
|
432
|
+
year: "numeric",
|
|
433
|
+
month: "numeric",
|
|
434
|
+
day: "numeric",
|
|
435
|
+
timeZone: "UTC"
|
|
436
|
+
});
|
|
437
|
+
const parts = format.formatToParts(utcMidnight(fromEpochDay(day)));
|
|
438
|
+
const value = (type) => parts.find((part) => part.type === type)?.value ?? "";
|
|
439
|
+
found = {
|
|
440
|
+
era: value("era"),
|
|
441
|
+
eraYear: Number(value("year")),
|
|
442
|
+
day: Number(value("day"))
|
|
443
|
+
};
|
|
444
|
+
probes.set(day, found);
|
|
445
|
+
}
|
|
446
|
+
return found;
|
|
447
|
+
};
|
|
448
|
+
const yearOf = (day) => {
|
|
449
|
+
const { era, eraYear } = probe(day);
|
|
450
|
+
mainEra ??= probe(reference).era;
|
|
451
|
+
if (era === mainEra) return eraYear;
|
|
452
|
+
return id === "ethiopic" ? eraYear - 5500 : 1 - eraYear;
|
|
453
|
+
};
|
|
454
|
+
const monthStartOf = (day) => day - probe(day).day + 1;
|
|
455
|
+
const yearStart = (year) => {
|
|
456
|
+
if (meanYear === 0) meanYear = 36524 / (yearOf(reference + 36524) - yearOf(reference));
|
|
457
|
+
let day = reference + Math.round((year - yearOf(reference)) * meanYear);
|
|
458
|
+
while (yearOf(day) < year) day += 20;
|
|
459
|
+
while (yearOf(day) > year) day -= 20;
|
|
460
|
+
let start = monthStartOf(day);
|
|
461
|
+
while (yearOf(start - 1) === year) start = monthStartOf(start - 1);
|
|
462
|
+
return start;
|
|
463
|
+
};
|
|
464
|
+
const monthStarts = (year) => {
|
|
465
|
+
let list = starts.get(year);
|
|
466
|
+
if (list === void 0) {
|
|
467
|
+
list = [];
|
|
468
|
+
for (let start = yearStart(year); yearOf(start) === year; start = monthStartOf(start + 32)) list.push(start);
|
|
469
|
+
starts.set(year, list);
|
|
470
|
+
}
|
|
471
|
+
return list;
|
|
472
|
+
};
|
|
473
|
+
const monthsBefore = (year) => months === "hebrew" ? Math.floor((235 * year - 234) / 19) : months * year;
|
|
474
|
+
return {
|
|
475
|
+
id,
|
|
476
|
+
leapMonth,
|
|
477
|
+
fields: (day) => {
|
|
478
|
+
const year = yearOf(day);
|
|
479
|
+
const list = monthStarts(year);
|
|
480
|
+
let month = 1;
|
|
481
|
+
while (month < list.length && list[month] <= day) month++;
|
|
482
|
+
return {
|
|
483
|
+
era: 0,
|
|
484
|
+
eraYear: year,
|
|
485
|
+
year,
|
|
486
|
+
month,
|
|
487
|
+
day: day - list[month - 1] + 1
|
|
488
|
+
};
|
|
489
|
+
},
|
|
490
|
+
monthStart: (year, month) => {
|
|
491
|
+
const list = monthStarts(year);
|
|
492
|
+
return list[Math.min(Math.max(1, month), list.length) - 1];
|
|
493
|
+
},
|
|
494
|
+
monthsInYear: (year) => monthStarts(year).length,
|
|
495
|
+
monthsBefore,
|
|
496
|
+
eraCount: () => 1,
|
|
497
|
+
yearOfEra: (_era, eraYear) => eraYear,
|
|
498
|
+
eraSample: () => reference
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
// src/calendar-systems/iso-engine.ts
|
|
502
|
+
/**
|
|
503
|
+
* A system with the ISO calendar's months and days (gregory, buddhist, roc, japanese): its year is
|
|
504
|
+
* the ISO year shifted by `offset`, and `eras` splits it (spec/calendar-systems.md, "Systems").
|
|
505
|
+
* With `before` (gregory, roc), the years before the first era count down in an era of their own
|
|
506
|
+
* (1 BC is the year 0).
|
|
507
|
+
*/
|
|
508
|
+
function isoEngine(id, offset, eras, before) {
|
|
509
|
+
const all = () => before ? [{
|
|
510
|
+
start: Number.NEGATIVE_INFINITY,
|
|
511
|
+
year: 0
|
|
512
|
+
}, ...eras()] : eras();
|
|
513
|
+
return {
|
|
514
|
+
id,
|
|
515
|
+
leapMonth: 0,
|
|
516
|
+
fields: (epochDay) => {
|
|
517
|
+
const iso = fromEpochDay(epochDay);
|
|
518
|
+
const year = iso.year + offset;
|
|
519
|
+
const list = all();
|
|
520
|
+
let era = 0;
|
|
521
|
+
for (let index = 1; index < list.length; index++) if (list[index].start <= epochDay) era = index;
|
|
522
|
+
const first = list[era].year;
|
|
523
|
+
return {
|
|
524
|
+
era,
|
|
525
|
+
eraYear: before && era === 0 ? 1 - year : year - first + 1,
|
|
526
|
+
year,
|
|
527
|
+
month: iso.month,
|
|
528
|
+
day: iso.day
|
|
529
|
+
};
|
|
530
|
+
},
|
|
531
|
+
monthStart: (year, month) => toEpochDay({
|
|
532
|
+
year: year - offset,
|
|
533
|
+
month,
|
|
534
|
+
day: 1
|
|
535
|
+
}),
|
|
536
|
+
monthsInYear: () => 12,
|
|
537
|
+
monthsBefore: (year) => year * 12,
|
|
538
|
+
eraCount: () => all().length,
|
|
539
|
+
yearOfEra: (era, eraYear) => {
|
|
540
|
+
const list = all();
|
|
541
|
+
const index = Math.min(Math.max(0, era), list.length - 1);
|
|
542
|
+
return before && index === 0 ? 1 - eraYear : list[index].year + eraYear - 1;
|
|
543
|
+
},
|
|
544
|
+
eraSample: (era) => {
|
|
545
|
+
const list = all();
|
|
546
|
+
const index = Math.min(Math.max(0, era), list.length - 1);
|
|
547
|
+
if (before && index === 0) return toEpochDay({
|
|
548
|
+
year: -offset,
|
|
549
|
+
month: 6,
|
|
550
|
+
day: 1
|
|
551
|
+
});
|
|
552
|
+
const { start } = list[index];
|
|
553
|
+
return Number.isFinite(start) ? start : toEpochDay({
|
|
554
|
+
year: 2e3,
|
|
555
|
+
month: 1,
|
|
556
|
+
day: 1
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
};
|
|
560
|
+
}
|
|
561
|
+
// src/calendar-systems/japanese-eras.ts
|
|
562
|
+
/** The first ISO year whose eras the japanese system computes: Meiji (spec/calendar-systems.md). */
|
|
563
|
+
const FIRST_YEAR = 1868;
|
|
564
|
+
/** The last ISO year scanned for an era change. */
|
|
565
|
+
const LAST_YEAR = 2200;
|
|
566
|
+
let cache;
|
|
567
|
+
/**
|
|
568
|
+
* The Japanese eras from Meiji on, with their first days, read from `Intl` (`era` of the
|
|
569
|
+
* `japanese` calendar): each year's last day is compared with the previous year's, and a change
|
|
570
|
+
* is searched day by day by halves. Computed once, on first use.
|
|
571
|
+
*/
|
|
572
|
+
function japaneseEras() {
|
|
573
|
+
if (cache !== void 0) return cache;
|
|
574
|
+
const format = new Intl.DateTimeFormat("en-u-ca-japanese", {
|
|
575
|
+
era: "short",
|
|
576
|
+
timeZone: "UTC"
|
|
577
|
+
});
|
|
578
|
+
const eraOf = (day) => format.formatToParts(utcMidnight(fromEpochDay(day))).find((part) => part.type === "era")?.value ?? "";
|
|
579
|
+
const eras = [];
|
|
580
|
+
let previous = toEpochDay({
|
|
581
|
+
year: 1867,
|
|
582
|
+
month: 12,
|
|
583
|
+
day: 31
|
|
584
|
+
});
|
|
585
|
+
let previousEra = eraOf(previous);
|
|
586
|
+
for (let year = FIRST_YEAR; year <= LAST_YEAR; year++) {
|
|
587
|
+
const last = toEpochDay({
|
|
588
|
+
year,
|
|
589
|
+
month: 12,
|
|
590
|
+
day: 31
|
|
591
|
+
});
|
|
592
|
+
const era = eraOf(last);
|
|
593
|
+
if (era !== previousEra) {
|
|
594
|
+
let low = previous;
|
|
595
|
+
let high = last;
|
|
596
|
+
while (high - low > 1) {
|
|
597
|
+
const middle = Math.floor((low + high) / 2);
|
|
598
|
+
if (eraOf(middle) === era) high = middle;
|
|
599
|
+
else low = middle;
|
|
600
|
+
}
|
|
601
|
+
eras.push({
|
|
602
|
+
start: high,
|
|
603
|
+
year: fromEpochDay(high).year
|
|
604
|
+
});
|
|
605
|
+
previousEra = era;
|
|
606
|
+
}
|
|
607
|
+
previous = last;
|
|
608
|
+
}
|
|
609
|
+
cache = eras;
|
|
610
|
+
return eras;
|
|
611
|
+
}
|
|
612
|
+
// src/calendar-systems/systems.ts
|
|
613
|
+
const AD = () => [{
|
|
614
|
+
start: toEpochDay({
|
|
615
|
+
year: 1,
|
|
616
|
+
month: 1,
|
|
617
|
+
day: 1
|
|
618
|
+
}),
|
|
619
|
+
year: 1
|
|
620
|
+
}];
|
|
621
|
+
/** The Gregorian calendar (`gregory`): eras BC and AD. */
|
|
622
|
+
const gregory = /* @__PURE__ */ createCalendarSystem(/* @__PURE__ */ isoEngine("gregory", 0, AD, true));
|
|
623
|
+
/** The Thai Buddhist calendar (`buddhist`): the ISO year + 543, era BE. */
|
|
624
|
+
const buddhist = /* @__PURE__ */ createCalendarSystem(/* @__PURE__ */ isoEngine("buddhist", 543, () => [{
|
|
625
|
+
start: Number.NEGATIVE_INFINITY,
|
|
626
|
+
year: 1
|
|
627
|
+
}], false));
|
|
628
|
+
/** The Republic of China calendar (`roc`): the ISO year − 1911, eras before R.O.C. and Minguo. */
|
|
629
|
+
const roc = /* @__PURE__ */ createCalendarSystem(/* @__PURE__ */ isoEngine("roc", -1911, () => [{
|
|
630
|
+
start: toEpochDay({
|
|
631
|
+
year: 1912,
|
|
632
|
+
month: 1,
|
|
633
|
+
day: 1
|
|
634
|
+
}),
|
|
635
|
+
year: 1
|
|
636
|
+
}], true));
|
|
637
|
+
/** The Japanese imperial calendar (`japanese`): the ISO year in eras from Meiji on. */
|
|
638
|
+
const japanese = /* @__PURE__ */ createCalendarSystem(/* @__PURE__ */ isoEngine("japanese", 0, japaneseEras, false));
|
|
639
|
+
/** The Persian (Solar Hijri) calendar (`persian`). */
|
|
640
|
+
const persian = /* @__PURE__ */ createCalendarSystem(/* @__PURE__ */ intlEngine("persian", 12));
|
|
641
|
+
/** The Indian national (Saka) calendar (`indian`). */
|
|
642
|
+
const indian = /* @__PURE__ */ createCalendarSystem(/* @__PURE__ */ intlEngine("indian", 12));
|
|
643
|
+
/** The tabular Islamic calendar, civil epoch (`islamic-civil`). */
|
|
644
|
+
const islamicCivil = /* @__PURE__ */ createCalendarSystem(/* @__PURE__ */ intlEngine("islamic-civil", 12));
|
|
645
|
+
/** The tabular Islamic calendar, astronomical epoch (`islamic-tbla`). */
|
|
646
|
+
const islamicTbla = /* @__PURE__ */ createCalendarSystem(/* @__PURE__ */ intlEngine("islamic-tbla", 12));
|
|
647
|
+
/** The Islamic Umm al-Qura calendar of Saudi Arabia (`islamic-umalqura`). */
|
|
648
|
+
const islamicUmalqura = /* @__PURE__ */ createCalendarSystem(/* @__PURE__ */ intlEngine("islamic-umalqura", 12));
|
|
649
|
+
/** The Hebrew calendar (`hebrew`): 12 or 13 months, Adar I the leap month (6). */
|
|
650
|
+
const hebrew = /* @__PURE__ */ createCalendarSystem(/* @__PURE__ */ intlEngine("hebrew", "hebrew", 6));
|
|
651
|
+
/** The Coptic calendar (`coptic`): 13 months. */
|
|
652
|
+
const coptic = /* @__PURE__ */ createCalendarSystem(/* @__PURE__ */ intlEngine("coptic", 13));
|
|
653
|
+
/** The Ethiopic calendar, Amete Mihret (`ethiopic`): 13 months. */
|
|
654
|
+
const ethiopic = /* @__PURE__ */ createCalendarSystem(/* @__PURE__ */ intlEngine("ethiopic", 13));
|
|
655
|
+
/** The Ethiopic calendar, Amete Alem (`ethioaa`): 13 months. */
|
|
656
|
+
const ethioaa = /* @__PURE__ */ createCalendarSystem(/* @__PURE__ */ intlEngine("ethioaa", 13));
|
|
657
|
+
export { gregory as a, islamicCivil as c, japanese as d, persian as f, ethiopic as i, islamicTbla as l, coptic as n, hebrew as o, roc as p, ethioaa as r, indian as s, buddhist as t, islamicUmalqura as u };
|
|
658
|
+
|
|
659
|
+
//# sourceMappingURL=calendar-systems-Daa6Q_ca.js.map
|