@internationalized/date 3.5.3-nightly.4555 → 3.5.3-nightly.4560

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.
Files changed (96) hide show
  1. package/dist/BuddhistCalendar.main.js +54 -0
  2. package/dist/BuddhistCalendar.main.js.map +1 -0
  3. package/dist/BuddhistCalendar.mjs +49 -0
  4. package/dist/BuddhistCalendar.module.js +49 -0
  5. package/dist/BuddhistCalendar.module.js.map +1 -0
  6. package/dist/CalendarDate.main.js +260 -0
  7. package/dist/CalendarDate.main.js.map +1 -0
  8. package/dist/CalendarDate.mjs +252 -0
  9. package/dist/CalendarDate.module.js +252 -0
  10. package/dist/CalendarDate.module.js.map +1 -0
  11. package/dist/DateFormatter.main.js +145 -0
  12. package/dist/DateFormatter.main.js.map +1 -0
  13. package/dist/DateFormatter.mjs +140 -0
  14. package/dist/DateFormatter.module.js +140 -0
  15. package/dist/DateFormatter.module.js.map +1 -0
  16. package/dist/EthiopicCalendar.main.js +170 -0
  17. package/dist/EthiopicCalendar.main.js.map +1 -0
  18. package/dist/EthiopicCalendar.mjs +163 -0
  19. package/dist/EthiopicCalendar.module.js +163 -0
  20. package/dist/EthiopicCalendar.module.js.map +1 -0
  21. package/dist/GregorianCalendar.main.js +143 -0
  22. package/dist/GregorianCalendar.main.js.map +1 -0
  23. package/dist/GregorianCalendar.mjs +134 -0
  24. package/dist/GregorianCalendar.module.js +134 -0
  25. package/dist/GregorianCalendar.module.js.map +1 -0
  26. package/dist/HebrewCalendar.main.js +149 -0
  27. package/dist/HebrewCalendar.main.js.map +1 -0
  28. package/dist/HebrewCalendar.mjs +144 -0
  29. package/dist/HebrewCalendar.module.js +144 -0
  30. package/dist/HebrewCalendar.module.js.map +1 -0
  31. package/dist/IndianCalendar.main.js +107 -0
  32. package/dist/IndianCalendar.main.js.map +1 -0
  33. package/dist/IndianCalendar.mjs +102 -0
  34. package/dist/IndianCalendar.module.js +102 -0
  35. package/dist/IndianCalendar.module.js.map +1 -0
  36. package/dist/IslamicCalendar.main.js +164 -0
  37. package/dist/IslamicCalendar.main.js.map +1 -0
  38. package/dist/IslamicCalendar.mjs +157 -0
  39. package/dist/IslamicCalendar.module.js +157 -0
  40. package/dist/IslamicCalendar.module.js.map +1 -0
  41. package/dist/JapaneseCalendar.main.js +180 -0
  42. package/dist/JapaneseCalendar.main.js.map +1 -0
  43. package/dist/JapaneseCalendar.mjs +175 -0
  44. package/dist/JapaneseCalendar.module.js +175 -0
  45. package/dist/JapaneseCalendar.module.js.map +1 -0
  46. package/dist/PersianCalendar.main.js +81 -0
  47. package/dist/PersianCalendar.main.js.map +1 -0
  48. package/dist/PersianCalendar.mjs +76 -0
  49. package/dist/PersianCalendar.module.js +76 -0
  50. package/dist/PersianCalendar.module.js.map +1 -0
  51. package/dist/TaiwanCalendar.main.js +81 -0
  52. package/dist/TaiwanCalendar.main.js.map +1 -0
  53. package/dist/TaiwanCalendar.mjs +76 -0
  54. package/dist/TaiwanCalendar.module.js +76 -0
  55. package/dist/TaiwanCalendar.module.js.map +1 -0
  56. package/dist/conversion.main.js +236 -0
  57. package/dist/conversion.main.js.map +1 -0
  58. package/dist/conversion.mjs +218 -0
  59. package/dist/conversion.module.js +218 -0
  60. package/dist/conversion.module.js.map +1 -0
  61. package/dist/createCalendar.main.js +69 -0
  62. package/dist/createCalendar.main.js.map +1 -0
  63. package/dist/createCalendar.mjs +64 -0
  64. package/dist/createCalendar.module.js +64 -0
  65. package/dist/createCalendar.module.js.map +1 -0
  66. package/dist/import.mjs +15 -2534
  67. package/dist/main.js +75 -2594
  68. package/dist/main.js.map +1 -1
  69. package/dist/manipulation.main.js +362 -0
  70. package/dist/manipulation.main.js.map +1 -0
  71. package/dist/manipulation.mjs +344 -0
  72. package/dist/manipulation.module.js +344 -0
  73. package/dist/manipulation.module.js.map +1 -0
  74. package/dist/module.js +15 -2534
  75. package/dist/module.js.map +1 -1
  76. package/dist/queries.main.js +287 -0
  77. package/dist/queries.main.js.map +1 -0
  78. package/dist/queries.mjs +256 -0
  79. package/dist/queries.module.js +256 -0
  80. package/dist/queries.module.js.map +1 -0
  81. package/dist/string.main.js +171 -0
  82. package/dist/string.main.js.map +1 -0
  83. package/dist/string.mjs +156 -0
  84. package/dist/string.module.js +156 -0
  85. package/dist/string.module.js.map +1 -0
  86. package/dist/utils.main.js +33 -0
  87. package/dist/utils.main.js.map +1 -0
  88. package/dist/utils.mjs +28 -0
  89. package/dist/utils.module.js +28 -0
  90. package/dist/utils.module.js.map +1 -0
  91. package/dist/weekStartData.main.js +118 -0
  92. package/dist/weekStartData.main.js.map +1 -0
  93. package/dist/weekStartData.mjs +113 -0
  94. package/dist/weekStartData.module.js +113 -0
  95. package/dist/weekStartData.module.js.map +1 -0
  96. package/package.json +2 -2
@@ -0,0 +1,287 @@
1
+ var $4ae0260a69729f1d$exports = require("./conversion.main.js");
2
+ var $4d88eff242b38a9e$exports = require("./weekStartData.main.js");
3
+
4
+
5
+ function $parcel$export(e, n, v, s) {
6
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
7
+ }
8
+
9
+ $parcel$export(module.exports, "isSameDay", () => $1f0f7ebf1ae6c530$export$ea39ec197993aef0);
10
+ $parcel$export(module.exports, "isSameMonth", () => $1f0f7ebf1ae6c530$export$a18c89cbd24170ff);
11
+ $parcel$export(module.exports, "startOfMonth", () => $1f0f7ebf1ae6c530$export$a5a3b454ada2268e);
12
+ $parcel$export(module.exports, "isSameYear", () => $1f0f7ebf1ae6c530$export$5841f9eb9773f25f);
13
+ $parcel$export(module.exports, "startOfYear", () => $1f0f7ebf1ae6c530$export$f91e89d3d0406102);
14
+ $parcel$export(module.exports, "isEqualDay", () => $1f0f7ebf1ae6c530$export$91b62ebf2ba703ee);
15
+ $parcel$export(module.exports, "isEqualMonth", () => $1f0f7ebf1ae6c530$export$5a8da0c44a3afdf2);
16
+ $parcel$export(module.exports, "isEqualYear", () => $1f0f7ebf1ae6c530$export$ea840f5a6dda8147);
17
+ $parcel$export(module.exports, "isToday", () => $1f0f7ebf1ae6c530$export$629b0a497aa65267);
18
+ $parcel$export(module.exports, "today", () => $1f0f7ebf1ae6c530$export$d0bdf45af03a6ea3);
19
+ $parcel$export(module.exports, "getDayOfWeek", () => $1f0f7ebf1ae6c530$export$2061056d06d7cdf7);
20
+ $parcel$export(module.exports, "now", () => $1f0f7ebf1ae6c530$export$461939dd4422153);
21
+ $parcel$export(module.exports, "compareDate", () => $1f0f7ebf1ae6c530$export$68781ddf31c0090f);
22
+ $parcel$export(module.exports, "compareTime", () => $1f0f7ebf1ae6c530$export$c19a80a9721b80f6);
23
+ $parcel$export(module.exports, "getHoursInDay", () => $1f0f7ebf1ae6c530$export$126c91c941de7e);
24
+ $parcel$export(module.exports, "getLocalTimeZone", () => $1f0f7ebf1ae6c530$export$aa8b41735afcabd2);
25
+ $parcel$export(module.exports, "endOfMonth", () => $1f0f7ebf1ae6c530$export$a2258d9c4118825c);
26
+ $parcel$export(module.exports, "endOfYear", () => $1f0f7ebf1ae6c530$export$8b7aa55c66d5569e);
27
+ $parcel$export(module.exports, "getMinimumMonthInYear", () => $1f0f7ebf1ae6c530$export$5412ac11713b72ad);
28
+ $parcel$export(module.exports, "getMinimumDayInMonth", () => $1f0f7ebf1ae6c530$export$b2f4953d301981d5);
29
+ $parcel$export(module.exports, "startOfWeek", () => $1f0f7ebf1ae6c530$export$42c81a444fbfb5d4);
30
+ $parcel$export(module.exports, "endOfWeek", () => $1f0f7ebf1ae6c530$export$ef8b6d9133084f4e);
31
+ $parcel$export(module.exports, "getWeeksInMonth", () => $1f0f7ebf1ae6c530$export$ccc1b2479e7dd654);
32
+ $parcel$export(module.exports, "minDate", () => $1f0f7ebf1ae6c530$export$5c333a116e949cdd);
33
+ $parcel$export(module.exports, "maxDate", () => $1f0f7ebf1ae6c530$export$a75f2bff57811055);
34
+ $parcel$export(module.exports, "isWeekend", () => $1f0f7ebf1ae6c530$export$618d60ea299da42);
35
+ $parcel$export(module.exports, "isWeekday", () => $1f0f7ebf1ae6c530$export$ee9d87258e1d19ed);
36
+ /*
37
+ * Copyright 2020 Adobe. All rights reserved.
38
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
39
+ * you may not use this file except in compliance with the License. You may obtain a copy
40
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
41
+ *
42
+ * Unless required by applicable law or agreed to in writing, software distributed under
43
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
44
+ * OF ANY KIND, either express or implied. See the License for the specific language
45
+ * governing permissions and limitations under the License.
46
+ */
47
+
48
+ function $1f0f7ebf1ae6c530$export$ea39ec197993aef0(a, b) {
49
+ b = (0, $4ae0260a69729f1d$exports.toCalendar)(b, a.calendar);
50
+ return a.era === b.era && a.year === b.year && a.month === b.month && a.day === b.day;
51
+ }
52
+ function $1f0f7ebf1ae6c530$export$a18c89cbd24170ff(a, b) {
53
+ b = (0, $4ae0260a69729f1d$exports.toCalendar)(b, a.calendar);
54
+ // In the Japanese calendar, months can span multiple eras/years, so only compare the first of the month.
55
+ a = $1f0f7ebf1ae6c530$export$a5a3b454ada2268e(a);
56
+ b = $1f0f7ebf1ae6c530$export$a5a3b454ada2268e(b);
57
+ return a.era === b.era && a.year === b.year && a.month === b.month;
58
+ }
59
+ function $1f0f7ebf1ae6c530$export$5841f9eb9773f25f(a, b) {
60
+ b = (0, $4ae0260a69729f1d$exports.toCalendar)(b, a.calendar);
61
+ a = $1f0f7ebf1ae6c530$export$f91e89d3d0406102(a);
62
+ b = $1f0f7ebf1ae6c530$export$f91e89d3d0406102(b);
63
+ return a.era === b.era && a.year === b.year;
64
+ }
65
+ function $1f0f7ebf1ae6c530$export$91b62ebf2ba703ee(a, b) {
66
+ return a.calendar.identifier === b.calendar.identifier && a.era === b.era && a.year === b.year && a.month === b.month && a.day === b.day;
67
+ }
68
+ function $1f0f7ebf1ae6c530$export$5a8da0c44a3afdf2(a, b) {
69
+ a = $1f0f7ebf1ae6c530$export$a5a3b454ada2268e(a);
70
+ b = $1f0f7ebf1ae6c530$export$a5a3b454ada2268e(b);
71
+ return a.calendar.identifier === b.calendar.identifier && a.era === b.era && a.year === b.year && a.month === b.month;
72
+ }
73
+ function $1f0f7ebf1ae6c530$export$ea840f5a6dda8147(a, b) {
74
+ a = $1f0f7ebf1ae6c530$export$f91e89d3d0406102(a);
75
+ b = $1f0f7ebf1ae6c530$export$f91e89d3d0406102(b);
76
+ return a.calendar.identifier === b.calendar.identifier && a.era === b.era && a.year === b.year;
77
+ }
78
+ function $1f0f7ebf1ae6c530$export$629b0a497aa65267(date, timeZone) {
79
+ return $1f0f7ebf1ae6c530$export$ea39ec197993aef0(date, $1f0f7ebf1ae6c530$export$d0bdf45af03a6ea3(timeZone));
80
+ }
81
+ function $1f0f7ebf1ae6c530$export$2061056d06d7cdf7(date, locale) {
82
+ let julian = date.calendar.toJulianDay(date);
83
+ // If julian is negative, then julian % 7 will be negative, so we adjust
84
+ // accordingly. Julian day 0 is Monday.
85
+ let dayOfWeek = Math.ceil(julian + 1 - $1f0f7ebf1ae6c530$var$getWeekStart(locale)) % 7;
86
+ if (dayOfWeek < 0) dayOfWeek += 7;
87
+ return dayOfWeek;
88
+ }
89
+ function $1f0f7ebf1ae6c530$export$461939dd4422153(timeZone) {
90
+ return (0, $4ae0260a69729f1d$exports.fromAbsolute)(Date.now(), timeZone);
91
+ }
92
+ function $1f0f7ebf1ae6c530$export$d0bdf45af03a6ea3(timeZone) {
93
+ return (0, $4ae0260a69729f1d$exports.toCalendarDate)($1f0f7ebf1ae6c530$export$461939dd4422153(timeZone));
94
+ }
95
+ function $1f0f7ebf1ae6c530$export$68781ddf31c0090f(a, b) {
96
+ return a.calendar.toJulianDay(a) - b.calendar.toJulianDay(b);
97
+ }
98
+ function $1f0f7ebf1ae6c530$export$c19a80a9721b80f6(a, b) {
99
+ return $1f0f7ebf1ae6c530$var$timeToMs(a) - $1f0f7ebf1ae6c530$var$timeToMs(b);
100
+ }
101
+ function $1f0f7ebf1ae6c530$var$timeToMs(a) {
102
+ return a.hour * 3600000 + a.minute * 60000 + a.second * 1000 + a.millisecond;
103
+ }
104
+ function $1f0f7ebf1ae6c530$export$126c91c941de7e(a, timeZone) {
105
+ let ms = (0, $4ae0260a69729f1d$exports.toAbsolute)(a, timeZone);
106
+ let tomorrow = a.add({
107
+ days: 1
108
+ });
109
+ let tomorrowMs = (0, $4ae0260a69729f1d$exports.toAbsolute)(tomorrow, timeZone);
110
+ return (tomorrowMs - ms) / 3600000;
111
+ }
112
+ let $1f0f7ebf1ae6c530$var$localTimeZone = null;
113
+ function $1f0f7ebf1ae6c530$export$aa8b41735afcabd2() {
114
+ // TODO: invalidate this somehow?
115
+ if ($1f0f7ebf1ae6c530$var$localTimeZone == null) $1f0f7ebf1ae6c530$var$localTimeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone;
116
+ return $1f0f7ebf1ae6c530$var$localTimeZone;
117
+ }
118
+ function $1f0f7ebf1ae6c530$export$a5a3b454ada2268e(date) {
119
+ // Use `subtract` instead of `set` so we don't get constrained in an era.
120
+ return date.subtract({
121
+ days: date.day - 1
122
+ });
123
+ }
124
+ function $1f0f7ebf1ae6c530$export$a2258d9c4118825c(date) {
125
+ return date.add({
126
+ days: date.calendar.getDaysInMonth(date) - date.day
127
+ });
128
+ }
129
+ function $1f0f7ebf1ae6c530$export$f91e89d3d0406102(date) {
130
+ return $1f0f7ebf1ae6c530$export$a5a3b454ada2268e(date.subtract({
131
+ months: date.month - 1
132
+ }));
133
+ }
134
+ function $1f0f7ebf1ae6c530$export$8b7aa55c66d5569e(date) {
135
+ return $1f0f7ebf1ae6c530$export$a2258d9c4118825c(date.add({
136
+ months: date.calendar.getMonthsInYear(date) - date.month
137
+ }));
138
+ }
139
+ function $1f0f7ebf1ae6c530$export$5412ac11713b72ad(date) {
140
+ if (date.calendar.getMinimumMonthInYear) return date.calendar.getMinimumMonthInYear(date);
141
+ return 1;
142
+ }
143
+ function $1f0f7ebf1ae6c530$export$b2f4953d301981d5(date) {
144
+ if (date.calendar.getMinimumDayInMonth) return date.calendar.getMinimumDayInMonth(date);
145
+ return 1;
146
+ }
147
+ function $1f0f7ebf1ae6c530$export$42c81a444fbfb5d4(date, locale) {
148
+ let dayOfWeek = $1f0f7ebf1ae6c530$export$2061056d06d7cdf7(date, locale);
149
+ return date.subtract({
150
+ days: dayOfWeek
151
+ });
152
+ }
153
+ function $1f0f7ebf1ae6c530$export$ef8b6d9133084f4e(date, locale) {
154
+ return $1f0f7ebf1ae6c530$export$42c81a444fbfb5d4(date, locale).add({
155
+ days: 6
156
+ });
157
+ }
158
+ const $1f0f7ebf1ae6c530$var$cachedRegions = new Map();
159
+ function $1f0f7ebf1ae6c530$var$getRegion(locale) {
160
+ // If the Intl.Locale API is available, use it to get the region for the locale.
161
+ // @ts-ignore
162
+ if (Intl.Locale) {
163
+ // Constructing an Intl.Locale is expensive, so cache the result.
164
+ let region = $1f0f7ebf1ae6c530$var$cachedRegions.get(locale);
165
+ if (!region) {
166
+ // @ts-ignore
167
+ region = new Intl.Locale(locale).maximize().region;
168
+ if (region) $1f0f7ebf1ae6c530$var$cachedRegions.set(locale, region);
169
+ }
170
+ return region;
171
+ }
172
+ // If not, just try splitting the string.
173
+ // If the second part of the locale string is 'u',
174
+ // then this is a unicode extension, so ignore it.
175
+ // Otherwise, it should be the region.
176
+ let part = locale.split("-")[1];
177
+ return part === "u" ? undefined : part;
178
+ }
179
+ function $1f0f7ebf1ae6c530$var$getWeekStart(locale) {
180
+ // TODO: use Intl.Locale for this once browsers support the weekInfo property
181
+ // https://github.com/tc39/proposal-intl-locale-info
182
+ let region = $1f0f7ebf1ae6c530$var$getRegion(locale);
183
+ return region ? (0, $4d88eff242b38a9e$exports.weekStartData)[region] || 0 : 0;
184
+ }
185
+ function $1f0f7ebf1ae6c530$export$ccc1b2479e7dd654(date, locale) {
186
+ let days = date.calendar.getDaysInMonth(date);
187
+ return Math.ceil(($1f0f7ebf1ae6c530$export$2061056d06d7cdf7($1f0f7ebf1ae6c530$export$a5a3b454ada2268e(date), locale) + days) / 7);
188
+ }
189
+ function $1f0f7ebf1ae6c530$export$5c333a116e949cdd(a, b) {
190
+ if (a && b) return a.compare(b) <= 0 ? a : b;
191
+ return a || b;
192
+ }
193
+ function $1f0f7ebf1ae6c530$export$a75f2bff57811055(a, b) {
194
+ if (a && b) return a.compare(b) >= 0 ? a : b;
195
+ return a || b;
196
+ }
197
+ const $1f0f7ebf1ae6c530$var$WEEKEND_DATA = {
198
+ AF: [
199
+ 4,
200
+ 5
201
+ ],
202
+ AE: [
203
+ 5,
204
+ 6
205
+ ],
206
+ BH: [
207
+ 5,
208
+ 6
209
+ ],
210
+ DZ: [
211
+ 5,
212
+ 6
213
+ ],
214
+ EG: [
215
+ 5,
216
+ 6
217
+ ],
218
+ IL: [
219
+ 5,
220
+ 6
221
+ ],
222
+ IQ: [
223
+ 5,
224
+ 6
225
+ ],
226
+ IR: [
227
+ 5,
228
+ 5
229
+ ],
230
+ JO: [
231
+ 5,
232
+ 6
233
+ ],
234
+ KW: [
235
+ 5,
236
+ 6
237
+ ],
238
+ LY: [
239
+ 5,
240
+ 6
241
+ ],
242
+ OM: [
243
+ 5,
244
+ 6
245
+ ],
246
+ QA: [
247
+ 5,
248
+ 6
249
+ ],
250
+ SA: [
251
+ 5,
252
+ 6
253
+ ],
254
+ SD: [
255
+ 5,
256
+ 6
257
+ ],
258
+ SY: [
259
+ 5,
260
+ 6
261
+ ],
262
+ YE: [
263
+ 5,
264
+ 6
265
+ ]
266
+ };
267
+ function $1f0f7ebf1ae6c530$export$618d60ea299da42(date, locale) {
268
+ let julian = date.calendar.toJulianDay(date);
269
+ // If julian is negative, then julian % 7 will be negative, so we adjust
270
+ // accordingly. Julian day 0 is Monday.
271
+ let dayOfWeek = Math.ceil(julian + 1) % 7;
272
+ if (dayOfWeek < 0) dayOfWeek += 7;
273
+ let region = $1f0f7ebf1ae6c530$var$getRegion(locale);
274
+ // Use Intl.Locale for this once weekInfo is supported.
275
+ // https://github.com/tc39/proposal-intl-locale-info
276
+ let [start, end] = $1f0f7ebf1ae6c530$var$WEEKEND_DATA[region] || [
277
+ 6,
278
+ 0
279
+ ];
280
+ return dayOfWeek === start || dayOfWeek === end;
281
+ }
282
+ function $1f0f7ebf1ae6c530$export$ee9d87258e1d19ed(date, locale) {
283
+ return !$1f0f7ebf1ae6c530$export$618d60ea299da42(date, locale);
284
+ }
285
+
286
+
287
+ //# sourceMappingURL=queries.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAUM,SAAS,0CAAU,CAAY,EAAE,CAAY;IAClD,IAAI,CAAA,GAAA,oCAAS,EAAE,GAAG,EAAE,QAAQ;IAC5B,OAAO,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,EAAE,IAAI,KAAK,EAAE,IAAI,IAAI,EAAE,KAAK,KAAK,EAAE,KAAK,IAAI,EAAE,GAAG,KAAK,EAAE,GAAG;AACvF;AAGO,SAAS,0CAAY,CAAY,EAAE,CAAY;IACpD,IAAI,CAAA,GAAA,oCAAS,EAAE,GAAG,EAAE,QAAQ;IAC5B,yGAAyG;IACzG,IAAI,0CAAa;IACjB,IAAI,0CAAa;IACjB,OAAO,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,EAAE,IAAI,KAAK,EAAE,IAAI,IAAI,EAAE,KAAK,KAAK,EAAE,KAAK;AACpE;AAGO,SAAS,0CAAW,CAAY,EAAE,CAAY;IACnD,IAAI,CAAA,GAAA,oCAAS,EAAE,GAAG,EAAE,QAAQ;IAC5B,IAAI,0CAAY;IAChB,IAAI,0CAAY;IAChB,OAAO,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,EAAE,IAAI,KAAK,EAAE,IAAI;AAC7C;AAGO,SAAS,0CAAW,CAAY,EAAE,CAAY;IACnD,OAAO,EAAE,QAAQ,CAAC,UAAU,KAAK,E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* This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AnyCalendarDate, AnyTime} from './types';\nimport {CalendarDate, CalendarDateTime, ZonedDateTime} from './CalendarDate';\nimport {fromAbsolute, toAbsolute, toCalendar, toCalendarDate} from './conversion';\nimport {weekStartData} from './weekStartData';\n\ntype DateValue = CalendarDate | CalendarDateTime | ZonedDateTime;\n\n/** Returns whether the given dates occur on the same day, regardless of the time or calendar system. */\nexport function isSameDay(a: DateValue, b: DateValue): boolean {\n b = toCalendar(b, a.calendar);\n return a.era === b.era && a.year === b.year && a.month === b.month && a.day === b.day;\n}\n\n/** Returns whether the given dates occur in the same month, using the calendar system of the first date. */\nexport function isSameMonth(a: DateValue, b: DateValue): boolean {\n b = toCalendar(b, a.calendar);\n // In the Japanese calendar, months can span multiple eras/years, so only compare the first of the month.\n a = startOfMonth(a);\n b = startOfMonth(b);\n return a.era === b.era && a.year === b.year && a.month === b.month;\n}\n\n/** Returns whether the given dates occur in the same year, using the calendar system of the first date. */\nexport function isSameYear(a: DateValue, b: DateValue): boolean {\n b = toCalendar(b, a.calendar);\n a = startOfYear(a);\n b = startOfYear(b);\n return a.era === b.era && a.year === b.year;\n}\n\n/** Returns whether the given dates occur on the same day, and are of the same calendar system. */\nexport function isEqualDay(a: DateValue, b: DateValue): boolean {\n return a.calendar.identifier === b.calendar.identifier && a.era === b.era && a.year === b.year && a.month === b.month && a.day === b.day;\n}\n\n/** Returns whether the given dates occur in the same month, and are of the same calendar system. */\nexport function isEqualMonth(a: DateValue, b: DateValue): boolean {\n a = startOfMonth(a);\n b = startOfMonth(b);\n return a.calendar.identifier === b.calendar.identifier && a.era === b.era && a.year === b.year && a.month === b.month;\n}\n\n/** Returns whether the given dates occur in the same year, and are of the same calendar system. */\nexport function isEqualYear(a: DateValue, b: DateValue): boolean {\n a = startOfYear(a);\n b = startOfYear(b);\n return a.calendar.identifier === b.calendar.identifier && a.era === b.era && a.year === b.year;\n}\n\n/** Returns whether the date is today in the given time zone. */\nexport function isToday(date: DateValue, timeZone: string): boolean {\n return isSameDay(date, today(timeZone));\n}\n\n/**\n * Returns the day of week for the given date and locale. Days are numbered from zero to six,\n * where zero is the first day of the week in the given locale. For example, in the United States,\n * the first day of the week is Sunday, but in France it is Monday.\n */\nexport function getDayOfWeek(date: DateValue, locale: string): number {\n let julian = date.calendar.toJulianDay(date);\n\n // If julian is negative, then julian % 7 will be negative, so we adjust\n // accordingly. Julian day 0 is Monday.\n let dayOfWeek = Math.ceil(julian + 1 - getWeekStart(locale)) % 7;\n if (dayOfWeek < 0) {\n dayOfWeek += 7;\n }\n\n return dayOfWeek;\n}\n\n/** Returns the current time in the given time zone. */\nexport function now(timeZone: string): ZonedDateTime {\n return fromAbsolute(Date.now(), timeZone);\n}\n\n/** Returns today's date in the given time zone. */\nexport function today(timeZone: string): CalendarDate {\n return toCalendarDate(now(timeZone));\n}\n\nexport function compareDate(a: AnyCalendarDate, b: AnyCalendarDate): number {\n return a.calendar.toJulianDay(a) - b.calendar.toJulianDay(b);\n}\n\nexport function compareTime(a: AnyTime, b: AnyTime): number {\n return timeToMs(a) - timeToMs(b);\n}\n\nfunction timeToMs(a: AnyTime): number {\n return a.hour * 60 * 60 * 1000 + a.minute * 60 * 1000 + a.second * 1000 + a.millisecond;\n}\n\n/**\n * Returns the number of hours in the given date and time zone.\n * Usually this is 24, but it could be 23 or 25 if the date is on a daylight saving transition.\n */\nexport function getHoursInDay(a: CalendarDate, timeZone: string): number {\n let ms = toAbsolute(a, timeZone);\n let tomorrow = a.add({days: 1});\n let tomorrowMs = toAbsolute(tomorrow, timeZone);\n return (tomorrowMs - ms) / 3600000;\n}\n\nlet localTimeZone: string | null = null;\n\n/** Returns the time zone identifier for the current user. */\nexport function getLocalTimeZone(): string {\n // TODO: invalidate this somehow?\n if (localTimeZone == null) {\n localTimeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n return localTimeZone!;\n}\n\n/** Returns the first date of the month for the given date. */\nexport function startOfMonth(date: ZonedDateTime): ZonedDateTime;\nexport function startOfMonth(date: CalendarDateTime): CalendarDateTime;\nexport function startOfMonth(date: CalendarDate): CalendarDate;\nexport function startOfMonth(date: DateValue): DateValue;\nexport function startOfMonth(date: DateValue): DateValue {\n // Use `subtract` instead of `set` so we don't get constrained in an era.\n return date.subtract({days: date.day - 1});\n}\n\n/** Returns the last date of the month for the given date. */\nexport function endOfMonth(date: ZonedDateTime): ZonedDateTime;\nexport function endOfMonth(date: CalendarDateTime): CalendarDateTime;\nexport function endOfMonth(date: CalendarDate): CalendarDate;\nexport function endOfMonth(date: DateValue): DateValue;\nexport function endOfMonth(date: DateValue): DateValue {\n return date.add({days: date.calendar.getDaysInMonth(date) - date.day});\n}\n\n/** Returns the first day of the year for the given date. */\nexport function startOfYear(date: ZonedDateTime): ZonedDateTime;\nexport function startOfYear(date: CalendarDateTime): CalendarDateTime;\nexport function startOfYear(date: CalendarDate): CalendarDate;\nexport function startOfYear(date: DateValue): DateValue;\nexport function startOfYear(date: DateValue): DateValue {\n return startOfMonth(date.subtract({months: date.month - 1}));\n}\n\n/** Returns the last day of the year for the given date. */\nexport function endOfYear(date: ZonedDateTime): ZonedDateTime;\nexport function endOfYear(date: CalendarDateTime): CalendarDateTime;\nexport function endOfYear(date: CalendarDate): CalendarDate;\nexport function endOfYear(date: DateValue): DateValue;\nexport function endOfYear(date: DateValue): DateValue {\n return endOfMonth(date.add({months: date.calendar.getMonthsInYear(date) - date.month}));\n}\n\nexport function getMinimumMonthInYear(date: AnyCalendarDate) {\n if (date.calendar.getMinimumMonthInYear) {\n return date.calendar.getMinimumMonthInYear(date);\n }\n\n return 1;\n}\n\nexport function getMinimumDayInMonth(date: AnyCalendarDate) {\n if (date.calendar.getMinimumDayInMonth) {\n return date.calendar.getMinimumDayInMonth(date);\n }\n\n return 1;\n}\n\n/** Returns the first date of the week for the given date and locale. */\nexport function startOfWeek(date: ZonedDateTime, locale: string): ZonedDateTime;\nexport function startOfWeek(date: CalendarDateTime, locale: string): CalendarDateTime;\nexport function startOfWeek(date: CalendarDate, locale: string): CalendarDate;\nexport function startOfWeek(date: DateValue, locale: string): DateValue;\nexport function startOfWeek(date: DateValue, locale: string): DateValue {\n let dayOfWeek = getDayOfWeek(date, locale);\n return date.subtract({days: dayOfWeek});\n}\n\n/** Returns the last date of the week for the given date and locale. */\nexport function endOfWeek(date: ZonedDateTime, locale: string): ZonedDateTime;\nexport function endOfWeek(date: CalendarDateTime, locale: string): CalendarDateTime;\nexport function endOfWeek(date: CalendarDate, locale: string): CalendarDate;\nexport function endOfWeek(date: DateValue, locale: string): DateValue {\n return startOfWeek(date, locale).add({days: 6});\n}\n\nconst cachedRegions = new Map<string, string>();\n\nfunction getRegion(locale: string): string | undefined {\n // If the Intl.Locale API is available, use it to get the region for the locale.\n // @ts-ignore\n if (Intl.Locale) {\n // Constructing an Intl.Locale is expensive, so cache the result.\n let region = cachedRegions.get(locale);\n if (!region) {\n // @ts-ignore\n region = new Intl.Locale(locale).maximize().region;\n if (region) {\n cachedRegions.set(locale, region);\n }\n }\n return region;\n }\n\n // If not, just try splitting the string.\n // If the second part of the locale string is 'u',\n // then this is a unicode extension, so ignore it.\n // Otherwise, it should be the region.\n let part = locale.split('-')[1];\n return part === 'u' ? undefined : part;\n}\n\nfunction getWeekStart(locale: string): number {\n // TODO: use Intl.Locale for this once browsers support the weekInfo property\n // https://github.com/tc39/proposal-intl-locale-info\n let region = getRegion(locale);\n return region ? weekStartData[region] || 0 : 0;\n}\n\n/** Returns the number of weeks in the given month and locale. */\nexport function getWeeksInMonth(date: DateValue, locale: string): number {\n let days = date.calendar.getDaysInMonth(date);\n return Math.ceil((getDayOfWeek(startOfMonth(date), locale) + days) / 7);\n}\n\n/** Returns the lesser of the two provider dates. */\nexport function minDate<A extends DateValue, B extends DateValue>(a: A, b: B): A | B {\n if (a && b) {\n return a.compare(b) <= 0 ? a : b;\n }\n\n return a || b;\n}\n\n/** Returns the greater of the two provider dates. */\nexport function maxDate<A extends DateValue, B extends DateValue>(a: A, b: B): A | B {\n if (a && b) {\n return a.compare(b) >= 0 ? a : b;\n }\n\n return a || b;\n}\n\nconst WEEKEND_DATA = {\n AF: [4, 5],\n AE: [5, 6],\n BH: [5, 6],\n DZ: [5, 6],\n EG: [5, 6],\n IL: [5, 6],\n IQ: [5, 6],\n IR: [5, 5],\n JO: [5, 6],\n KW: [5, 6],\n LY: [5, 6],\n OM: [5, 6],\n QA: [5, 6],\n SA: [5, 6],\n SD: [5, 6],\n SY: [5, 6],\n YE: [5, 6]\n};\n\n/** Returns whether the given date is on a weekend in the given locale. */\nexport function isWeekend(date: DateValue, locale: string): boolean {\n let julian = date.calendar.toJulianDay(date);\n\n // If julian is negative, then julian % 7 will be negative, so we adjust\n // accordingly. Julian day 0 is Monday.\n let dayOfWeek = Math.ceil(julian + 1) % 7;\n if (dayOfWeek < 0) {\n dayOfWeek += 7;\n }\n\n let region = getRegion(locale);\n // Use Intl.Locale for this once weekInfo is supported.\n // https://github.com/tc39/proposal-intl-locale-info\n let [start, end] = WEEKEND_DATA[region!] || [6, 0];\n return dayOfWeek === start || dayOfWeek === end;\n}\n\n/** Returns whether the given date is on a weekday in the given locale. */\nexport function isWeekday(date: DateValue, locale: string): boolean {\n return !isWeekend(date, locale);\n}\n"],"names":[],"version":3,"file":"queries.main.js.map"}
@@ -0,0 +1,256 @@
1
+ import {fromAbsolute as $11d87f3f76e88657$export$1b96692a1ba042ac, toAbsolute as $11d87f3f76e88657$export$5107c82f94518f5c, toCalendar as $11d87f3f76e88657$export$b4a036af3fc0b032, toCalendarDate as $11d87f3f76e88657$export$93522d1a439f3617} from "./conversion.mjs";
2
+ import {weekStartData as $2fe286d2fb449abb$export$7a5acbd77d414bd9} from "./weekStartData.mjs";
3
+
4
+ /*
5
+ * Copyright 2020 Adobe. All rights reserved.
6
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License. You may obtain a copy
8
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software distributed under
11
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
12
+ * OF ANY KIND, either express or implied. See the License for the specific language
13
+ * governing permissions and limitations under the License.
14
+ */
15
+
16
+ function $14e0f24ef4ac5c92$export$ea39ec197993aef0(a, b) {
17
+ b = (0, $11d87f3f76e88657$export$b4a036af3fc0b032)(b, a.calendar);
18
+ return a.era === b.era && a.year === b.year && a.month === b.month && a.day === b.day;
19
+ }
20
+ function $14e0f24ef4ac5c92$export$a18c89cbd24170ff(a, b) {
21
+ b = (0, $11d87f3f76e88657$export$b4a036af3fc0b032)(b, a.calendar);
22
+ // In the Japanese calendar, months can span multiple eras/years, so only compare the first of the month.
23
+ a = $14e0f24ef4ac5c92$export$a5a3b454ada2268e(a);
24
+ b = $14e0f24ef4ac5c92$export$a5a3b454ada2268e(b);
25
+ return a.era === b.era && a.year === b.year && a.month === b.month;
26
+ }
27
+ function $14e0f24ef4ac5c92$export$5841f9eb9773f25f(a, b) {
28
+ b = (0, $11d87f3f76e88657$export$b4a036af3fc0b032)(b, a.calendar);
29
+ a = $14e0f24ef4ac5c92$export$f91e89d3d0406102(a);
30
+ b = $14e0f24ef4ac5c92$export$f91e89d3d0406102(b);
31
+ return a.era === b.era && a.year === b.year;
32
+ }
33
+ function $14e0f24ef4ac5c92$export$91b62ebf2ba703ee(a, b) {
34
+ return a.calendar.identifier === b.calendar.identifier && a.era === b.era && a.year === b.year && a.month === b.month && a.day === b.day;
35
+ }
36
+ function $14e0f24ef4ac5c92$export$5a8da0c44a3afdf2(a, b) {
37
+ a = $14e0f24ef4ac5c92$export$a5a3b454ada2268e(a);
38
+ b = $14e0f24ef4ac5c92$export$a5a3b454ada2268e(b);
39
+ return a.calendar.identifier === b.calendar.identifier && a.era === b.era && a.year === b.year && a.month === b.month;
40
+ }
41
+ function $14e0f24ef4ac5c92$export$ea840f5a6dda8147(a, b) {
42
+ a = $14e0f24ef4ac5c92$export$f91e89d3d0406102(a);
43
+ b = $14e0f24ef4ac5c92$export$f91e89d3d0406102(b);
44
+ return a.calendar.identifier === b.calendar.identifier && a.era === b.era && a.year === b.year;
45
+ }
46
+ function $14e0f24ef4ac5c92$export$629b0a497aa65267(date, timeZone) {
47
+ return $14e0f24ef4ac5c92$export$ea39ec197993aef0(date, $14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(timeZone));
48
+ }
49
+ function $14e0f24ef4ac5c92$export$2061056d06d7cdf7(date, locale) {
50
+ let julian = date.calendar.toJulianDay(date);
51
+ // If julian is negative, then julian % 7 will be negative, so we adjust
52
+ // accordingly. Julian day 0 is Monday.
53
+ let dayOfWeek = Math.ceil(julian + 1 - $14e0f24ef4ac5c92$var$getWeekStart(locale)) % 7;
54
+ if (dayOfWeek < 0) dayOfWeek += 7;
55
+ return dayOfWeek;
56
+ }
57
+ function $14e0f24ef4ac5c92$export$461939dd4422153(timeZone) {
58
+ return (0, $11d87f3f76e88657$export$1b96692a1ba042ac)(Date.now(), timeZone);
59
+ }
60
+ function $14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(timeZone) {
61
+ return (0, $11d87f3f76e88657$export$93522d1a439f3617)($14e0f24ef4ac5c92$export$461939dd4422153(timeZone));
62
+ }
63
+ function $14e0f24ef4ac5c92$export$68781ddf31c0090f(a, b) {
64
+ return a.calendar.toJulianDay(a) - b.calendar.toJulianDay(b);
65
+ }
66
+ function $14e0f24ef4ac5c92$export$c19a80a9721b80f6(a, b) {
67
+ return $14e0f24ef4ac5c92$var$timeToMs(a) - $14e0f24ef4ac5c92$var$timeToMs(b);
68
+ }
69
+ function $14e0f24ef4ac5c92$var$timeToMs(a) {
70
+ return a.hour * 3600000 + a.minute * 60000 + a.second * 1000 + a.millisecond;
71
+ }
72
+ function $14e0f24ef4ac5c92$export$126c91c941de7e(a, timeZone) {
73
+ let ms = (0, $11d87f3f76e88657$export$5107c82f94518f5c)(a, timeZone);
74
+ let tomorrow = a.add({
75
+ days: 1
76
+ });
77
+ let tomorrowMs = (0, $11d87f3f76e88657$export$5107c82f94518f5c)(tomorrow, timeZone);
78
+ return (tomorrowMs - ms) / 3600000;
79
+ }
80
+ let $14e0f24ef4ac5c92$var$localTimeZone = null;
81
+ function $14e0f24ef4ac5c92$export$aa8b41735afcabd2() {
82
+ // TODO: invalidate this somehow?
83
+ if ($14e0f24ef4ac5c92$var$localTimeZone == null) $14e0f24ef4ac5c92$var$localTimeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone;
84
+ return $14e0f24ef4ac5c92$var$localTimeZone;
85
+ }
86
+ function $14e0f24ef4ac5c92$export$a5a3b454ada2268e(date) {
87
+ // Use `subtract` instead of `set` so we don't get constrained in an era.
88
+ return date.subtract({
89
+ days: date.day - 1
90
+ });
91
+ }
92
+ function $14e0f24ef4ac5c92$export$a2258d9c4118825c(date) {
93
+ return date.add({
94
+ days: date.calendar.getDaysInMonth(date) - date.day
95
+ });
96
+ }
97
+ function $14e0f24ef4ac5c92$export$f91e89d3d0406102(date) {
98
+ return $14e0f24ef4ac5c92$export$a5a3b454ada2268e(date.subtract({
99
+ months: date.month - 1
100
+ }));
101
+ }
102
+ function $14e0f24ef4ac5c92$export$8b7aa55c66d5569e(date) {
103
+ return $14e0f24ef4ac5c92$export$a2258d9c4118825c(date.add({
104
+ months: date.calendar.getMonthsInYear(date) - date.month
105
+ }));
106
+ }
107
+ function $14e0f24ef4ac5c92$export$5412ac11713b72ad(date) {
108
+ if (date.calendar.getMinimumMonthInYear) return date.calendar.getMinimumMonthInYear(date);
109
+ return 1;
110
+ }
111
+ function $14e0f24ef4ac5c92$export$b2f4953d301981d5(date) {
112
+ if (date.calendar.getMinimumDayInMonth) return date.calendar.getMinimumDayInMonth(date);
113
+ return 1;
114
+ }
115
+ function $14e0f24ef4ac5c92$export$42c81a444fbfb5d4(date, locale) {
116
+ let dayOfWeek = $14e0f24ef4ac5c92$export$2061056d06d7cdf7(date, locale);
117
+ return date.subtract({
118
+ days: dayOfWeek
119
+ });
120
+ }
121
+ function $14e0f24ef4ac5c92$export$ef8b6d9133084f4e(date, locale) {
122
+ return $14e0f24ef4ac5c92$export$42c81a444fbfb5d4(date, locale).add({
123
+ days: 6
124
+ });
125
+ }
126
+ const $14e0f24ef4ac5c92$var$cachedRegions = new Map();
127
+ function $14e0f24ef4ac5c92$var$getRegion(locale) {
128
+ // If the Intl.Locale API is available, use it to get the region for the locale.
129
+ // @ts-ignore
130
+ if (Intl.Locale) {
131
+ // Constructing an Intl.Locale is expensive, so cache the result.
132
+ let region = $14e0f24ef4ac5c92$var$cachedRegions.get(locale);
133
+ if (!region) {
134
+ // @ts-ignore
135
+ region = new Intl.Locale(locale).maximize().region;
136
+ if (region) $14e0f24ef4ac5c92$var$cachedRegions.set(locale, region);
137
+ }
138
+ return region;
139
+ }
140
+ // If not, just try splitting the string.
141
+ // If the second part of the locale string is 'u',
142
+ // then this is a unicode extension, so ignore it.
143
+ // Otherwise, it should be the region.
144
+ let part = locale.split("-")[1];
145
+ return part === "u" ? undefined : part;
146
+ }
147
+ function $14e0f24ef4ac5c92$var$getWeekStart(locale) {
148
+ // TODO: use Intl.Locale for this once browsers support the weekInfo property
149
+ // https://github.com/tc39/proposal-intl-locale-info
150
+ let region = $14e0f24ef4ac5c92$var$getRegion(locale);
151
+ return region ? (0, $2fe286d2fb449abb$export$7a5acbd77d414bd9)[region] || 0 : 0;
152
+ }
153
+ function $14e0f24ef4ac5c92$export$ccc1b2479e7dd654(date, locale) {
154
+ let days = date.calendar.getDaysInMonth(date);
155
+ return Math.ceil(($14e0f24ef4ac5c92$export$2061056d06d7cdf7($14e0f24ef4ac5c92$export$a5a3b454ada2268e(date), locale) + days) / 7);
156
+ }
157
+ function $14e0f24ef4ac5c92$export$5c333a116e949cdd(a, b) {
158
+ if (a && b) return a.compare(b) <= 0 ? a : b;
159
+ return a || b;
160
+ }
161
+ function $14e0f24ef4ac5c92$export$a75f2bff57811055(a, b) {
162
+ if (a && b) return a.compare(b) >= 0 ? a : b;
163
+ return a || b;
164
+ }
165
+ const $14e0f24ef4ac5c92$var$WEEKEND_DATA = {
166
+ AF: [
167
+ 4,
168
+ 5
169
+ ],
170
+ AE: [
171
+ 5,
172
+ 6
173
+ ],
174
+ BH: [
175
+ 5,
176
+ 6
177
+ ],
178
+ DZ: [
179
+ 5,
180
+ 6
181
+ ],
182
+ EG: [
183
+ 5,
184
+ 6
185
+ ],
186
+ IL: [
187
+ 5,
188
+ 6
189
+ ],
190
+ IQ: [
191
+ 5,
192
+ 6
193
+ ],
194
+ IR: [
195
+ 5,
196
+ 5
197
+ ],
198
+ JO: [
199
+ 5,
200
+ 6
201
+ ],
202
+ KW: [
203
+ 5,
204
+ 6
205
+ ],
206
+ LY: [
207
+ 5,
208
+ 6
209
+ ],
210
+ OM: [
211
+ 5,
212
+ 6
213
+ ],
214
+ QA: [
215
+ 5,
216
+ 6
217
+ ],
218
+ SA: [
219
+ 5,
220
+ 6
221
+ ],
222
+ SD: [
223
+ 5,
224
+ 6
225
+ ],
226
+ SY: [
227
+ 5,
228
+ 6
229
+ ],
230
+ YE: [
231
+ 5,
232
+ 6
233
+ ]
234
+ };
235
+ function $14e0f24ef4ac5c92$export$618d60ea299da42(date, locale) {
236
+ let julian = date.calendar.toJulianDay(date);
237
+ // If julian is negative, then julian % 7 will be negative, so we adjust
238
+ // accordingly. Julian day 0 is Monday.
239
+ let dayOfWeek = Math.ceil(julian + 1) % 7;
240
+ if (dayOfWeek < 0) dayOfWeek += 7;
241
+ let region = $14e0f24ef4ac5c92$var$getRegion(locale);
242
+ // Use Intl.Locale for this once weekInfo is supported.
243
+ // https://github.com/tc39/proposal-intl-locale-info
244
+ let [start, end] = $14e0f24ef4ac5c92$var$WEEKEND_DATA[region] || [
245
+ 6,
246
+ 0
247
+ ];
248
+ return dayOfWeek === start || dayOfWeek === end;
249
+ }
250
+ function $14e0f24ef4ac5c92$export$ee9d87258e1d19ed(date, locale) {
251
+ return !$14e0f24ef4ac5c92$export$618d60ea299da42(date, locale);
252
+ }
253
+
254
+
255
+ export {$14e0f24ef4ac5c92$export$ea39ec197993aef0 as isSameDay, $14e0f24ef4ac5c92$export$a18c89cbd24170ff as isSameMonth, $14e0f24ef4ac5c92$export$a5a3b454ada2268e as startOfMonth, $14e0f24ef4ac5c92$export$5841f9eb9773f25f as isSameYear, $14e0f24ef4ac5c92$export$f91e89d3d0406102 as startOfYear, $14e0f24ef4ac5c92$export$91b62ebf2ba703ee as isEqualDay, $14e0f24ef4ac5c92$export$5a8da0c44a3afdf2 as isEqualMonth, $14e0f24ef4ac5c92$export$ea840f5a6dda8147 as isEqualYear, $14e0f24ef4ac5c92$export$629b0a497aa65267 as isToday, $14e0f24ef4ac5c92$export$d0bdf45af03a6ea3 as today, $14e0f24ef4ac5c92$export$2061056d06d7cdf7 as getDayOfWeek, $14e0f24ef4ac5c92$export$461939dd4422153 as now, $14e0f24ef4ac5c92$export$68781ddf31c0090f as compareDate, $14e0f24ef4ac5c92$export$c19a80a9721b80f6 as compareTime, $14e0f24ef4ac5c92$export$126c91c941de7e as getHoursInDay, $14e0f24ef4ac5c92$export$aa8b41735afcabd2 as getLocalTimeZone, $14e0f24ef4ac5c92$export$a2258d9c4118825c as endOfMonth, $14e0f24ef4ac5c92$export$8b7aa55c66d5569e as endOfYear, $14e0f24ef4ac5c92$export$5412ac11713b72ad as getMinimumMonthInYear, $14e0f24ef4ac5c92$export$b2f4953d301981d5 as getMinimumDayInMonth, $14e0f24ef4ac5c92$export$42c81a444fbfb5d4 as startOfWeek, $14e0f24ef4ac5c92$export$ef8b6d9133084f4e as endOfWeek, $14e0f24ef4ac5c92$export$ccc1b2479e7dd654 as getWeeksInMonth, $14e0f24ef4ac5c92$export$5c333a116e949cdd as minDate, $14e0f24ef4ac5c92$export$a75f2bff57811055 as maxDate, $14e0f24ef4ac5c92$export$618d60ea299da42 as isWeekend, $14e0f24ef4ac5c92$export$ee9d87258e1d19ed as isWeekday};
256
+ //# sourceMappingURL=queries.mjs.map