@bereasoftware/time-guard 2.6.1 → 2.7.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.
Files changed (98) hide show
  1. package/README.en.md +232 -0
  2. package/README.md +259 -4
  3. package/dist/angular/index.cjs +148 -0
  4. package/dist/angular/index.d.ts +2 -0
  5. package/dist/angular/index.es.js +143 -0
  6. package/dist/angular.d.ts +59 -0
  7. package/dist/calendars/index.cjs +357 -2
  8. package/dist/calendars/index.es.js +99 -68
  9. package/dist/chunk-Ddh6569R.cjs +36 -0
  10. package/dist/core-BAd7GYfw.js +1809 -0
  11. package/dist/core-CafqOI7W.cjs +1892 -0
  12. package/dist/core.d.ts +224 -0
  13. package/dist/index.d.ts +9 -0
  14. package/dist/locales/african.locale.d.ts +7 -0
  15. package/dist/locales/index.cjs +7 -1
  16. package/dist/{types/locales → locales}/index.d.ts +2 -2
  17. package/dist/locales/index.es.js +3 -3
  18. package/dist/locales/south-american.locale.d.ts +7 -0
  19. package/dist/locales-C2-lOmC8.cjs +3537 -0
  20. package/dist/{locales-DSBvgSaw.js → locales-CcuSu4P1.js} +749 -33
  21. package/dist/native/index.cjs +48 -0
  22. package/dist/native/index.d.ts +2 -0
  23. package/dist/native/index.es.js +18 -0
  24. package/dist/native.d.ts +9 -0
  25. package/dist/plugins/advanced-format.cjs +105 -2
  26. package/dist/plugins/advanced-format.es.js +63 -45
  27. package/dist/plugins/duration.cjs +258 -2
  28. package/dist/plugins/duration.es.js +165 -61
  29. package/dist/plugins/relative-time.cjs +166 -2
  30. package/dist/plugins/relative-time.es.js +74 -37
  31. package/dist/qwik/index.cjs +104 -0
  32. package/dist/qwik/index.d.ts +2 -0
  33. package/dist/qwik/index.es.js +100 -0
  34. package/dist/qwik.d.ts +32 -0
  35. package/dist/react/index.cjs +112 -0
  36. package/dist/react/index.d.ts +2 -0
  37. package/dist/react/index.es.js +103 -0
  38. package/dist/react.d.ts +46 -0
  39. package/dist/solid/index.cjs +127 -0
  40. package/dist/solid/index.d.ts +2 -0
  41. package/dist/solid/index.es.js +122 -0
  42. package/dist/solid.d.ts +53 -0
  43. package/dist/svelte/index.cjs +398 -0
  44. package/dist/svelte/index.d.ts +2 -0
  45. package/dist/svelte/index.es.js +393 -0
  46. package/dist/svelte.d.ts +88 -0
  47. package/dist/time-guard.cjs +7359 -4
  48. package/dist/time-guard.es.js +3625 -8085
  49. package/dist/time-guard.iife.js +13549 -4
  50. package/dist/time-guard.umd.js +13550 -4
  51. package/dist/types/index.d.ts +651 -127
  52. package/dist/vue/index.cjs +143 -0
  53. package/dist/vue/index.d.ts +2 -0
  54. package/dist/vue/index.es.js +137 -0
  55. package/dist/vue.d.ts +35 -0
  56. package/package.json +107 -27
  57. package/dist/calendars/index.cjs.map +0 -1
  58. package/dist/calendars/index.es.js.map +0 -1
  59. package/dist/locales-DSBvgSaw.js.map +0 -1
  60. package/dist/locales-ybx7jS8G.cjs +0 -2
  61. package/dist/locales-ybx7jS8G.cjs.map +0 -1
  62. package/dist/plugins/advanced-format.cjs.map +0 -1
  63. package/dist/plugins/advanced-format.es.js.map +0 -1
  64. package/dist/plugins/duration.cjs.map +0 -1
  65. package/dist/plugins/duration.es.js.map +0 -1
  66. package/dist/plugins/relative-time.cjs.map +0 -1
  67. package/dist/plugins/relative-time.es.js.map +0 -1
  68. package/dist/time-guard.cjs.map +0 -1
  69. package/dist/time-guard.es.js.map +0 -1
  70. package/dist/time-guard.iife.js.map +0 -1
  71. package/dist/time-guard.umd.js.map +0 -1
  72. package/dist/types/types/index.d.ts +0 -641
  73. /package/dist/{types/adapters → adapters}/temporal.adapter.d.ts +0 -0
  74. /package/dist/{types/calendars → calendars}/calendar.manager.d.ts +0 -0
  75. /package/dist/{types/calendars → calendars}/index.d.ts +0 -0
  76. /package/dist/{types/formatters → formatters}/date.formatter.d.ts +0 -0
  77. /package/dist/{types/locales → locales}/additional.locale.d.ts +0 -0
  78. /package/dist/{types/locales → locales}/asian.locale.d.ts +0 -0
  79. /package/dist/{types/locales → locales}/english.locale.d.ts +0 -0
  80. /package/dist/{types/locales → locales}/european.locale.d.ts +0 -0
  81. /package/dist/{types/locales → locales}/locale.manager.d.ts +0 -0
  82. /package/dist/{types/locales → locales}/middle-eastern.locale.d.ts +0 -0
  83. /package/dist/{types/locales → locales}/nordic.locale.d.ts +0 -0
  84. /package/dist/{types/locales → locales}/romance.locale.d.ts +0 -0
  85. /package/dist/{types/locales → locales}/slavic.locale.d.ts +0 -0
  86. /package/dist/{types/locales → locales}/spanish.locale.d.ts +0 -0
  87. /package/dist/{types/plugins → plugins}/advanced-format/index.d.ts +0 -0
  88. /package/dist/{types/plugins → plugins}/advanced-format.d.ts +0 -0
  89. /package/dist/{types/plugins → plugins}/duration/index.d.ts +0 -0
  90. /package/dist/{types/plugins → plugins}/duration/types.d.ts +0 -0
  91. /package/dist/{types/plugins → plugins}/duration.d.ts +0 -0
  92. /package/dist/{types/plugins → plugins}/index.d.ts +0 -0
  93. /package/dist/{types/plugins → plugins}/manager.d.ts +0 -0
  94. /package/dist/{types/plugins → plugins}/relative-time/index.d.ts +0 -0
  95. /package/dist/{types/plugins → plugins}/relative-time/types.d.ts +0 -0
  96. /package/dist/{types/plugins → plugins}/relative-time.d.ts +0 -0
  97. /package/dist/{types/time-guard.d.ts → time-guard.d.ts} +0 -0
  98. /package/dist/{types/utils → utils}/duration-locale.d.ts +0 -0
@@ -1,2 +1,357 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=class{id=`islamic`;name=`Islamic Calendar (Hijri)`;locale=`ar`;monthNames=[`Muharram`,`Safar`,`Rabi al-awwal`,`Rabi al-thani`,`Jumada al-awwal`,`Jumada al-thani`,`Rajab`,`Sha'ban`,`Ramadan`,`Shawwal`,`Dhu al-Qi'dah`,`Dhu al-Hijjah`];getMonthName(e){return this.monthNames[Math.max(0,Math.min(11,e-1))]}getWeekdayName(e,t=!1){return(t?[`Ahd`,`Ith`,`Sel`,`Rab`,`Kha`,`Jum`,`Sab`]:[`Ahad`,`Ithnayn`,`Salasa`,`Rabi`,`Khamis`,`Jumah`,`Sabt`])[Math.max(0,Math.min(6,e-1))]}isLeapYear(e){return[2,5,7,10,13,16,18,21,24,26,29].includes(e%30)}daysInMonth(e,t){return t%2==1||t===12&&this.isLeapYear(e)?30:29}daysInYear(e){return this.isLeapYear(e)?355:354}},t=class{id=`hebrew`;name=`Hebrew Calendar`;locale=`he`;monthNames=[`Tishrei`,`Cheshvan`,`Kislev`,`Tevet`,`Shevat`,`Adar`,`Nisan`,`Iyar`,`Sivan`,`Tammuz`,`Av`,`Elul`];getMonthName(e){return this.monthNames[Math.max(0,Math.min(11,e-1))]}getWeekdayName(e,t=!1){return(t?[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`]:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`])[Math.max(0,Math.min(6,e-1))]}isLeapYear(e){return[3,6,8,11,14,17,19].includes(e%19)}daysInMonth(e,t){return[30,29,30,29,30,29,30,29,30,29,30,29][Math.max(0,Math.min(11,t-1))]}daysInYear(e){return this.isLeapYear(e)?384:354}},n=class{id=`chinese`;name=`Chinese Calendar`;locale=`zh`;monthNames=[`正月`,`二月`,`三月`,`四月`,`五月`,`六月`,`七月`,`八月`,`九月`,`十月`,`冬月`,`腊月`];terrestrialBranches=[`子`,`丑`,`寅`,`卯`,`辰`,`巳`,`午`,`未`,`申`,`酉`,`戌`,`亥`];getMonthName(e){return this.monthNames[Math.max(0,Math.min(11,e-1))]}getWeekdayName(e,t=!1){return(t?[`日`,`一`,`二`,`三`,`四`,`五`,`六`]:[`星期日`,`星期一`,`星期二`,`星期三`,`星期四`,`星期五`,`星期六`])[Math.max(0,Math.min(6,e-1))]}isLeapYear(e){return e%3==0}daysInMonth(e,t){return t%2==0?30:29}daysInYear(e){return this.isLeapYear(e)?384:354}getZodiacSign(e){return this.terrestrialBranches[e%12]}},r=class{id=`japanese`;name=`Japanese Calendar`;locale=`ja`;monthNames=[`1月`,`2月`,`3月`,`4月`,`5月`,`6月`,`7月`,`8月`,`9月`,`10月`,`11月`,`12月`];getMonthName(e){return this.monthNames[Math.max(0,Math.min(11,e-1))]}getWeekdayName(e,t=!1){return(t?[`日`,`月`,`火`,`水`,`木`,`金`,`土`]:[`日曜日`,`月曜日`,`火曜日`,`水曜日`,`木曜日`,`金曜日`,`土曜日`])[Math.max(0,Math.min(6,e-1))]}isLeapYear(e){return e%4==0&&e%100!=0||e%400==0}daysInMonth(e,t){return t===2&&this.isLeapYear(e)?29:[31,28,31,30,31,30,31,31,30,31,30,31][Math.max(0,Math.min(11,t-1))]}daysInYear(e){return this.isLeapYear(e)?366:365}},i=class{id=`buddhist`;name=`Buddhist Calendar`;locale=`th`;monthNames=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`];getMonthName(e){return this.monthNames[Math.max(0,Math.min(11,e-1))]}getWeekdayName(e){return[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`][Math.max(0,Math.min(6,e-1))]}isLeapYear(e){let t=e-543;return t%4==0&&t%100!=0||t%400==0}daysInMonth(e,t){return t===2&&this.isLeapYear(e)?29:[31,28,31,30,31,30,31,31,30,31,30,31][Math.max(0,Math.min(11,t-1))]}daysInYear(e){return this.isLeapYear(e)?366:365}};exports.BuddhistCalendar=i,exports.ChineseCalendar=n,exports.HebrewCalendar=t,exports.IslamicCalendar=e,exports.JapaneseCalendar=r;
2
- //# sourceMappingURL=index.cjs.map
1
+ /*! time-guard v2.7.0 | (c) 2026 Berea-Soft | MIT License | https://github.com/Berea-Soft/time-guard */
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ //#region src/calendars/index.ts
4
+ /**
5
+ * Islamic Calendar (Hijri)
6
+ * @experimental Uses simplified calculations. May not be accurate for all dates.
7
+ */
8
+ var IslamicCalendar = class {
9
+ id = "islamic";
10
+ name = "Islamic Calendar (Hijri)";
11
+ locale = "ar";
12
+ monthNames = [
13
+ "Muharram",
14
+ "Safar",
15
+ "Rabi al-awwal",
16
+ "Rabi al-thani",
17
+ "Jumada al-awwal",
18
+ "Jumada al-thani",
19
+ "Rajab",
20
+ "Sha'ban",
21
+ "Ramadan",
22
+ "Shawwal",
23
+ "Dhu al-Qi'dah",
24
+ "Dhu al-Hijjah"
25
+ ];
26
+ getMonthName(month) {
27
+ return this.monthNames[Math.max(0, Math.min(11, month - 1))];
28
+ }
29
+ getWeekdayName(day, short = false) {
30
+ return (short ? [
31
+ "Ahd",
32
+ "Ith",
33
+ "Sel",
34
+ "Rab",
35
+ "Kha",
36
+ "Jum",
37
+ "Sab"
38
+ ] : [
39
+ "Ahad",
40
+ "Ithnayn",
41
+ "Salasa",
42
+ "Rabi",
43
+ "Khamis",
44
+ "Jumah",
45
+ "Sabt"
46
+ ])[Math.max(0, Math.min(6, day - 1))];
47
+ }
48
+ isLeapYear(year) {
49
+ return [
50
+ 2,
51
+ 5,
52
+ 7,
53
+ 10,
54
+ 13,
55
+ 16,
56
+ 18,
57
+ 21,
58
+ 24,
59
+ 26,
60
+ 29
61
+ ].includes(year % 30);
62
+ }
63
+ daysInMonth(year, month) {
64
+ if (month % 2 === 1) return 30;
65
+ if (month === 12 && this.isLeapYear(year)) return 30;
66
+ return 29;
67
+ }
68
+ daysInYear(year) {
69
+ return this.isLeapYear(year) ? 355 : 354;
70
+ }
71
+ };
72
+ /**
73
+ * Hebrew Calendar
74
+ * @experimental Uses simplified calculations. May not be accurate for all dates.
75
+ */
76
+ var HebrewCalendar = class {
77
+ id = "hebrew";
78
+ name = "Hebrew Calendar";
79
+ locale = "he";
80
+ monthNames = [
81
+ "Tishrei",
82
+ "Cheshvan",
83
+ "Kislev",
84
+ "Tevet",
85
+ "Shevat",
86
+ "Adar",
87
+ "Nisan",
88
+ "Iyar",
89
+ "Sivan",
90
+ "Tammuz",
91
+ "Av",
92
+ "Elul"
93
+ ];
94
+ getMonthName(month) {
95
+ return this.monthNames[Math.max(0, Math.min(11, month - 1))];
96
+ }
97
+ getWeekdayName(day, short = false) {
98
+ return (short ? [
99
+ "Sun",
100
+ "Mon",
101
+ "Tue",
102
+ "Wed",
103
+ "Thu",
104
+ "Fri",
105
+ "Sat"
106
+ ] : [
107
+ "Sunday",
108
+ "Monday",
109
+ "Tuesday",
110
+ "Wednesday",
111
+ "Thursday",
112
+ "Friday",
113
+ "Saturday"
114
+ ])[Math.max(0, Math.min(6, day - 1))];
115
+ }
116
+ isLeapYear(year) {
117
+ return [
118
+ 3,
119
+ 6,
120
+ 8,
121
+ 11,
122
+ 14,
123
+ 17,
124
+ 19
125
+ ].includes(year % 19);
126
+ }
127
+ daysInMonth(_year, month) {
128
+ return [
129
+ 30,
130
+ 29,
131
+ 30,
132
+ 29,
133
+ 30,
134
+ 29,
135
+ 30,
136
+ 29,
137
+ 30,
138
+ 29,
139
+ 30,
140
+ 29
141
+ ][Math.max(0, Math.min(11, month - 1))];
142
+ }
143
+ daysInYear(year) {
144
+ return this.isLeapYear(year) ? 384 : 354;
145
+ }
146
+ };
147
+ /**
148
+ * Chinese Calendar
149
+ * @experimental Uses simplified calculations. May not be accurate for all dates.
150
+ */
151
+ var ChineseCalendar = class {
152
+ id = "chinese";
153
+ name = "Chinese Calendar";
154
+ locale = "zh";
155
+ monthNames = [
156
+ "正月",
157
+ "二月",
158
+ "三月",
159
+ "四月",
160
+ "五月",
161
+ "六月",
162
+ "七月",
163
+ "八月",
164
+ "九月",
165
+ "十月",
166
+ "冬月",
167
+ "腊月"
168
+ ];
169
+ terrestrialBranches = [
170
+ "子",
171
+ "丑",
172
+ "寅",
173
+ "卯",
174
+ "辰",
175
+ "巳",
176
+ "午",
177
+ "未",
178
+ "申",
179
+ "酉",
180
+ "戌",
181
+ "亥"
182
+ ];
183
+ getMonthName(month) {
184
+ return this.monthNames[Math.max(0, Math.min(11, month - 1))];
185
+ }
186
+ getWeekdayName(day, short = false) {
187
+ return (short ? [
188
+ "日",
189
+ "一",
190
+ "二",
191
+ "三",
192
+ "四",
193
+ "五",
194
+ "六"
195
+ ] : [
196
+ "星期日",
197
+ "星期一",
198
+ "星期二",
199
+ "星期三",
200
+ "星期四",
201
+ "星期五",
202
+ "星期六"
203
+ ])[Math.max(0, Math.min(6, day - 1))];
204
+ }
205
+ isLeapYear(year) {
206
+ return year % 3 === 0;
207
+ }
208
+ daysInMonth(_year, month) {
209
+ return month % 2 === 0 ? 30 : 29;
210
+ }
211
+ daysInYear(year) {
212
+ return this.isLeapYear(year) ? 384 : 354;
213
+ }
214
+ /**
215
+ * Get zodiac sign for year
216
+ */
217
+ getZodiacSign(year) {
218
+ return this.terrestrialBranches[year % 12];
219
+ }
220
+ };
221
+ /**
222
+ * Japanese Calendar
223
+ * @experimental Uses Gregorian rules post-1873. Historical dates may not be accurate.
224
+ */
225
+ var JapaneseCalendar = class {
226
+ id = "japanese";
227
+ name = "Japanese Calendar";
228
+ locale = "ja";
229
+ monthNames = [
230
+ "1月",
231
+ "2月",
232
+ "3月",
233
+ "4月",
234
+ "5月",
235
+ "6月",
236
+ "7月",
237
+ "8月",
238
+ "9月",
239
+ "10月",
240
+ "11月",
241
+ "12月"
242
+ ];
243
+ getMonthName(month) {
244
+ return this.monthNames[Math.max(0, Math.min(11, month - 1))];
245
+ }
246
+ getWeekdayName(day, short = false) {
247
+ return (short ? [
248
+ "日",
249
+ "月",
250
+ "火",
251
+ "水",
252
+ "木",
253
+ "金",
254
+ "土"
255
+ ] : [
256
+ "日曜日",
257
+ "月曜日",
258
+ "火曜日",
259
+ "水曜日",
260
+ "木曜日",
261
+ "金曜日",
262
+ "土曜日"
263
+ ])[Math.max(0, Math.min(6, day - 1))];
264
+ }
265
+ isLeapYear(year) {
266
+ return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
267
+ }
268
+ daysInMonth(year, month) {
269
+ const daysPerMonth = [
270
+ 31,
271
+ 28,
272
+ 31,
273
+ 30,
274
+ 31,
275
+ 30,
276
+ 31,
277
+ 31,
278
+ 30,
279
+ 31,
280
+ 30,
281
+ 31
282
+ ];
283
+ if (month === 2 && this.isLeapYear(year)) return 29;
284
+ return daysPerMonth[Math.max(0, Math.min(11, month - 1))];
285
+ }
286
+ daysInYear(year) {
287
+ return this.isLeapYear(year) ? 366 : 365;
288
+ }
289
+ };
290
+ /**
291
+ * Buddhist Calendar
292
+ * @experimental Uses Gregorian rules with BE year offset (CE + 543).
293
+ */
294
+ var BuddhistCalendar = class {
295
+ id = "buddhist";
296
+ name = "Buddhist Calendar";
297
+ locale = "th";
298
+ monthNames = [
299
+ "January",
300
+ "February",
301
+ "March",
302
+ "April",
303
+ "May",
304
+ "June",
305
+ "July",
306
+ "August",
307
+ "September",
308
+ "October",
309
+ "November",
310
+ "December"
311
+ ];
312
+ getMonthName(month) {
313
+ return this.monthNames[Math.max(0, Math.min(11, month - 1))];
314
+ }
315
+ getWeekdayName(day) {
316
+ return [
317
+ "Sunday",
318
+ "Monday",
319
+ "Tuesday",
320
+ "Wednesday",
321
+ "Thursday",
322
+ "Friday",
323
+ "Saturday"
324
+ ][Math.max(0, Math.min(6, day - 1))];
325
+ }
326
+ isLeapYear(year) {
327
+ const ceYear = year - 543;
328
+ return ceYear % 4 === 0 && ceYear % 100 !== 0 || ceYear % 400 === 0;
329
+ }
330
+ daysInMonth(year, month) {
331
+ const daysPerMonth = [
332
+ 31,
333
+ 28,
334
+ 31,
335
+ 30,
336
+ 31,
337
+ 30,
338
+ 31,
339
+ 31,
340
+ 30,
341
+ 31,
342
+ 30,
343
+ 31
344
+ ];
345
+ if (month === 2 && this.isLeapYear(year)) return 29;
346
+ return daysPerMonth[Math.max(0, Math.min(11, month - 1))];
347
+ }
348
+ daysInYear(year) {
349
+ return this.isLeapYear(year) ? 366 : 365;
350
+ }
351
+ };
352
+ //#endregion
353
+ exports.BuddhistCalendar = BuddhistCalendar;
354
+ exports.ChineseCalendar = ChineseCalendar;
355
+ exports.HebrewCalendar = HebrewCalendar;
356
+ exports.IslamicCalendar = IslamicCalendar;
357
+ exports.JapaneseCalendar = JapaneseCalendar;
@@ -1,6 +1,10 @@
1
- /*! time-guard v2.6.1 | (c) 2026 Berea-Soft | MIT License | https://github.com/Berea-Soft/time-guard */
1
+ /*! time-guard v2.7.0 | (c) 2026 Berea-Soft | MIT License | https://github.com/Berea-Soft/time-guard */
2
2
  //#region src/calendars/index.ts
3
- var e = class {
3
+ /**
4
+ * Islamic Calendar (Hijri)
5
+ * @experimental Uses simplified calculations. May not be accurate for all dates.
6
+ */
7
+ var IslamicCalendar = class {
4
8
  id = "islamic";
5
9
  name = "Islamic Calendar (Hijri)";
6
10
  locale = "ar";
@@ -18,11 +22,11 @@ var e = class {
18
22
  "Dhu al-Qi'dah",
19
23
  "Dhu al-Hijjah"
20
24
  ];
21
- getMonthName(e) {
22
- return this.monthNames[Math.max(0, Math.min(11, e - 1))];
25
+ getMonthName(month) {
26
+ return this.monthNames[Math.max(0, Math.min(11, month - 1))];
23
27
  }
24
- getWeekdayName(e, t = !1) {
25
- return (t ? [
28
+ getWeekdayName(day, short = false) {
29
+ return (short ? [
26
30
  "Ahd",
27
31
  "Ith",
28
32
  "Sel",
@@ -38,9 +42,9 @@ var e = class {
38
42
  "Khamis",
39
43
  "Jumah",
40
44
  "Sabt"
41
- ])[Math.max(0, Math.min(6, e - 1))];
45
+ ])[Math.max(0, Math.min(6, day - 1))];
42
46
  }
43
- isLeapYear(e) {
47
+ isLeapYear(year) {
44
48
  return [
45
49
  2,
46
50
  5,
@@ -53,15 +57,22 @@ var e = class {
53
57
  24,
54
58
  26,
55
59
  29
56
- ].includes(e % 30);
60
+ ].includes(year % 30);
57
61
  }
58
- daysInMonth(e, t) {
59
- return t % 2 == 1 || t === 12 && this.isLeapYear(e) ? 30 : 29;
62
+ daysInMonth(year, month) {
63
+ if (month % 2 === 1) return 30;
64
+ if (month === 12 && this.isLeapYear(year)) return 30;
65
+ return 29;
60
66
  }
61
- daysInYear(e) {
62
- return this.isLeapYear(e) ? 355 : 354;
67
+ daysInYear(year) {
68
+ return this.isLeapYear(year) ? 355 : 354;
63
69
  }
64
- }, t = class {
70
+ };
71
+ /**
72
+ * Hebrew Calendar
73
+ * @experimental Uses simplified calculations. May not be accurate for all dates.
74
+ */
75
+ var HebrewCalendar = class {
65
76
  id = "hebrew";
66
77
  name = "Hebrew Calendar";
67
78
  locale = "he";
@@ -79,11 +90,11 @@ var e = class {
79
90
  "Av",
80
91
  "Elul"
81
92
  ];
82
- getMonthName(e) {
83
- return this.monthNames[Math.max(0, Math.min(11, e - 1))];
93
+ getMonthName(month) {
94
+ return this.monthNames[Math.max(0, Math.min(11, month - 1))];
84
95
  }
85
- getWeekdayName(e, t = !1) {
86
- return (t ? [
96
+ getWeekdayName(day, short = false) {
97
+ return (short ? [
87
98
  "Sun",
88
99
  "Mon",
89
100
  "Tue",
@@ -99,9 +110,9 @@ var e = class {
99
110
  "Thursday",
100
111
  "Friday",
101
112
  "Saturday"
102
- ])[Math.max(0, Math.min(6, e - 1))];
113
+ ])[Math.max(0, Math.min(6, day - 1))];
103
114
  }
104
- isLeapYear(e) {
115
+ isLeapYear(year) {
105
116
  return [
106
117
  3,
107
118
  6,
@@ -110,9 +121,9 @@ var e = class {
110
121
  14,
111
122
  17,
112
123
  19
113
- ].includes(e % 19);
124
+ ].includes(year % 19);
114
125
  }
115
- daysInMonth(e, t) {
126
+ daysInMonth(_year, month) {
116
127
  return [
117
128
  30,
118
129
  29,
@@ -126,12 +137,17 @@ var e = class {
126
137
  29,
127
138
  30,
128
139
  29
129
- ][Math.max(0, Math.min(11, t - 1))];
140
+ ][Math.max(0, Math.min(11, month - 1))];
130
141
  }
131
- daysInYear(e) {
132
- return this.isLeapYear(e) ? 384 : 354;
142
+ daysInYear(year) {
143
+ return this.isLeapYear(year) ? 384 : 354;
133
144
  }
134
- }, n = class {
145
+ };
146
+ /**
147
+ * Chinese Calendar
148
+ * @experimental Uses simplified calculations. May not be accurate for all dates.
149
+ */
150
+ var ChineseCalendar = class {
135
151
  id = "chinese";
136
152
  name = "Chinese Calendar";
137
153
  locale = "zh";
@@ -163,11 +179,11 @@ var e = class {
163
179
  "戌",
164
180
  "亥"
165
181
  ];
166
- getMonthName(e) {
167
- return this.monthNames[Math.max(0, Math.min(11, e - 1))];
182
+ getMonthName(month) {
183
+ return this.monthNames[Math.max(0, Math.min(11, month - 1))];
168
184
  }
169
- getWeekdayName(e, t = !1) {
170
- return (t ? [
185
+ getWeekdayName(day, short = false) {
186
+ return (short ? [
171
187
  "日",
172
188
  "一",
173
189
  "二",
@@ -183,21 +199,29 @@ var e = class {
183
199
  "星期四",
184
200
  "星期五",
185
201
  "星期六"
186
- ])[Math.max(0, Math.min(6, e - 1))];
202
+ ])[Math.max(0, Math.min(6, day - 1))];
187
203
  }
188
- isLeapYear(e) {
189
- return e % 3 == 0;
204
+ isLeapYear(year) {
205
+ return year % 3 === 0;
190
206
  }
191
- daysInMonth(e, t) {
192
- return t % 2 == 0 ? 30 : 29;
207
+ daysInMonth(_year, month) {
208
+ return month % 2 === 0 ? 30 : 29;
193
209
  }
194
- daysInYear(e) {
195
- return this.isLeapYear(e) ? 384 : 354;
210
+ daysInYear(year) {
211
+ return this.isLeapYear(year) ? 384 : 354;
196
212
  }
197
- getZodiacSign(e) {
198
- return this.terrestrialBranches[e % 12];
213
+ /**
214
+ * Get zodiac sign for year
215
+ */
216
+ getZodiacSign(year) {
217
+ return this.terrestrialBranches[year % 12];
199
218
  }
200
- }, r = class {
219
+ };
220
+ /**
221
+ * Japanese Calendar
222
+ * @experimental Uses Gregorian rules post-1873. Historical dates may not be accurate.
223
+ */
224
+ var JapaneseCalendar = class {
201
225
  id = "japanese";
202
226
  name = "Japanese Calendar";
203
227
  locale = "ja";
@@ -215,11 +239,11 @@ var e = class {
215
239
  "11月",
216
240
  "12月"
217
241
  ];
218
- getMonthName(e) {
219
- return this.monthNames[Math.max(0, Math.min(11, e - 1))];
242
+ getMonthName(month) {
243
+ return this.monthNames[Math.max(0, Math.min(11, month - 1))];
220
244
  }
221
- getWeekdayName(e, t = !1) {
222
- return (t ? [
245
+ getWeekdayName(day, short = false) {
246
+ return (short ? [
223
247
  "日",
224
248
  "月",
225
249
  "火",
@@ -235,13 +259,13 @@ var e = class {
235
259
  "木曜日",
236
260
  "金曜日",
237
261
  "土曜日"
238
- ])[Math.max(0, Math.min(6, e - 1))];
262
+ ])[Math.max(0, Math.min(6, day - 1))];
239
263
  }
240
- isLeapYear(e) {
241
- return e % 4 == 0 && e % 100 != 0 || e % 400 == 0;
264
+ isLeapYear(year) {
265
+ return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
242
266
  }
243
- daysInMonth(e, t) {
244
- return t === 2 && this.isLeapYear(e) ? 29 : [
267
+ daysInMonth(year, month) {
268
+ const daysPerMonth = [
245
269
  31,
246
270
  28,
247
271
  31,
@@ -254,12 +278,19 @@ var e = class {
254
278
  31,
255
279
  30,
256
280
  31
257
- ][Math.max(0, Math.min(11, t - 1))];
281
+ ];
282
+ if (month === 2 && this.isLeapYear(year)) return 29;
283
+ return daysPerMonth[Math.max(0, Math.min(11, month - 1))];
258
284
  }
259
- daysInYear(e) {
260
- return this.isLeapYear(e) ? 366 : 365;
285
+ daysInYear(year) {
286
+ return this.isLeapYear(year) ? 366 : 365;
261
287
  }
262
- }, i = class {
288
+ };
289
+ /**
290
+ * Buddhist Calendar
291
+ * @experimental Uses Gregorian rules with BE year offset (CE + 543).
292
+ */
293
+ var BuddhistCalendar = class {
263
294
  id = "buddhist";
264
295
  name = "Buddhist Calendar";
265
296
  locale = "th";
@@ -277,10 +308,10 @@ var e = class {
277
308
  "November",
278
309
  "December"
279
310
  ];
280
- getMonthName(e) {
281
- return this.monthNames[Math.max(0, Math.min(11, e - 1))];
311
+ getMonthName(month) {
312
+ return this.monthNames[Math.max(0, Math.min(11, month - 1))];
282
313
  }
283
- getWeekdayName(e) {
314
+ getWeekdayName(day) {
284
315
  return [
285
316
  "Sunday",
286
317
  "Monday",
@@ -289,14 +320,14 @@ var e = class {
289
320
  "Thursday",
290
321
  "Friday",
291
322
  "Saturday"
292
- ][Math.max(0, Math.min(6, e - 1))];
323
+ ][Math.max(0, Math.min(6, day - 1))];
293
324
  }
294
- isLeapYear(e) {
295
- let t = e - 543;
296
- return t % 4 == 0 && t % 100 != 0 || t % 400 == 0;
325
+ isLeapYear(year) {
326
+ const ceYear = year - 543;
327
+ return ceYear % 4 === 0 && ceYear % 100 !== 0 || ceYear % 400 === 0;
297
328
  }
298
- daysInMonth(e, t) {
299
- return t === 2 && this.isLeapYear(e) ? 29 : [
329
+ daysInMonth(year, month) {
330
+ const daysPerMonth = [
300
331
  31,
301
332
  28,
302
333
  31,
@@ -309,13 +340,13 @@ var e = class {
309
340
  31,
310
341
  30,
311
342
  31
312
- ][Math.max(0, Math.min(11, t - 1))];
343
+ ];
344
+ if (month === 2 && this.isLeapYear(year)) return 29;
345
+ return daysPerMonth[Math.max(0, Math.min(11, month - 1))];
313
346
  }
314
- daysInYear(e) {
315
- return this.isLeapYear(e) ? 366 : 365;
347
+ daysInYear(year) {
348
+ return this.isLeapYear(year) ? 366 : 365;
316
349
  }
317
350
  };
318
351
  //#endregion
319
- export { i as BuddhistCalendar, n as ChineseCalendar, t as HebrewCalendar, e as IslamicCalendar, r as JapaneseCalendar };
320
-
321
- //# sourceMappingURL=index.es.js.map
352
+ export { BuddhistCalendar, ChineseCalendar, HebrewCalendar, IslamicCalendar, JapaneseCalendar };
@@ -0,0 +1,36 @@
1
+ /*! time-guard v2.7.0 | (c) 2026 Berea-Soft | MIT License | https://github.com/Berea-Soft/time-guard */
2
+ //#region \0rolldown/runtime.js
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
12
+ key = keys[i];
13
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
21
+ value: mod,
22
+ enumerable: true
23
+ }) : target, mod));
24
+ //#endregion
25
+ Object.defineProperty(exports, "__commonJSMin", {
26
+ enumerable: true,
27
+ get: function() {
28
+ return __commonJSMin;
29
+ }
30
+ });
31
+ Object.defineProperty(exports, "__toESM", {
32
+ enumerable: true,
33
+ get: function() {
34
+ return __toESM;
35
+ }
36
+ });