@hebcal/core 5.4.7 → 5.4.9

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/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v5.4.7 */
1
+ /*! @hebcal/core v5.4.9 */
2
2
  'use strict';
3
3
 
4
4
  /* eslint-disable @typescript-eslint/no-namespace, no-inner-declarations */
@@ -39,107 +39,106 @@ function yearFromFixed(abs) {
39
39
  const ABS_14SEP1752 = 639797;
40
40
  const ABS_2SEP1752 = 639785;
41
41
  */
42
+ /*
43
+ * Formerly in namespace, now top-level
44
+ */
42
45
  /**
43
- * Gregorian date helper functions.
46
+ * Returns true if the Gregorian year is a leap year
47
+ * @param year Gregorian year
44
48
  */
45
- exports.greg = void 0;
46
- (function (greg) {
47
- /**
48
- * Returns true if the Gregorian year is a leap year
49
- * @param {number} year Gregorian year
50
- * @return {boolean}
51
- */
52
- function isLeapYear(year) {
53
- return !(year % 4) && (!!(year % 100) || !(year % 400));
49
+ function isGregLeapYear(year) {
50
+ return !(year % 4) && (!!(year % 100) || !(year % 400));
51
+ }
52
+ /**
53
+ * Number of days in the Gregorian month for given year
54
+ * @param month Gregorian month (1=January, 12=December)
55
+ * @param year Gregorian year
56
+ */
57
+ function daysInGregMonth(month, year) {
58
+ // 1 based months
59
+ return monthLengths[+isGregLeapYear(year)][month];
60
+ }
61
+ /**
62
+ * Returns true if the object is a Javascript Date
63
+ */
64
+ function isDate(obj) {
65
+ // eslint-disable-next-line no-prototype-builtins
66
+ return typeof obj === 'object' && Date.prototype.isPrototypeOf(obj);
67
+ }
68
+ /**
69
+ * @private
70
+ * @param year
71
+ * @param month (1-12)
72
+ * @param day (1-31)
73
+ */
74
+ function toFixed(year, month, day) {
75
+ const py = year - 1;
76
+ return (365 * py +
77
+ quotient(py, 4) -
78
+ quotient(py, 100) +
79
+ quotient(py, 400) +
80
+ quotient(367 * month - 362, 12) +
81
+ (month <= 2 ? 0 : isGregLeapYear(year) ? -1 : -2) +
82
+ day);
83
+ }
84
+ /**
85
+ * Converts Gregorian date to absolute R.D. (Rata Die) days
86
+ * @param date Gregorian date
87
+ */
88
+ function greg2abs(date) {
89
+ if (!isDate(date)) {
90
+ throw new TypeError(`Argument not a Date: ${date}`);
54
91
  }
55
- greg.isLeapYear = isLeapYear;
56
- /**
57
- * Number of days in the Gregorian month for given year
58
- * @param {number} month Gregorian month (1=January, 12=December)
59
- * @param {number} year Gregorian year
60
- * @return {number}
61
- */
62
- function daysInMonth(month, year) {
63
- // 1 based months
64
- return monthLengths[+isLeapYear(year)][month];
92
+ const abs = toFixed(date.getFullYear(), date.getMonth() + 1, date.getDate());
93
+ /*
94
+ if (abs < ABS_14SEP1752 && abs > ABS_2SEP1752) {
95
+ throw new RangeError(`Invalid Date: ${date}`);
96
+ }
97
+ */
98
+ return abs;
99
+ }
100
+ /**
101
+ * Converts from Rata Die (R.D. number) to Gregorian date.
102
+ * See the footnote on page 384 of ``Calendrical Calculations, Part II:
103
+ * Three Historical Calendars'' by E. M. Reingold, N. Dershowitz, and S. M.
104
+ * Clamen, Software--Practice and Experience, Volume 23, Number 4
105
+ * (April, 1993), pages 383-404 for an explanation.
106
+ * @param abs - R.D. number of days
107
+ */
108
+ function abs2greg(abs) {
109
+ if (typeof abs !== 'number') {
110
+ throw new TypeError(`Argument not a Number: ${abs}`);
65
111
  }
66
- greg.daysInMonth = daysInMonth;
67
- /**
68
- * Returns true if the object is a Javascript Date
69
- * @param {Object} obj
70
- * @return {boolean}
71
- */
72
- function isDate(obj) {
73
- // eslint-disable-next-line no-prototype-builtins
74
- return typeof obj === 'object' && Date.prototype.isPrototypeOf(obj);
112
+ abs = Math.trunc(abs);
113
+ /*
114
+ if (abs < ABS_14SEP1752 && abs > ABS_2SEP1752) {
115
+ throw new RangeError(`Invalid Date: ${abs}`);
116
+ }
117
+ */
118
+ const year = yearFromFixed(abs);
119
+ const priorDays = abs - toFixed(year, 1, 1);
120
+ const correction = abs < toFixed(year, 3, 1) ? 0 : isGregLeapYear(year) ? 1 : 2;
121
+ const month = quotient(12 * (priorDays + correction) + 373, 367);
122
+ const day = abs - toFixed(year, month, 1) + 1;
123
+ const dt = new Date(year, month - 1, day);
124
+ if (year < 100 && year >= 0) {
125
+ dt.setFullYear(year);
75
126
  }
76
- greg.isDate = isDate;
77
- /**
78
- * @private
79
- * @param year
80
- * @param month (1-12)
81
- * @param day (1-31)
82
- */
83
- function toFixed(year, month, day) {
84
- const py = year - 1;
85
- return (365 * py +
86
- quotient(py, 4) -
87
- quotient(py, 100) +
88
- quotient(py, 400) +
89
- quotient(367 * month - 362, 12) +
90
- (month <= 2 ? 0 : isLeapYear(year) ? -1 : -2) +
91
- day);
92
- }
93
- /**
94
- * Converts Gregorian date to absolute R.D. (Rata Die) days
95
- * @param {Date} date Gregorian date
96
- * @return {number}
97
- */
98
- function greg2abs(date) {
99
- if (!isDate(date)) {
100
- throw new TypeError(`Argument not a Date: ${date}`);
101
- }
102
- const abs = toFixed(date.getFullYear(), date.getMonth() + 1, date.getDate());
103
- /*
104
- if (abs < ABS_14SEP1752 && abs > ABS_2SEP1752) {
105
- throw new RangeError(`Invalid Date: ${date}`);
106
- }
107
- */
108
- return abs;
109
- }
110
- greg.greg2abs = greg2abs;
111
- /**
112
- * Converts from Rata Die (R.D. number) to Gregorian date.
113
- * See the footnote on page 384 of ``Calendrical Calculations, Part II:
114
- * Three Historical Calendars'' by E. M. Reingold, N. Dershowitz, and S. M.
115
- * Clamen, Software--Practice and Experience, Volume 23, Number 4
116
- * (April, 1993), pages 383-404 for an explanation.
117
- * @param {number} abs - R.D. number of days
118
- * @return {Date}
119
- */
120
- function abs2greg(abs) {
121
- if (typeof abs !== 'number') {
122
- throw new TypeError(`Argument not a Number: ${abs}`);
123
- }
124
- abs = Math.trunc(abs);
125
- /*
126
- if (abs < ABS_14SEP1752 && abs > ABS_2SEP1752) {
127
- throw new RangeError(`Invalid Date: ${abs}`);
128
- }
129
- */
130
- const year = yearFromFixed(abs);
131
- const priorDays = abs - toFixed(year, 1, 1);
132
- const correction = abs < toFixed(year, 3, 1) ? 0 : isLeapYear(year) ? 1 : 2;
133
- const month = quotient(12 * (priorDays + correction) + 373, 367);
134
- const day = abs - toFixed(year, month, 1) + 1;
135
- const dt = new Date(year, month - 1, day);
136
- if (year < 100 && year >= 0) {
137
- dt.setFullYear(year);
138
- }
139
- return dt;
140
- }
141
- greg.abs2greg = abs2greg;
127
+ return dt;
128
+ }
129
+
130
+ /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-namespace */
131
+ /**
132
+ * Gregorian date helper functions
133
+ */
134
+ exports.greg = void 0;
135
+ (function (greg) {
142
136
  })(exports.greg || (exports.greg = {}));
137
+ exports.greg.abs2greg = abs2greg;
138
+ exports.greg.daysInMonth = daysInGregMonth;
139
+ exports.greg.greg2abs = greg2abs;
140
+ exports.greg.isDate = isDate;
141
+ exports.greg.isLeapYear = isGregLeapYear;
143
142
 
144
143
  /*
145
144
  * More minimal HDate
@@ -229,10 +228,9 @@ function assertNumber(n, name) {
229
228
  * Converts Hebrew date to R.D. (Rata Die) fixed days.
230
229
  * R.D. 1 is the imaginary date Monday, January 1, 1 on the Gregorian
231
230
  * Calendar.
232
- * @param {number} year Hebrew year
233
- * @param {number} month Hebrew month
234
- * @param {number} day Hebrew date (1-30)
235
- * @return {number}
231
+ * @param year Hebrew year
232
+ * @param month Hebrew month
233
+ * @param day Hebrew date (1-30)
236
234
  */
237
235
  function hebrew2abs(year, month, day) {
238
236
  assertNumber(year, 'year');
@@ -265,8 +263,7 @@ function newYear(year) {
265
263
  }
266
264
  /**
267
265
  * Converts absolute R.D. days to Hebrew date
268
- * @param {number} abs absolute R.D. days
269
- * @return {SimpleHebrewDate}
266
+ * @param abs absolute R.D. days
270
267
  */
271
268
  function abs2hebrew(abs) {
272
269
  assertNumber(abs, 'abs');
@@ -289,25 +286,22 @@ function abs2hebrew(abs) {
289
286
  }
290
287
  /**
291
288
  * Returns true if Hebrew year is a leap year
292
- * @param {number} year Hebrew year
293
- * @return {boolean}
289
+ * @param year Hebrew year
294
290
  */
295
291
  function isLeapYear(year) {
296
292
  return (1 + year * 7) % 19 < 7;
297
293
  }
298
294
  /**
299
295
  * Number of months in this Hebrew year (either 12 or 13 depending on leap year)
300
- * @param {number} year Hebrew year
301
- * @return {number}
296
+ * @param year Hebrew year
302
297
  */
303
298
  function monthsInYear(year) {
304
299
  return 12 + +isLeapYear(year); // boolean is cast to 1 or 0
305
300
  }
306
301
  /**
307
302
  * Number of days in Hebrew month in a given year (29 or 30)
308
- * @param {number} month Hebrew month (e.g. months.TISHREI)
309
- * @param {number} year Hebrew year
310
- * @return {number}
303
+ * @param month Hebrew month (e.g. months.TISHREI)
304
+ * @param year Hebrew year
311
305
  */
312
306
  function daysInMonth(month, year) {
313
307
  switch (month) {
@@ -330,8 +324,8 @@ function daysInMonth(month, year) {
330
324
  /**
331
325
  * Returns a transliterated string name of Hebrew month in year,
332
326
  * for example 'Elul' or 'Cheshvan'.
333
- * @param {number} month Hebrew month (e.g. months.TISHREI)
334
- * @param {number} year Hebrew year
327
+ * @param month Hebrew month (e.g. months.TISHREI)
328
+ * @param year Hebrew year
335
329
  */
336
330
  function getMonthName(month, year) {
337
331
  assertNumber(month, 'month');
@@ -344,8 +338,7 @@ function getMonthName(month, year) {
344
338
  /**
345
339
  * Days from sunday prior to start of Hebrew calendar to mean
346
340
  * conjunction of Tishrei in Hebrew YEAR
347
- * @param {number} year Hebrew year
348
- * @return {number}
341
+ * @param year Hebrew year
349
342
  */
350
343
  function elapsedDays(year) {
351
344
  const n = edCache.get(year);
@@ -391,32 +384,28 @@ function elapsedDays0(year) {
391
384
  * Number of days in the hebrew YEAR.
392
385
  * A common Hebrew calendar year can have a length of 353, 354 or 355 days
393
386
  * A leap Hebrew calendar year can have a length of 383, 384 or 385 days
394
- * @param {number} year Hebrew year
395
- * @return {number}
387
+ * @param year Hebrew year
396
388
  */
397
389
  function daysInYear(year) {
398
390
  return elapsedDays(year + 1) - elapsedDays(year);
399
391
  }
400
392
  /**
401
393
  * true if Cheshvan is long in Hebrew year
402
- * @param {number} year Hebrew year
403
- * @return {boolean}
394
+ * @param year Hebrew year
404
395
  */
405
396
  function longCheshvan(year) {
406
397
  return daysInYear(year) % 10 === 5;
407
398
  }
408
399
  /**
409
400
  * true if Kislev is short in Hebrew year
410
- * @param {number} year Hebrew year
411
- * @return {boolean}
401
+ * @param year Hebrew year
412
402
  */
413
403
  function shortKislev(year) {
414
404
  return daysInYear(year) % 10 === 3;
415
405
  }
416
406
  /**
417
407
  * Converts Hebrew month string name to numeric
418
- * @param {string} monthName monthName
419
- * @return {number}
408
+ * @param monthName monthName
420
409
  */
421
410
  function monthFromName(monthName) {
422
411
  if (typeof monthName === 'number') {
@@ -541,7 +530,6 @@ const ADAR_II$1 = months.ADAR_II;
541
530
  /**
542
531
  * Returns true if the object is a SimpleHebrewDate
543
532
  * @private
544
- * @param {Object} obj
545
533
  */
546
534
  function isSimpleHebrewDate$1(obj) {
547
535
  return (typeof obj === 'object' &&
@@ -560,8 +548,8 @@ function toSimpleHebrewDate(obj) {
560
548
  else if (typeof obj === 'number') {
561
549
  return abs2hebrew(obj);
562
550
  }
563
- else if (exports.greg.isDate(obj)) {
564
- const abs = exports.greg.greg2abs(obj);
551
+ else if (isDate(obj)) {
552
+ const abs = greg2abs(obj);
565
553
  return abs2hebrew(abs);
566
554
  }
567
555
  else {
@@ -708,8 +696,6 @@ function num2digits(num) {
708
696
  * gematriya(60) // 'ס׳'
709
697
  * gematriya(3761) // 'ג׳תשס״א'
710
698
  * gematriya(1123) // 'א׳קכ״ג'
711
- * @param {number} num
712
- * @return {string}
713
699
  */
714
700
  function gematriya(num) {
715
701
  const num0 = num;
@@ -744,9 +730,6 @@ function gematriya(num) {
744
730
  * Only considers the value of Hebrew letters `א` through `ת`.
745
731
  * Ignores final Hebrew letters such as `ך` (kaf sofit) or `ם` (mem sofit)
746
732
  * and vowels (nekudot).
747
- *
748
- * @param {string} str
749
- * @return {number}
750
733
  */
751
734
  function gematriyaStrToNum(str) {
752
735
  let num = 0;
@@ -1026,8 +1009,6 @@ function molad(year, month) {
1026
1009
  const _formatters = new Map();
1027
1010
  /**
1028
1011
  * @private
1029
- * @param {string} tzid
1030
- * @return {Intl.DateTimeFormat}
1031
1012
  */
1032
1013
  function getFormatter$1(tzid) {
1033
1014
  const fmt = _formatters.get(tzid);
@@ -1051,9 +1032,6 @@ const dateFormatRegex = /^(\d+).(\d+).(\d+),?\s+(\d+).(\d+).(\d+)/;
1051
1032
  * Returns a string similar to `Date.toISOString()` but in the
1052
1033
  * timezone `tzid`. Contrary to the typical meaning of `Z` at the end
1053
1034
  * of the string, this is not actually a UTC date.
1054
- * @param {string} tzid
1055
- * @param {Date} date
1056
- * @return {string}
1057
1035
  */
1058
1036
  function getPseudoISO(tzid, date) {
1059
1037
  const str = getFormatter$1(tzid).format(date);
@@ -1070,9 +1048,6 @@ function getPseudoISO(tzid, date) {
1070
1048
  }
1071
1049
  /**
1072
1050
  * Returns number of minutes `tzid` is offset from UTC on date `date`.
1073
- * @param {string} tzid
1074
- * @param {Date} date
1075
- * @return {number}
1076
1051
  */
1077
1052
  function getTimezoneOffset(tzid, date) {
1078
1053
  const utcStr = getPseudoISO('UTC', date);
@@ -1085,8 +1060,6 @@ function getTimezoneOffset(tzid, date) {
1085
1060
  * Similar to `string.padStart(4, '0')` but will also format
1086
1061
  * negative numbers similar to how the JavaScript date formats
1087
1062
  * negative year numbers (e.g. `-37` is formatted as `-000037`).
1088
- * @param {number} number
1089
- * @return {string}
1090
1063
  */
1091
1064
  function pad4(number) {
1092
1065
  if (number < 0) {
@@ -1106,8 +1079,6 @@ function pad4(number) {
1106
1079
  /**
1107
1080
  * Formats a number with leading zeros so the resulting string is 2 digits long.
1108
1081
  * Similar to `string.padStart(2, '0')`.
1109
- * @param {number} number
1110
- * @return {string}
1111
1082
  */
1112
1083
  function pad2(number) {
1113
1084
  if (number < 10) {
@@ -1117,9 +1088,6 @@ function pad2(number) {
1117
1088
  }
1118
1089
  /**
1119
1090
  * Returns YYYY-MM-DD in the local timezone
1120
- * @private
1121
- * @param {Date} dt
1122
- * @return {string}
1123
1091
  */
1124
1092
  function isoDateString(dt) {
1125
1093
  return (pad4(dt.getFullYear()) +
@@ -1138,9 +1106,9 @@ const noopLocale = {
1138
1106
  contexts: { '': {} },
1139
1107
  };
1140
1108
  const alias = {
1141
- 'h': 'he',
1142
- 'a': 'ashkenazi',
1143
- 's': 'en',
1109
+ h: 'he',
1110
+ a: 'ashkenazi',
1111
+ s: 'en',
1144
1112
  '': 'en',
1145
1113
  };
1146
1114
  /** @private */
@@ -1161,12 +1129,12 @@ class Locale {
1161
1129
  /**
1162
1130
  * Returns translation only if `locale` offers a non-empty translation for `id`.
1163
1131
  * Otherwise, returns `undefined`.
1164
- * @param {string} id Message ID to translate
1165
- * @param {string} [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale.
1166
- * @return {string}
1132
+ * @param id Message ID to translate
1133
+ * @param [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale.
1167
1134
  */
1168
1135
  static lookupTranslation(id, locale) {
1169
- const loc = (typeof locale === 'string' && locales.get(locale.toLowerCase())) || activeLocale;
1136
+ const loc = (typeof locale === 'string' && locales.get(locale.toLowerCase())) ||
1137
+ activeLocale;
1170
1138
  const array = loc[id];
1171
1139
  if ((array === null || array === void 0 ? void 0 : array.length) && array[0].length) {
1172
1140
  return array[0];
@@ -1175,9 +1143,8 @@ class Locale {
1175
1143
  }
1176
1144
  /**
1177
1145
  * By default, if no translation was found, returns `id`.
1178
- * @param {string} id Message ID to translate
1179
- * @param {string} [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale.
1180
- * @return {string}
1146
+ * @param id Message ID to translate
1147
+ * @param [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale.
1181
1148
  */
1182
1149
  static gettext(id, locale) {
1183
1150
  const text = this.lookupTranslation(id, locale);
@@ -1188,23 +1155,24 @@ class Locale {
1188
1155
  }
1189
1156
  /**
1190
1157
  * Register locale translations.
1191
- * @param {string} locale Locale name (i.e.: `'he'`, `'fr'`)
1192
- * @param {LocaleData} data parsed data from a `.po` file.
1158
+ * @param locale Locale name (i.e.: `'he'`, `'fr'`)
1159
+ * @param data parsed data from a `.po` file.
1193
1160
  */
1194
1161
  static addLocale(locale, data) {
1195
1162
  if (typeof locale !== 'string') {
1196
1163
  throw new TypeError(`Invalid locale name: ${locale}`);
1197
1164
  }
1198
- if (typeof data.contexts !== 'object' || typeof data.contexts[''] !== 'object') {
1165
+ if (typeof data.contexts !== 'object' ||
1166
+ typeof data.contexts[''] !== 'object') {
1199
1167
  throw new TypeError(`Locale '${locale}' invalid compact format`);
1200
1168
  }
1201
1169
  locales.set(locale.toLowerCase(), data.contexts['']);
1202
1170
  }
1203
1171
  /**
1204
1172
  * Adds a translation to `locale`, replacing any previous translation.
1205
- * @param {string} locale Locale name (i.e: `'he'`, `'fr'`).
1206
- * @param {string} id Message ID to translate
1207
- * @param {string | string[]} translation Translation text
1173
+ * @param locale Locale name (i.e: `'he'`, `'fr'`).
1174
+ * @param id Message ID to translate
1175
+ * @param translation Translation text
1208
1176
  */
1209
1177
  static addTranslation(locale, id, translation) {
1210
1178
  if (typeof locale !== 'string') {
@@ -1231,8 +1199,8 @@ class Locale {
1231
1199
  }
1232
1200
  /**
1233
1201
  * Adds multiple translations to `locale`, replacing any previous translations.
1234
- * @param {string} locale Locale name (i.e: `'he'`, `'fr'`).
1235
- * @param {LocaleData} data parsed data from a `.po` file.
1202
+ * @param locale Locale name (i.e: `'he'`, `'fr'`).
1203
+ * @param data parsed data from a `.po` file.
1236
1204
  */
1237
1205
  static addTranslations(locale, data) {
1238
1206
  if (typeof locale !== 'string') {
@@ -1242,7 +1210,8 @@ class Locale {
1242
1210
  if (!loc) {
1243
1211
  throw new TypeError(`Unknown locale: ${locale}`);
1244
1212
  }
1245
- if (typeof data.contexts !== 'object' || typeof data.contexts[''] !== 'object') {
1213
+ if (typeof data.contexts !== 'object' ||
1214
+ typeof data.contexts[''] !== 'object') {
1246
1215
  throw new TypeError(`Locale '${locale}' invalid compact format`);
1247
1216
  }
1248
1217
  const ctx = data.contexts[''];
@@ -1252,7 +1221,7 @@ class Locale {
1252
1221
  * Activates a locale. Throws an error if the locale has not been previously added.
1253
1222
  * After setting the locale to be used, all strings marked for translations
1254
1223
  * will be represented by the corresponding translation in the specified locale.
1255
- * @param {string} locale Locale name (i.e: `'he'`, `'fr'`)
1224
+ * @param locale Locale name (i.e: `'he'`, `'fr'`)
1256
1225
  */
1257
1226
  static useLocale(locale) {
1258
1227
  const locale0 = locale.toLowerCase();
@@ -1266,23 +1235,20 @@ class Locale {
1266
1235
  }
1267
1236
  /**
1268
1237
  * Returns the name of the active locale (i.e. 'he', 'ashkenazi', 'fr')
1269
- * @return {string}
1270
1238
  */
1271
1239
  static getLocaleName() {
1272
1240
  return activeName;
1273
1241
  }
1274
1242
  /**
1275
1243
  * Returns the names of registered locales
1276
- * @return {string[]}
1277
1244
  */
1278
1245
  static getLocaleNames() {
1279
1246
  const keys = Array.from(locales.keys());
1280
1247
  return keys.sort((a, b) => a.localeCompare(b));
1281
1248
  }
1282
1249
  /**
1283
- * @param {number} n
1284
- * @param {string} [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale.
1285
- * @return {string}
1250
+ * Renders a number in ordinal, such as 1st, 2nd or 3rd
1251
+ * @param [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale.
1286
1252
  */
1287
1253
  static ordinal(n, locale) {
1288
1254
  const locale1 = locale === null || locale === void 0 ? void 0 : locale.toLowerCase();
@@ -1309,11 +1275,6 @@ class Locale {
1309
1275
  return n + '.';
1310
1276
  }
1311
1277
  }
1312
- /**
1313
- * @private
1314
- * @param {number} n
1315
- * @return {string}
1316
- */
1317
1278
  static getEnOrdinal(n) {
1318
1279
  const s = ['th', 'st', 'nd', 'rd'];
1319
1280
  const v = n % 100;
@@ -1321,8 +1282,6 @@ class Locale {
1321
1282
  }
1322
1283
  /**
1323
1284
  * Removes nekudot from Hebrew string
1324
- * @param {string} str
1325
- * @return {string}
1326
1285
  */
1327
1286
  static hebrewStripNikkud(str) {
1328
1287
  return str.replace(/[\u0590-\u05bd]/g, '').replace(/[\u05bf-\u05c7]/g, '');
@@ -1370,10 +1329,10 @@ Locale.addLocale('he-x-NoNikud', poHeNoNikud$1);
1370
1329
  You should have received a copy of the GNU General Public License
1371
1330
  along with this program. If not, see <http://www.gnu.org/licenses/>.
1372
1331
  */
1373
- // eslint-disable-next-line require-jsdoc
1374
1332
  function mod(x, y) {
1375
1333
  return x - y * Math.floor(x / y);
1376
1334
  }
1335
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1377
1336
  function isSimpleHebrewDate(obj) {
1378
1337
  return obj.yy !== undefined;
1379
1338
  }
@@ -1381,7 +1340,24 @@ const UNITS_DAY = 'day';
1381
1340
  const UNITS_WEEK = 'week';
1382
1341
  const UNITS_MONTH = 'month';
1383
1342
  const UNITS_YEAR = 'year';
1384
- /** Represents a Hebrew date */
1343
+ /**
1344
+ * A `HDate` represents a Hebrew calendar date.
1345
+ *
1346
+ * An instance of this class encapsulates a date in the Hebrew calendar system.
1347
+ * It consists of a year, month, and day, without any associated time or location data.
1348
+ * The Hebrew calendar is a lunisolar calendar, meaning it is based on both lunar and solar cycles.
1349
+ *
1350
+ * A Hebrew date internally stores three numbers:
1351
+ * - year: The Hebrew year (1-9999). Counted from the traditional Hebrew date of creation (3761 BCE in the Gregorian calendar)
1352
+ * - month: The Hebrew month (1-13). Month 1 is Nisan, month 7 is Tishrei. There are 12 months in a regular year and 13 months in a leap year.
1353
+ * - day: The day of the month (1-30)
1354
+ *
1355
+ * This class uses Rata Die to convert between the Hebrew and Gregorian calendars.
1356
+ *
1357
+ * To calculate times of day, use `Zmanim` class from `@hebcal/core`
1358
+ * @see {@link https://en.wikipedia.org/wiki/Rata_Die | Rata Die}
1359
+ * @see {@link https://hebcal.github.io/api/core/classes/Zmanim.html | Zmanim}
1360
+ */
1385
1361
  class HDate {
1386
1362
  /**
1387
1363
  * Create a Hebrew date. There are 3 basic forms for the `HDate()` constructor.
@@ -1406,12 +1382,12 @@ class HDate {
1406
1382
  * const hd5 = new HDate(733359); // ==> 15 Cheshvan 5769
1407
1383
  * const monthName = 'אייר';
1408
1384
  * const hd6 = new HDate(5, monthName, 5773);
1409
- * @param {number|Date|HDate} [day] - Day of month (1-30) if a `number`.
1385
+ * @param [day] - Day of month (1-30) if a `number`.
1410
1386
  * If a `Date` is specified, represents the Hebrew date corresponding to the
1411
1387
  * Gregorian date using local time.
1412
1388
  * If an `HDate` is specified, clones a copy of the given Hebrew date.
1413
- * @param {number|string} [month] - Hebrew month of year (1=NISAN, 7=TISHREI)
1414
- * @param {number} [year] - Hebrew year
1389
+ * @param [month] - Hebrew month of year (1=NISAN, 7=TISHREI)
1390
+ * @param [year] - Hebrew year
1415
1391
  */
1416
1392
  constructor(day, month, year) {
1417
1393
  if (arguments.length === 2 || arguments.length > 3) {
@@ -1438,9 +1414,13 @@ class HDate {
1438
1414
  day = new Date();
1439
1415
  }
1440
1416
  // 1 argument
1441
- const abs0 = (typeof day === 'number' && !isNaN(day)) ? day :
1442
- exports.greg.isDate(day) ? exports.greg.greg2abs(day) :
1443
- isSimpleHebrewDate(day) ? day : null;
1417
+ const abs0 = typeof day === 'number' && !isNaN(day)
1418
+ ? day
1419
+ : isDate(day)
1420
+ ? greg2abs(day)
1421
+ : isSimpleHebrewDate(day)
1422
+ ? day
1423
+ : null;
1444
1424
  if (abs0 === null) {
1445
1425
  throw new TypeError(`HDate called with bad argument: ${day}`);
1446
1426
  }
@@ -1455,68 +1435,99 @@ class HDate {
1455
1435
  }
1456
1436
  }
1457
1437
  /**
1458
- * Gets the Hebrew year of this Hebrew date
1459
- * @return {number}
1438
+ * Returns the Hebrew year of this Hebrew date
1439
+ * @returns an integer >= 1
1440
+ * @example
1441
+ * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769
1442
+ * hd.getFullYear(); // 5769
1460
1443
  */
1461
1444
  getFullYear() {
1462
1445
  return this.yy;
1463
1446
  }
1464
1447
  /**
1465
- * Tests if this date occurs during a leap year
1466
- * @return {boolean}
1448
+ * Returns `true` if this Hebrew date occurs during a Hebrew leap year
1449
+ * @example
1450
+ * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769
1451
+ * hd.isLeapYear(); // false
1467
1452
  */
1468
1453
  isLeapYear() {
1469
1454
  return isLeapYear(this.yy);
1470
1455
  }
1471
1456
  /**
1472
- * Gets the Hebrew month (1=NISAN, 7=TISHREI) of this Hebrew date
1473
- * @return {number}
1457
+ * Returns the Hebrew month (1=NISAN, 7=TISHREI) of this Hebrew date
1458
+ * @returns an integer 1-13
1459
+ * @example
1460
+ * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769
1461
+ * hd.getMonth(); // 8
1474
1462
  */
1475
1463
  getMonth() {
1476
1464
  return this.mm;
1477
1465
  }
1478
1466
  /**
1479
- * The Tishrei-based month of the date. 1 is Tishrei, 7 is Nisan, 13 is Elul in a leap year
1480
- * @return {number}
1467
+ * The Tishrei-based month of this Hebrew date. 1 is Tishrei, 7 is Nisan, 13 is Elul in a leap year
1468
+ * @returns an integer 1-13
1469
+ * @example
1470
+ * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769
1471
+ * hd.getMonth(); // 2
1481
1472
  */
1482
1473
  getTishreiMonth() {
1483
1474
  const nummonths = monthsInYear(this.getFullYear());
1484
1475
  return (this.getMonth() + nummonths - 6) % nummonths || nummonths;
1485
1476
  }
1486
1477
  /**
1487
- * Number of days in the month of this Hebrew date
1488
- * @return {number}
1478
+ * Number of days in the month of this Hebrew date (29 or 30)
1479
+ * @returns an integer 29-30
1480
+ * @example
1481
+ * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769
1482
+ * hd.daysInMonth(); // 29
1489
1483
  */
1490
1484
  daysInMonth() {
1491
1485
  return daysInMonth(this.getMonth(), this.getFullYear());
1492
1486
  }
1493
1487
  /**
1494
1488
  * Gets the day within the month (1-30)
1495
- * @return {number}
1489
+ * @returns an integer 1-30
1490
+ * @example
1491
+ * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769
1492
+ * hd.getDate(); // 15
1496
1493
  */
1497
1494
  getDate() {
1498
1495
  return this.dd;
1499
1496
  }
1500
1497
  /**
1501
- * Gets the day of the week. 0=Sunday, 6=Saturday
1502
- * @return {number}
1498
+ * Returns the day of the week for this Hebrew date,
1499
+ * where 0 represents Sunday, 1 represents Monday, 6 represents Saturday.
1500
+ *
1501
+ * For the day of the month, see `getDate()`
1502
+ * @returns an integer 0-6
1503
+ * @example
1504
+ * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769
1505
+ * hd.getDate(); // 4
1503
1506
  */
1504
1507
  getDay() {
1505
1508
  return mod(this.abs(), 7);
1506
1509
  }
1507
1510
  /**
1508
- * Converts to Gregorian date
1509
- * @return {Date}
1511
+ * Converts this Hebrew date to the corresponding Gregorian date.
1512
+ * Note that this function returns the daytime portion of the date.
1513
+ * For example, the 15th of Cheshvan 5769 began at sundown on
1514
+ * 12 November 2008 and continues through 13 November 2008. This
1515
+ * function would return only the date 13 November 2008.
1516
+ * @example
1517
+ * const hd = new HDate(15, 'Cheshvan', 5769);
1518
+ * hd.greg(); // 13 November 2008
1510
1519
  */
1511
1520
  greg() {
1512
- return exports.greg.abs2greg(this.abs());
1521
+ return abs2greg(this.abs());
1513
1522
  }
1514
1523
  /**
1515
- * Returns R.D. (Rata Die) fixed days.
1516
- * R.D. 1 == Monday, January 1, 1 (Gregorian)
1524
+ * Converts from Hebrew date representation to R.D. (Rata Die) fixed days.
1525
+ * R.D. 1 is the imaginary date Monday, January 1, 1 (Gregorian).
1517
1526
  * Note also that R.D. = Julian Date − 1,721,424.5
1518
- * https://en.wikipedia.org/wiki/Rata_Die#Dershowitz_and_Reingold
1519
- * @return {number}
1527
+ * @see {@link https://en.wikipedia.org/wiki/Rata_Die | Rata Die}
1528
+ * @example
1529
+ * const hd = new HDate(15, 'Cheshvan', 5769);
1530
+ * hd.abs(); // 733359
1520
1531
  */
1521
1532
  abs() {
1522
1533
  if (typeof this.rd !== 'number') {
@@ -1528,17 +1539,21 @@ class HDate {
1528
1539
  * Converts Hebrew date to R.D. (Rata Die) fixed days.
1529
1540
  * R.D. 1 is the imaginary date Monday, January 1, 1 on the Gregorian
1530
1541
  * Calendar.
1531
- * @param {number} year Hebrew year
1532
- * @param {number} month Hebrew month
1533
- * @param {number} day Hebrew date (1-30)
1534
- * @return {number}
1542
+ * @param year Hebrew year
1543
+ * @param month Hebrew month (1=NISAN, 7=TISHREI)
1544
+ * @param day Hebrew date (1-30)
1545
+ * @example
1546
+ * import {HDate, months} from '@hebcal/hdate';
1547
+ * HDate.hebrew2abs(5769, months.CHESHVAN, 15); // 733359
1535
1548
  */
1536
1549
  static hebrew2abs(year, month, day) {
1537
1550
  return hebrew2abs(year, month, day);
1538
1551
  }
1539
1552
  /**
1540
1553
  * Returns a transliterated Hebrew month name, e.g. `'Elul'` or `'Cheshvan'`.
1541
- * @return {string}
1554
+ * @example
1555
+ * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769
1556
+ * hd.getMonthName(); // 'Cheshvan'
1542
1557
  */
1543
1558
  getMonthName() {
1544
1559
  return getMonthName(this.getMonth(), this.getFullYear());
@@ -1552,9 +1567,11 @@ class HDate {
1552
1567
  * const hd = new HDate(15, months.CHESHVAN, 5769);
1553
1568
  * console.log(hd.render('en')); // '15th of Cheshvan, 5769'
1554
1569
  * console.log(hd.render('he')); // '15 חֶשְׁוָן, 5769'
1555
- * @param {string} [locale] Optional locale name (defaults to active locale).
1556
- * @param {boolean} [showYear=true] Display year (defaults to true).
1557
- * @return {string}
1570
+ * console.log(hd.render('en', false)); // '15th of Cheshvan'
1571
+ * console.log(hd.render('he', false)); // '15 חֶשְׁוָן'
1572
+ * @param [locale] Optional locale name (defaults to active locale).
1573
+ * @param [showYear=true] Display year (defaults to true).
1574
+ * @see {@link Locale}
1558
1575
  */
1559
1576
  render(locale, showYear = true) {
1560
1577
  const locale0 = locale || Locale.getLocaleName();
@@ -1577,9 +1594,8 @@ class HDate {
1577
1594
  * @example
1578
1595
  * import {HDate, months} from '@hebcal/hdate';
1579
1596
  * const hd = new HDate(15, months.CHESHVAN, 5769);
1580
- * console.log(hd.renderGematriya()); // 'ט״ו חֶשְׁוָן תשס״ט'
1581
- * @param {boolean} [suppressNikud]
1582
- * @return {string}
1597
+ * hd.renderGematriya(); // 'ט״ו חֶשְׁוָן תשס״ט'
1598
+ * hd.renderGematriya(true); // 'ט״ו חשון תשס״ט'
1583
1599
  */
1584
1600
  renderGematriya(suppressNikud = false) {
1585
1601
  const d = this.getDate();
@@ -1589,77 +1605,76 @@ class HDate {
1589
1605
  return gematriya(d) + ' ' + m + ' ' + gematriya(y);
1590
1606
  }
1591
1607
  /**
1592
- * Returns an `HDate` representing the a dayNumber before the current date.
1593
- * Sunday=0, Saturday=6
1608
+ * Returns an `HDate` corresponding to the specified day of week
1609
+ * **before** this Hebrew date
1594
1610
  * @example
1595
1611
  * new HDate(new Date('Wednesday February 19, 2014')).before(6).greg() // Sat Feb 15 2014
1596
- * @param {number} dow day of week
1597
- * @return {HDate}
1612
+ * @param dayOfWeek day of week: Sunday=0, Saturday=6
1598
1613
  */
1599
- before(dow) {
1600
- return onOrBefore(dow, this, -1);
1614
+ before(dayOfWeek) {
1615
+ return onOrBefore(dayOfWeek, this, -1);
1601
1616
  }
1602
1617
  /**
1603
- * Returns an `HDate` representing the a dayNumber on or before the current date.
1604
- * Sunday=0, Saturday=6
1618
+ * Returns an `HDate` corresponding to the specified day of week
1619
+ * **on or before** this Hebrew date
1605
1620
  * @example
1606
1621
  * new HDate(new Date('Wednesday February 19, 2014')).onOrBefore(6).greg() // Sat Feb 15 2014
1607
1622
  * new HDate(new Date('Saturday February 22, 2014')).onOrBefore(6).greg() // Sat Feb 22 2014
1608
1623
  * new HDate(new Date('Sunday February 23, 2014')).onOrBefore(6).greg() // Sat Feb 22 2014
1609
- * @param {number} dow day of week
1610
- * @return {HDate}
1624
+ * @param dayOfWeek day of week: Sunday=0, Saturday=6
1611
1625
  */
1612
- onOrBefore(dow) {
1613
- return onOrBefore(dow, this, 0);
1626
+ onOrBefore(dayOfWeek) {
1627
+ return onOrBefore(dayOfWeek, this, 0);
1614
1628
  }
1615
1629
  /**
1616
- * Returns an `HDate` representing the nearest dayNumber to the current date
1617
- * Sunday=0, Saturday=6
1630
+ * Returns an `HDate` corresponding to the specified day of week
1631
+ * **nearest** to this Hebrew date
1618
1632
  * @example
1619
1633
  * new HDate(new Date('Wednesday February 19, 2014')).nearest(6).greg() // Sat Feb 22 2014
1620
1634
  * new HDate(new Date('Tuesday February 18, 2014')).nearest(6).greg() // Sat Feb 15 2014
1621
- * @param {number} dow day of week
1622
- * @return {HDate}
1635
+ * @param dayOfWeek day of week: Sunday=0, Saturday=6
1623
1636
  */
1624
- nearest(dow) {
1625
- return onOrBefore(dow, this, 3);
1637
+ nearest(dayOfWeek) {
1638
+ return onOrBefore(dayOfWeek, this, 3);
1626
1639
  }
1627
1640
  /**
1628
- * Returns an `HDate` representing the a dayNumber on or after the current date.
1629
- * Sunday=0, Saturday=6
1641
+ * Returns an `HDate` corresponding to the specified day of week
1642
+ * **on or after** this Hebrew date
1630
1643
  * @example
1631
1644
  * new HDate(new Date('Wednesday February 19, 2014')).onOrAfter(6).greg() // Sat Feb 22 2014
1632
1645
  * new HDate(new Date('Saturday February 22, 2014')).onOrAfter(6).greg() // Sat Feb 22 2014
1633
1646
  * new HDate(new Date('Sunday February 23, 2014')).onOrAfter(6).greg() // Sat Mar 01 2014
1634
- * @param {number} dow day of week
1635
- * @return {HDate}
1647
+ * @param dayOfWeek day of week: Sunday=0, Saturday=6
1636
1648
  */
1637
- onOrAfter(dow) {
1638
- return onOrBefore(dow, this, 6);
1649
+ onOrAfter(dayOfWeek) {
1650
+ return onOrBefore(dayOfWeek, this, 6);
1639
1651
  }
1640
1652
  /**
1641
- * Returns an `HDate` representing the a dayNumber after the current date.
1642
- * Sunday=0, Saturday=6
1653
+ * Returns an `HDate` corresponding to the specified day of week
1654
+ * **after** this Hebrew date
1643
1655
  * @example
1644
1656
  * new HDate(new Date('Wednesday February 19, 2014')).after(6).greg() // Sat Feb 22 2014
1645
1657
  * new HDate(new Date('Saturday February 22, 2014')).after(6).greg() // Sat Mar 01 2014
1646
1658
  * new HDate(new Date('Sunday February 23, 2014')).after(6).greg() // Sat Mar 01 2014
1647
- * @param {number} dow day of week
1648
- * @return {HDate}
1659
+ * @param dayOfWeek day of week: Sunday=0, Saturday=6
1649
1660
  */
1650
- after(dow) {
1651
- return onOrBefore(dow, this, 7);
1661
+ after(dayOfWeek) {
1662
+ return onOrBefore(dayOfWeek, this, 7);
1652
1663
  }
1653
1664
  /**
1654
1665
  * Returns the next Hebrew date
1655
- * @return {HDate}
1666
+ * @example
1667
+ * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769
1668
+ * hd.next(); // '16 Cheshvan 5769'
1656
1669
  */
1657
1670
  next() {
1658
1671
  return new HDate(this.abs() + 1);
1659
1672
  }
1660
1673
  /**
1661
1674
  * Returns the previous Hebrew date
1662
- * @return {HDate}
1675
+ * @example
1676
+ * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769
1677
+ * hd.prev(); // '14 Cheshvan 5769'
1663
1678
  */
1664
1679
  prev() {
1665
1680
  return new HDate(this.abs() - 1);
@@ -1676,12 +1691,10 @@ class HDate {
1676
1691
  * | `week` | `w` | weeks |
1677
1692
  * | `month` | `M` | months |
1678
1693
  * | `year` | `y` | years |
1679
- * @param {number} amount
1680
- * @param {string} [units]
1681
- * @return {HDate}
1682
1694
  */
1683
1695
  add(amount, units = 'd') {
1684
- amount = typeof amount === 'string' ? parseInt(amount, 10) : amount;
1696
+ amount =
1697
+ typeof amount === 'string' ? parseInt(amount, 10) : amount;
1685
1698
  if (!amount) {
1686
1699
  return new HDate(this);
1687
1700
  }
@@ -1690,7 +1703,7 @@ class HDate {
1690
1703
  return new HDate(this.abs() + amount);
1691
1704
  }
1692
1705
  else if (units === UNITS_WEEK) {
1693
- return new HDate(this.abs() + (7 * amount));
1706
+ return new HDate(this.abs() + 7 * amount);
1694
1707
  }
1695
1708
  else if (units === UNITS_YEAR) {
1696
1709
  return new HDate(this.getDate(), this.getMonth(), this.getFullYear() + amount);
@@ -1700,7 +1713,7 @@ class HDate {
1700
1713
  const sign = amount > 0 ? 1 : -1;
1701
1714
  amount = Math.abs(amount);
1702
1715
  for (let i = 0; i < amount; i++) {
1703
- hd = new HDate(hd.abs() + (sign * hd.daysInMonth()));
1716
+ hd = new HDate(hd.abs() + sign * hd.daysInMonth());
1704
1717
  }
1705
1718
  return hd;
1706
1719
  }
@@ -1726,9 +1739,6 @@ class HDate {
1726
1739
  * const hd1 = new HDate(15, months.CHESHVAN, 5769);
1727
1740
  * const hd2 = hd1.add(1, 'weeks'); // 7 Kislev 5769
1728
1741
  * const hd3 = hd1.add(-3, 'M'); // 30 Av 5768
1729
- * @param {number} amount
1730
- * @param {string} [units]
1731
- * @return {HDate}
1732
1742
  */
1733
1743
  subtract(amount, units = 'd') {
1734
1744
  return this.add(amount * -1, units);
@@ -1747,8 +1757,7 @@ class HDate {
1747
1757
  * const hd1 = new HDate(25, months.KISLEV, 5770);
1748
1758
  * const hd2 = new HDate(15, months.CHESHVAN, 5769);
1749
1759
  * const days = hd1.deltaDays(hd2); // 394
1750
- * @param {HDate} other Hebrew date to compare
1751
- * @return {number}
1760
+ * @param other Hebrew date to compare
1752
1761
  */
1753
1762
  deltaDays(other) {
1754
1763
  if (!HDate.isHDate(other)) {
@@ -1757,19 +1766,25 @@ class HDate {
1757
1766
  return this.abs() - other.abs();
1758
1767
  }
1759
1768
  /**
1760
- * Compares this date to another date, returning `true` if the dates match.
1761
- * @param {HDate} other Hebrew date to compare
1762
- * @return {boolean}
1769
+ * Compares this Hebrew date to another date, returning `true` if the dates match.
1770
+ * @param other Hebrew date to compare
1771
+ * @example
1772
+ * const hd1 = new HDate(new Date(2008, 10, 13));
1773
+ * const hd2 = new HDate(15, 'Cheshvan', 5769);
1774
+ * hd1.isSameDate(hd2); // true
1763
1775
  */
1764
1776
  isSameDate(other) {
1765
1777
  if (HDate.isHDate(other)) {
1766
- return this.yy === other.yy &&
1767
- this.mm === other.mm &&
1768
- this.dd === other.dd;
1778
+ return (this.yy === other.yy && this.mm === other.mm && this.dd === other.dd);
1769
1779
  }
1770
1780
  return false;
1771
1781
  }
1772
- /** @return {string} */
1782
+ /**
1783
+ * Returns a string representation of this Hebrew date using English transliterations
1784
+ * @example
1785
+ * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769
1786
+ * hd.toString(); // '15 Cheshvan 5769'
1787
+ */
1773
1788
  toString() {
1774
1789
  const day = this.getDate();
1775
1790
  const fullYear = this.getFullYear();
@@ -1778,25 +1793,31 @@ class HDate {
1778
1793
  }
1779
1794
  /**
1780
1795
  * Returns true if Hebrew year is a leap year
1781
- * @param {number} year Hebrew year
1782
- * @return {boolean}
1796
+ * @param year Hebrew year
1797
+ * @example
1798
+ * HDate.isLeapYear(5783); // false
1799
+ * HDate.isLeapYear(5784); // true
1783
1800
  */
1784
1801
  static isLeapYear(year) {
1785
1802
  return isLeapYear(year);
1786
1803
  }
1787
1804
  /**
1788
1805
  * Number of months in this Hebrew year (either 12 or 13 depending on leap year)
1789
- * @param {number} year Hebrew year
1790
- * @return {number}
1806
+ * @param year Hebrew year
1807
+ * @example
1808
+ * HDate.monthsInYear(5783); // 12
1809
+ * HDate.monthsInYear(5784); // 13
1791
1810
  */
1792
1811
  static monthsInYear(year) {
1793
1812
  return monthsInYear(year);
1794
1813
  }
1795
1814
  /**
1796
1815
  * Number of days in Hebrew month in a given year (29 or 30)
1797
- * @param {number} month Hebrew month (e.g. months.TISHREI)
1798
- * @param {number} year Hebrew year
1799
- * @return {number}
1816
+ * @param month Hebrew month (e.g. months.TISHREI)
1817
+ * @param year Hebrew year
1818
+ * @example
1819
+ * import {HDate, months} from '@hebcal/hdate';
1820
+ * HDate.daysInMonth(months.CHESHVAN, 5769); // 29
1800
1821
  */
1801
1822
  static daysInMonth(month, year) {
1802
1823
  return daysInMonth(month, year);
@@ -1804,17 +1825,23 @@ class HDate {
1804
1825
  /**
1805
1826
  * Returns a transliterated string name of Hebrew month in year,
1806
1827
  * for example 'Elul' or 'Cheshvan'.
1807
- * @param {number} month Hebrew month (e.g. months.TISHREI)
1808
- * @param {number} year Hebrew year
1809
- * @return {string}
1828
+ * @param month Hebrew month (e.g. months.TISHREI)
1829
+ * @param year Hebrew year
1830
+ * @example
1831
+ * import {HDate, months} from '@hebcal/hdate';
1832
+ * HDate.getMonthName(months.CHESHVAN, 5769); // 'Cheshvan'
1810
1833
  */
1811
1834
  static getMonthName(month, year) {
1812
1835
  return getMonthName(month, year);
1813
1836
  }
1814
1837
  /**
1815
1838
  * Returns the Hebrew month number (NISAN=1, TISHREI=7)
1816
- * @param {number|string} month A number, or Hebrew month name string
1817
- * @return {number}
1839
+ * @param month A number, or Hebrew month name string
1840
+ * @example
1841
+ * import {HDate, months} from '@hebcal/hdate';
1842
+ * HDate.monthNum(months.CHESHVAN); // 8
1843
+ * HDate.monthNum('Cheshvan'); // 8
1844
+ * HDate.monthNum('חשון'); // 8
1818
1845
  */
1819
1846
  static monthNum(month) {
1820
1847
  if (typeof month === 'number') {
@@ -1823,38 +1850,49 @@ class HDate {
1823
1850
  }
1824
1851
  return month;
1825
1852
  }
1826
- return month.charCodeAt(0) >= 48 && month.charCodeAt(0) <= 57 ? /* number */
1827
- parseInt(month, 10) :
1828
- HDate.monthFromName(month);
1853
+ return month.charCodeAt(0) >= 48 && month.charCodeAt(0) <= 57 /* number */
1854
+ ? parseInt(month, 10)
1855
+ : HDate.monthFromName(month);
1829
1856
  }
1830
1857
  /**
1831
- * Number of days in the hebrew YEAR
1832
- * @param {number} year Hebrew year
1833
- * @return {number}
1858
+ * Number of days in the Hebrew year.
1859
+ * Regular years can have 353, 354, or 355 days.
1860
+ * Leap years can have 383, 384, or 385 days.
1861
+ * @param year Hebrew year
1862
+ * @example
1863
+ * HDate.daysInYear(5783); // 355
1864
+ * HDate.daysInYear(5784); // 383
1834
1865
  */
1835
1866
  static daysInYear(year) {
1836
1867
  return daysInYear(year);
1837
1868
  }
1838
1869
  /**
1839
1870
  * true if Cheshvan is long in Hebrew year
1840
- * @param {number} year Hebrew year
1841
- * @return {boolean}
1871
+ * @param year Hebrew year
1872
+ * @example
1873
+ * HDate.longCheshvan(5783); // true
1874
+ * HDate.longCheshvan(5784); // false
1842
1875
  */
1843
1876
  static longCheshvan(year) {
1844
1877
  return longCheshvan(year);
1845
1878
  }
1846
1879
  /**
1847
1880
  * true if Kislev is short in Hebrew year
1848
- * @param {number} year Hebrew year
1849
- * @return {boolean}
1881
+ * @param year Hebrew year
1882
+ * @example
1883
+ * HDate.shortKislev(5783); // false
1884
+ * HDate.shortKislev(5784); // true
1850
1885
  */
1851
1886
  static shortKislev(year) {
1852
1887
  return shortKislev(year);
1853
1888
  }
1854
1889
  /**
1855
1890
  * Converts Hebrew month string name to numeric
1856
- * @param {string|number} monthName monthName
1857
- * @return {number}
1891
+ * @example
1892
+ * import {HDate, months} from '@hebcal/hdate';
1893
+ * HDate.monthFromName(months.CHESHVAN); // 8
1894
+ * HDate.monthFromName('Cheshvan'); // 8
1895
+ * HDate.monthFromName('חשון'); // 8
1858
1896
  */
1859
1897
  static monthFromName(monthName) {
1860
1898
  if (typeof monthName === 'number') {
@@ -1867,42 +1905,45 @@ class HDate {
1867
1905
  return monthFromName(name);
1868
1906
  }
1869
1907
  /**
1870
- * Note: Applying this function to d+6 gives us the DAYNAME on or after an
1871
- * absolute day d. Similarly, applying it to d+3 gives the DAYNAME nearest to
1872
- * absolute date d, applying it to d-1 gives the DAYNAME previous to absolute
1873
- * date d, and applying it to d+7 gives the DAYNAME following absolute date d.
1874
- * @param {number} dayOfWeek
1875
- * @param {number} absdate
1876
- * @return {number}
1908
+ * Convenience function for determining the R.D. date
1909
+ * near a specified R.D. date, corresponding to the specified day of week.
1910
+ *
1911
+ * Note: Applying this function to d+6 gives us the `dayOfWeek` on or after an
1912
+ * absolute day d. Similarly, applying it to d+3 gives the `dayOfWeek` nearest to
1913
+ * absolute date d, applying it to d-1 gives the `dayOfWeek` previous to absolute
1914
+ * date d, and applying it to d+7 gives the `dayOfWeek` following absolute date d.
1915
+ * @param dayOfWeek day of week: Sunday=0, Saturday=6
1877
1916
  */
1878
1917
  static dayOnOrBefore(dayOfWeek, absdate) {
1879
1918
  return absdate - ((absdate - dayOfWeek) % 7);
1880
1919
  }
1881
1920
  /**
1882
1921
  * Tests if the object is an instance of `HDate`
1883
- * @param {any} obj
1884
- * @return {boolean}
1922
+ * @example
1923
+ * HDate.isHDate(new HDate()); // true
1924
+ * HDate.isHDate(new Date()); // false
1925
+ * HDate.isHDate(null); // false
1926
+ * HDate.isHDate(12345); // false
1927
+ * HDate.isHDate('15 Cheshvan 5769'); // false
1885
1928
  */
1886
1929
  static isHDate(obj) {
1887
- return obj !== null && typeof obj === 'object' &&
1930
+ return (obj !== null &&
1931
+ typeof obj === 'object' &&
1888
1932
  typeof obj.yy === 'number' &&
1889
1933
  typeof obj.mm === 'number' &&
1890
1934
  typeof obj.dd === 'number' &&
1891
1935
  typeof obj.greg === 'function' &&
1892
- typeof obj.abs === 'function';
1936
+ typeof obj.abs === 'function');
1893
1937
  }
1894
1938
  /**
1895
1939
  * Construct a new instance of `HDate` from a Gematriya-formatted string
1896
1940
  * @example
1897
- * HDate.fromGematriyaString('כ״ז בְּתַמּוּז תשפ״ג') // 27 Tamuz 5783
1898
- * HDate.fromGematriyaString('כ׳ סיון תש״ד') // 20 Sivan 5704
1899
- * HDate.fromGematriyaString('ה׳ אִיָיר תש״ח') // 5 Iyyar 5708
1900
- * @param {string} str
1901
- * @param {number} currentThousands
1902
- * @return {HDate}
1941
+ * HDate.fromGematriyaString('כ״ז בְּתַמּוּז תשפ״ג') // 27 Tamuz 5783
1942
+ * HDate.fromGematriyaString('כ׳ סיון תש״ד') // 20 Sivan 5704
1943
+ * HDate.fromGematriyaString('ה׳ אִיָיר תש״ח') // 5 Iyyar 5708
1903
1944
  */
1904
1945
  static fromGematriyaString(str, currentThousands = 5000) {
1905
- const parts = str.split(' ').filter((x) => x.length !== 0);
1946
+ const parts = str.split(' ').filter(x => x.length !== 0);
1906
1947
  const numParts = parts.length;
1907
1948
  if (numParts !== 3 && numParts !== 4) {
1908
1949
  throw new RangeError(`Unable to parse gematriya string: "${str}"`);
@@ -1920,12 +1961,18 @@ class HDate {
1920
1961
  }
1921
1962
  function standardizeUnits(units) {
1922
1963
  switch (units) {
1923
- case 'd': return UNITS_DAY;
1924
- case 'w': return UNITS_WEEK;
1925
- case 'M': return UNITS_MONTH;
1926
- case 'y': return UNITS_YEAR;
1927
- }
1928
- const str = String(units || '').toLowerCase().replace(/s$/, '');
1964
+ case 'd':
1965
+ return UNITS_DAY;
1966
+ case 'w':
1967
+ return UNITS_WEEK;
1968
+ case 'M':
1969
+ return UNITS_MONTH;
1970
+ case 'y':
1971
+ return UNITS_YEAR;
1972
+ }
1973
+ const str = String(units || '')
1974
+ .toLowerCase()
1975
+ .replace(/s$/, '');
1929
1976
  switch (str) {
1930
1977
  case UNITS_DAY:
1931
1978
  case UNITS_WEEK:
@@ -1955,8 +2002,7 @@ function getDayOfTranslation(locale) {
1955
2002
  /**
1956
2003
  * Sets the day of the month of the date. Returns the object it was called upon
1957
2004
  * @private
1958
- * @param {number|string} month A number, or Hebrew month name string
1959
- * @return {HDate}
2005
+ * @param month A number, or Hebrew month name string
1960
2006
  */
1961
2007
  function setMonth(hd, month) {
1962
2008
  hd.mm = HDate.monthNum(month);
@@ -2038,7 +2084,8 @@ const poHeNoNikud = {
2038
2084
  Locale.addTranslations('he-x-NoNikud', poHeNoNikud);
2039
2085
 
2040
2086
  /**
2041
- * Holiday flags for Event
2087
+ * Holiday flags for Event. These flags are typically
2088
+ * combined using bitwise arithmetic to form a mask.
2042
2089
  * @readonly
2043
2090
  * @enum {number}
2044
2091
  */
@@ -2113,14 +2160,22 @@ const flagToCategory = [
2113
2160
  [flags.SPECIAL_SHABBAT, 'holiday', 'shabbat'],
2114
2161
  [flags.USER_EVENT, 'user'],
2115
2162
  ];
2116
- /** Represents an Event with a title, date, and flags */
2163
+ /**
2164
+ * Represents an Event with a title, date, and flags.
2165
+ *
2166
+ * Events are used to represent holidays, candle-lighting times,
2167
+ * Torah readings, and more.
2168
+ *
2169
+ * To get the title of the event a language other than English
2170
+ * with Sephardic transliterations, use the `render()` method.
2171
+ */
2117
2172
  class Event {
2118
2173
  /**
2119
2174
  * Constructs Event
2120
- * @param {HDate} date Hebrew date event occurs
2121
- * @param {string} desc Description (not translated)
2122
- * @param {number} [mask=0] optional bitmask of holiday flags (see {@link flags})
2123
- * @param {Object} [attrs={}] optional additional attributes (e.g. `eventTimeStr`, `cholHaMoedDay`)
2175
+ * @param date Hebrew date event occurs
2176
+ * @param desc Description (not translated)
2177
+ * @param [mask=0] optional bitmask of holiday flags (see {@link flags})
2178
+ * @param [attrs={}] optional additional attributes (e.g. `eventTimeStr`, `cholHaMoedDay`)
2124
2179
  */
2125
2180
  constructor(date, desc, mask = 0, attrs) {
2126
2181
  if (!HDate.isHDate(date)) {
@@ -2138,21 +2193,21 @@ class Event {
2138
2193
  }
2139
2194
  /**
2140
2195
  * Hebrew date of this event
2141
- * @return {HDate}
2142
2196
  */
2143
2197
  getDate() {
2144
2198
  return this.date;
2145
2199
  }
2146
2200
  /**
2147
- * Untranslated description of this event
2148
- * @return {string}
2201
+ * Untranslated title of this event. Note that these description
2202
+ * strings are always in English and will remain stable across releases.
2203
+ * To get the title of the event in another language, use the
2204
+ * `render()` method.
2149
2205
  */
2150
2206
  getDesc() {
2151
2207
  return this.desc;
2152
2208
  }
2153
2209
  /**
2154
2210
  * Bitmask of optional event flags. See {@link flags}
2155
- * @return {number}
2156
2211
  */
2157
2212
  getFlags() {
2158
2213
  return this.mask;
@@ -2164,8 +2219,7 @@ class Event {
2164
2219
  * ev.render('en'); // 'Shavuot'
2165
2220
  * ev.render('he'); // 'שָׁבוּעוֹת'
2166
2221
  * ev.render('ashkenazi'); // 'Shavuos'
2167
- * @param {string} [locale] Optional locale name (defaults to active locale).
2168
- * @return {string}
2222
+ * @param [locale] Optional locale name (defaults to active locale).
2169
2223
  */
2170
2224
  render(locale) {
2171
2225
  return Locale.gettext(this.desc, locale);
@@ -2174,25 +2228,22 @@ class Event {
2174
2228
  * Returns a brief (translated) description of this event.
2175
2229
  * For most events, this is the same as render(). For some events, it procudes
2176
2230
  * a shorter text (e.g. without a time or added description).
2177
- * @param {string} [locale] Optional locale name (defaults to active locale).
2178
- * @return {string}
2231
+ * @param [locale] Optional locale name (defaults to active locale).
2179
2232
  */
2180
2233
  renderBrief(locale) {
2181
2234
  return this.render(locale);
2182
2235
  }
2183
2236
  /**
2184
2237
  * Optional holiday-specific Emoji or `null`.
2185
- * @return {string | null}
2186
2238
  */
2187
2239
  getEmoji() {
2188
2240
  return this.emoji || null;
2189
2241
  }
2190
2242
  /**
2191
2243
  * Returns a simplified (untranslated) description for this event. For example,
2192
- * the {@link HolidayEvent} class supports
2244
+ * the `HolidayEvent` class supports
2193
2245
  * "Erev Pesach" => "Pesach", and "Sukkot III (CH''M)" => "Sukkot".
2194
2246
  * For many holidays the basename and the event description are the same.
2195
- * @return {string}
2196
2247
  */
2197
2248
  basename() {
2198
2249
  return this.getDesc();
@@ -2200,7 +2251,6 @@ class Event {
2200
2251
  /**
2201
2252
  * Returns a URL to hebcal.com or sefaria.org for more detail on the event.
2202
2253
  * Returns `undefined` for events with no detail page.
2203
- * @return {string | undefined}
2204
2254
  */
2205
2255
  url() {
2206
2256
  return undefined;
@@ -2212,7 +2262,6 @@ class Event {
2212
2262
  * ev1.observedInIsrael(); // false
2213
2263
  * const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);
2214
2264
  * ev2.observedInIsrael(); // true
2215
- * @return {boolean}
2216
2265
  */
2217
2266
  observedInIsrael() {
2218
2267
  return !(this.mask & flags.CHUL_ONLY);
@@ -2224,7 +2273,6 @@ class Event {
2224
2273
  * ev1.observedInDiaspora(); // true
2225
2274
  * const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);
2226
2275
  * ev2.observedInDiaspora(); // true
2227
- * @return {boolean}
2228
2276
  */
2229
2277
  observedInDiaspora() {
2230
2278
  return !(this.mask & flags.IL_ONLY);
@@ -2238,19 +2286,18 @@ class Event {
2238
2286
  * const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);
2239
2287
  * ev2.observedIn(false); // true
2240
2288
  * ev2.observedIn(true); // true
2241
- * @param {boolean} il
2242
- * @return {boolean}
2289
+ * @param il
2243
2290
  */
2244
2291
  observedIn(il) {
2245
2292
  return il ? this.observedInIsrael() : this.observedInDiaspora();
2246
2293
  }
2247
2294
  /**
2248
2295
  * Makes a clone of this Event object
2249
- * @return {Event}
2250
2296
  */
2251
2297
  clone() {
2252
2298
  const ev = new Event(this.date, this.desc, this.mask);
2253
2299
  for (const property in this) {
2300
+ // eslint-disable-next-line no-prototype-builtins
2254
2301
  if (this.hasOwnProperty(property)) {
2255
2302
  Object.defineProperty(ev, property, { value: this[property] });
2256
2303
  }
@@ -2259,7 +2306,6 @@ class Event {
2259
2306
  }
2260
2307
  /**
2261
2308
  * Returns a list of event categories
2262
- * @return {string[]}
2263
2309
  */
2264
2310
  getCategories() {
2265
2311
  const mask = this.getFlags();
@@ -2276,13 +2322,13 @@ class Event {
2276
2322
  /** Daily Hebrew date ("11th of Sivan, 5780") */
2277
2323
  class HebrewDateEvent extends Event {
2278
2324
  /**
2279
- * @param {HDate} date
2325
+ * @param date
2280
2326
  */
2281
2327
  constructor(date) {
2282
2328
  super(date, date.toString(), flags.HEBREW_DATE);
2283
2329
  }
2284
2330
  /**
2285
- * @param {string} [locale] Optional locale name (defaults to active locale).
2331
+ * @param [locale] Optional locale name (defaults to active locale).
2286
2332
  * @example
2287
2333
  * import {HDate, HebrewDateEvent, months} from '@hebcal/core';
2288
2334
  *
@@ -2290,7 +2336,6 @@ class HebrewDateEvent extends Event {
2290
2336
  * const ev = new HebrewDateEvent(hd);
2291
2337
  * console.log(ev.render('en')); // '15th of Cheshvan, 5769'
2292
2338
  * console.log(ev.render('he')); // 'ט״ו חֶשְׁוָן תשס״ט'
2293
- * @return {string}
2294
2339
  */
2295
2340
  render(locale) {
2296
2341
  const locale1 = locale === null || locale === void 0 ? void 0 : locale.toLowerCase();
@@ -2308,8 +2353,7 @@ class HebrewDateEvent extends Event {
2308
2353
  }
2309
2354
  /**
2310
2355
  * @private
2311
- * @param {string} locale
2312
- * @return {string}
2356
+ * @param locale
2313
2357
  */
2314
2358
  renderBriefHebrew(locale) {
2315
2359
  const hd = this.getDate();
@@ -2318,7 +2362,7 @@ class HebrewDateEvent extends Event {
2318
2362
  return gematriya(dd) + ' ' + mm;
2319
2363
  }
2320
2364
  /**
2321
- * @param {string} [locale] Optional locale name (defaults to active locale).
2365
+ * @param [locale] Optional locale name (defaults to active locale).
2322
2366
  * @example
2323
2367
  * import {HDate, HebrewDateEvent, months} from '@hebcal/core';
2324
2368
  *
@@ -2326,7 +2370,6 @@ class HebrewDateEvent extends Event {
2326
2370
  * const ev = new HebrewDateEvent(hd);
2327
2371
  * console.log(ev.renderBrief()); // '15th of Cheshvan'
2328
2372
  * console.log(ev.renderBrief('he')); // 'ט״ו חֶשְׁוָן'
2329
- * @return {string}
2330
2373
  */
2331
2374
  renderBrief(locale) {
2332
2375
  const locale1 = locale === null || locale === void 0 ? void 0 : locale.toLowerCase();
@@ -7504,7 +7547,14 @@ const classicCities0 = [
7504
7547
  ['Bogota', 'CO', 4.60971, -74.08175, 'America/Bogota', 2582],
7505
7548
  ['Boston', 'US', 42.35843, -71.05977, 'America/New_York', 38],
7506
7549
  ['Budapest', 'HU', 47.49801, 19.03991, 'Europe/Budapest', 104],
7507
- ['Buenos Aires', 'AR', -34.61315, -58.37723, 'America/Argentina/Buenos_Aires', 31],
7550
+ [
7551
+ 'Buenos Aires',
7552
+ 'AR',
7553
+ -34.61315,
7554
+ -58.37723,
7555
+ 'America/Argentina/Buenos_Aires',
7556
+ 31,
7557
+ ],
7508
7558
  ['Buffalo', 'US', 42.88645, -78.87837, 'America/New_York', 191],
7509
7559
  ['Chicago', 'US', 41.85003, -87.65005, 'America/Chicago', 180],
7510
7560
  ['Cincinnati', 'US', 39.162, -84.45689, 'America/New_York', 267],
@@ -7601,14 +7651,14 @@ function getFormatter(tzid) {
7601
7651
  class Location extends GeoLocation {
7602
7652
  /**
7603
7653
  * Initialize a Location instance
7604
- * @param {number} latitude - Latitude as a decimal, valid range -90 thru +90 (e.g. 41.85003)
7605
- * @param {number} longitude - Longitude as a decimal, valid range -180 thru +180 (e.g. -87.65005)
7606
- * @param {boolean} il - in Israel (true) or Diaspora (false)
7607
- * @param {string} tzid - Olson timezone ID, e.g. "America/Chicago"
7608
- * @param {string} [cityName] - optional descriptive city name
7609
- * @param {string} [countryCode] - ISO 3166 alpha-2 country code (e.g. "FR")
7610
- * @param {string|number} [geoid] - optional string or numeric geographic ID
7611
- * @param {number} [elevation] - in meters (default `0`)
7654
+ * @param latitude - Latitude as a decimal, valid range -90 thru +90 (e.g. 41.85003)
7655
+ * @param longitude - Longitude as a decimal, valid range -180 thru +180 (e.g. -87.65005)
7656
+ * @param il - in Israel (true) or Diaspora (false)
7657
+ * @param tzid - Olson timezone ID, e.g. "America/Chicago"
7658
+ * @param [cityName] - optional descriptive city name
7659
+ * @param [countryCode] - ISO 3166 alpha-2 country code (e.g. "FR")
7660
+ * @param [geoid] - optional string or numeric geographic ID
7661
+ * @param [elevation] - in meters (default `0`)
7612
7662
  */
7613
7663
  constructor(latitude, longitude, il, tzid, cityName, countryCode, geoid, elevation) {
7614
7664
  const lat = typeof latitude === 'number' ? latitude : parseFloat(latitude);
@@ -7619,23 +7669,20 @@ class Location extends GeoLocation {
7619
7669
  if (isNaN(long) || long < -180 || long > 180) {
7620
7670
  throw new RangeError(`Longitude ${longitude} out of range [-180,180]`);
7621
7671
  }
7622
- const elev = (typeof elevation === 'number' && elevation > 0) ? elevation : 0;
7672
+ const elev = typeof elevation === 'number' && elevation > 0 ? elevation : 0;
7623
7673
  super(cityName || null, lat, long, elev, tzid);
7624
7674
  this.il = Boolean(il);
7625
7675
  this.cc = countryCode;
7626
7676
  this.geoid = geoid;
7627
7677
  }
7628
- /** @return {boolean} */
7629
7678
  getIsrael() {
7630
7679
  return this.il;
7631
7680
  }
7632
- /** @return {string | null} */
7633
7681
  getName() {
7634
7682
  return this.getLocationName();
7635
7683
  }
7636
7684
  /**
7637
7685
  * Returns the location name, up to the first comma
7638
- * @return {string | null}
7639
7686
  */
7640
7687
  getShortName() {
7641
7688
  const name = this.getLocationName();
@@ -7654,22 +7701,18 @@ class Location extends GeoLocation {
7654
7701
  }
7655
7702
  return name.substring(0, comma);
7656
7703
  }
7657
- /** @return {string | undefined} */
7658
7704
  getCountryCode() {
7659
7705
  return this.cc;
7660
7706
  }
7661
- /** @return {string} */
7662
7707
  getTzid() {
7663
7708
  return this.getTimeZone();
7664
7709
  }
7665
7710
  /**
7666
7711
  * Gets a 24-hour time formatter (e.g. 07:41 or 20:03) for this location
7667
- * @return {Intl.DateTimeFormat}
7668
7712
  */
7669
7713
  getTimeFormatter() {
7670
7714
  return getFormatter(this.getTimeZone());
7671
7715
  }
7672
- /** @return {string | number | undefined} */
7673
7716
  getGeoId() {
7674
7717
  return this.geoid;
7675
7718
  }
@@ -7689,26 +7732,23 @@ class Location extends GeoLocation {
7689
7732
  * 'San Diego', 'San Francisco', 'Sao Paulo', 'Seattle', 'Sydney',
7690
7733
  * 'Tel Aviv', 'Tiberias', 'Toronto', 'Vancouver', 'White Plains',
7691
7734
  * 'Washington DC', 'Worcester'
7692
- * @param {string} name
7693
- * @return {Location|undefined}
7735
+ * @param name
7694
7736
  */
7695
7737
  static lookup(name) {
7696
7738
  return classicCities.get(name.toLowerCase());
7697
7739
  }
7698
- /** @return {string} */
7699
7740
  toString() {
7700
7741
  return JSON.stringify(this);
7701
7742
  }
7702
7743
  /**
7703
7744
  * Converts legacy Hebcal timezone to a standard Olson tzid.
7704
- * @param {number} tz integer, GMT offset in hours
7705
- * @param {string} dst 'none', 'eu', 'usa', or 'israel'
7706
- * @return {string | undefined}
7745
+ * @param tz integer, GMT offset in hours
7746
+ * @param dst 'none', 'eu', 'usa', or 'israel'
7707
7747
  */
7708
7748
  static legacyTzToTzid(tz, dst) {
7709
7749
  tz = +tz;
7710
- if (dst == 'none') {
7711
- if (tz == 0) {
7750
+ if (dst === 'none') {
7751
+ if (tz === 0) {
7712
7752
  return 'UTC';
7713
7753
  }
7714
7754
  else {
@@ -7716,19 +7756,24 @@ class Location extends GeoLocation {
7716
7756
  return `Etc/GMT${plus}${tz}`;
7717
7757
  }
7718
7758
  }
7719
- else if (tz == 2 && dst == 'israel') {
7759
+ else if (tz === 2 && dst === 'israel') {
7720
7760
  return 'Asia/Jerusalem';
7721
7761
  }
7722
- else if (dst == 'eu') {
7762
+ else if (dst === 'eu') {
7723
7763
  switch (tz) {
7724
- case -2: return 'Atlantic/Cape_Verde';
7725
- case -1: return 'Atlantic/Azores';
7726
- case 0: return 'Europe/London';
7727
- case 1: return 'Europe/Paris';
7728
- case 2: return 'Europe/Athens';
7764
+ case -2:
7765
+ return 'Atlantic/Cape_Verde';
7766
+ case -1:
7767
+ return 'Atlantic/Azores';
7768
+ case 0:
7769
+ return 'Europe/London';
7770
+ case 1:
7771
+ return 'Europe/Paris';
7772
+ case 2:
7773
+ return 'Europe/Athens';
7729
7774
  }
7730
7775
  }
7731
- else if (dst == 'usa') {
7776
+ else if (dst === 'usa') {
7732
7777
  return ZIPCODES_TZ_MAP[String(tz * -1)];
7733
7778
  }
7734
7779
  return undefined;
@@ -7737,17 +7782,16 @@ class Location extends GeoLocation {
7737
7782
  * Converts timezone info from Zip-Codes.com to a standard Olson tzid.
7738
7783
  * @example
7739
7784
  * Location.getUsaTzid('AZ', 7, 'Y') // 'America/Denver'
7740
- * @param {string} state two-letter all-caps US state abbreviation like 'CA'
7741
- * @param {number} tz positive number, 5=America/New_York, 8=America/Los_Angeles
7742
- * @param {string} dst single char 'Y' or 'N'
7743
- * @return {string}
7785
+ * @param state two-letter all-caps US state abbreviation like 'CA'
7786
+ * @param tz positive number, 5=America/New_York, 8=America/Los_Angeles
7787
+ * @param dst single char 'Y' or 'N'
7744
7788
  */
7745
7789
  static getUsaTzid(state, tz, dst) {
7746
- if (tz == 10 && state == 'AK') {
7790
+ if (tz === 10 && state === 'AK') {
7747
7791
  return 'America/Adak';
7748
7792
  }
7749
- else if (tz == 7 && state == 'AZ') {
7750
- return dst == 'Y' ? 'America/Denver' : 'America/Phoenix';
7793
+ else if (tz === 7 && state === 'AZ') {
7794
+ return dst === 'Y' ? 'America/Denver' : 'America/Phoenix';
7751
7795
  }
7752
7796
  else {
7753
7797
  return ZIPCODES_TZ_MAP[tz];
@@ -7757,9 +7801,6 @@ class Location extends GeoLocation {
7757
7801
  * Adds a location name for `Location.lookup()` only if the name isn't
7758
7802
  * already being used. Returns `false` if the name is already taken
7759
7803
  * and `true` if successfully added.
7760
- * @param {string} cityName
7761
- * @param {Location} location
7762
- * @return {boolean}
7763
7804
  */
7764
7805
  static addLocation(cityName, location) {
7765
7806
  const name = cityName.toLowerCase();
@@ -7771,7 +7812,7 @@ class Location extends GeoLocation {
7771
7812
  }
7772
7813
  }
7773
7814
  for (const city of classicCities0) {
7774
- const location = new Location(city[2], city[3], city[1] == 'IL', city[4], city[0], city[1], undefined, city[5]);
7815
+ const location = new Location(city[2], city[3], city[1] === 'IL', city[4], city[0], city[1], undefined, city[5]);
7775
7816
  Location.addLocation(city[0], location);
7776
7817
  }
7777
7818
 
@@ -7795,7 +7836,7 @@ function zdtToDate(zdt) {
7795
7836
  return res;
7796
7837
  }
7797
7838
  function getDate(date) {
7798
- if (exports.greg.isDate(date))
7839
+ if (isDate(date))
7799
7840
  return date;
7800
7841
  if (HDate.isHDate(date))
7801
7842
  return date.greg();
@@ -7830,10 +7871,10 @@ function getDate(date) {
7830
7871
  class Zmanim {
7831
7872
  /**
7832
7873
  * Initialize a Zmanim instance.
7833
- * @param {GeoLocation} gloc GeoLocation including latitude, longitude, and timezone
7834
- * @param {Date|HDate} date Regular or Hebrew Date. If `date` is a regular `Date`,
7874
+ * @param gloc GeoLocation including latitude, longitude, and timezone
7875
+ * @param date Regular or Hebrew Date. If `date` is a regular `Date`,
7835
7876
  * hours, minutes, seconds and milliseconds are ignored.
7836
- * @param {boolean} useElevation use elevation for calculations (default `false`).
7877
+ * @param useElevation use elevation for calculations (default `false`).
7837
7878
  * If `true`, use elevation to affect the calculation of all sunrise/sunset based
7838
7879
  * zmanim. Note: there are some zmanim such as degree-based zmanim that are driven
7839
7880
  * by the amount of light in the sky and are not impacted by elevation.
@@ -7846,7 +7887,7 @@ class Zmanim {
7846
7887
  const plainDate = Temporal.PlainDate.from({
7847
7888
  year: dt.getFullYear(),
7848
7889
  month: dt.getMonth() + 1,
7849
- day: dt.getDate()
7890
+ day: dt.getDate(),
7850
7891
  });
7851
7892
  this.noaa = new NOAACalculator(gloc, plainDate);
7852
7893
  this.useElevation = Boolean(useElevation);
@@ -7854,14 +7895,13 @@ class Zmanim {
7854
7895
  /**
7855
7896
  * Returns `true` if elevation adjustment is enabled
7856
7897
  * for zmanim support elevation adjustment
7857
- * @return {boolean}
7858
7898
  */
7859
7899
  getUseElevation() {
7860
7900
  return this.useElevation;
7861
7901
  }
7862
7902
  /**
7863
7903
  * Enables or disables elevation adjustment for zmanim support elevation adjustment
7864
- * @param {boolean} useElevation
7904
+ * @param useElevation
7865
7905
  */
7866
7906
  setUseElevation(useElevation) {
7867
7907
  this.useElevation = useElevation;
@@ -7870,29 +7910,29 @@ class Zmanim {
7870
7910
  * Convenience function to get the time when sun is above or below the horizon
7871
7911
  * for a certain angle (in degrees).
7872
7912
  * This function does not support elevation adjustment.
7873
- * @param {number} angle
7874
- * @param {boolean} rising
7875
- * @return {Date}
7913
+ * @param angle
7914
+ * @param rising
7876
7915
  */
7877
7916
  timeAtAngle(angle, rising) {
7878
7917
  const offsetZenith = 90 + angle;
7879
- const zdt = rising ? this.noaa.getSunriseOffsetByDegrees(offsetZenith) :
7880
- this.noaa.getSunsetOffsetByDegrees(offsetZenith);
7918
+ const zdt = rising
7919
+ ? this.noaa.getSunriseOffsetByDegrees(offsetZenith)
7920
+ : this.noaa.getSunsetOffsetByDegrees(offsetZenith);
7881
7921
  return zdtToDate(zdt);
7882
7922
  }
7883
7923
  /**
7884
7924
  * Upper edge of the Sun appears over the eastern horizon in the morning (0.833° above horizon)
7885
7925
  * If elevation is enabled, this function will include elevation in the calculation.
7886
- * @return {Date}
7887
7926
  */
7888
7927
  sunrise() {
7889
- const zdt = this.useElevation ? this.noaa.getSunrise() : this.noaa.getSeaLevelSunrise();
7928
+ const zdt = this.useElevation
7929
+ ? this.noaa.getSunrise()
7930
+ : this.noaa.getSeaLevelSunrise();
7890
7931
  return zdtToDate(zdt);
7891
7932
  }
7892
7933
  /**
7893
7934
  * Upper edge of the Sun appears over the eastern horizon in the morning (0.833° above horizon).
7894
7935
  * This function does not support elevation adjustment.
7895
- * @return {Date}
7896
7936
  */
7897
7937
  seaLevelSunrise() {
7898
7938
  const zdt = this.noaa.getSeaLevelSunrise();
@@ -7901,16 +7941,16 @@ class Zmanim {
7901
7941
  /**
7902
7942
  * When the upper edge of the Sun disappears below the horizon (0.833° below horizon).
7903
7943
  * If elevation is enabled, this function will include elevation in the calculation.
7904
- * @return {Date}
7905
7944
  */
7906
7945
  sunset() {
7907
- const zdt = this.useElevation ? this.noaa.getSunset() : this.noaa.getSeaLevelSunset();
7946
+ const zdt = this.useElevation
7947
+ ? this.noaa.getSunset()
7948
+ : this.noaa.getSeaLevelSunset();
7908
7949
  return zdtToDate(zdt);
7909
7950
  }
7910
7951
  /**
7911
7952
  * When the upper edge of the Sun disappears below the horizon (0.833° below horizon).
7912
7953
  * This function does not support elevation adjustment.
7913
- * @return {Date}
7914
7954
  */
7915
7955
  seaLevelSunset() {
7916
7956
  const zdt = this.noaa.getSeaLevelSunset();
@@ -7920,7 +7960,6 @@ class Zmanim {
7920
7960
  * Civil dawn; Sun is 6° below the horizon in the morning.
7921
7961
  * Because degree-based functions estimate the amount of light in the sky,
7922
7962
  * the result is not impacted by elevation.
7923
- * @return {Date}
7924
7963
  */
7925
7964
  dawn() {
7926
7965
  const zdt = this.noaa.getBeginCivilTwilight();
@@ -7930,7 +7969,6 @@ class Zmanim {
7930
7969
  * Civil dusk; Sun is 6° below the horizon in the evening.
7931
7970
  * Because degree-based functions estimate the amount of light in the sky,
7932
7971
  * the result is not impacted by elevation.
7933
- * @return {Date}
7934
7972
  */
7935
7973
  dusk() {
7936
7974
  const zdt = this.noaa.getEndCivilTwilight();
@@ -7939,7 +7977,6 @@ class Zmanim {
7939
7977
  /**
7940
7978
  * Returns sunset for the previous day.
7941
7979
  * If elevation is enabled, this function will include elevation in the calculation.
7942
- * @return {Date}
7943
7980
  */
7944
7981
  gregEve() {
7945
7982
  const prev = new Date(this.date);
@@ -7949,14 +7986,12 @@ class Zmanim {
7949
7986
  }
7950
7987
  /**
7951
7988
  * @private
7952
- * @return {number}
7953
7989
  */
7954
7990
  nightHour() {
7955
7991
  return (this.sunrise().getTime() - this.gregEve().getTime()) / 12; // ms in hour
7956
7992
  }
7957
7993
  /**
7958
7994
  * Midday – Chatzot; Sunrise plus 6 halachic hours
7959
- * @return {Date}
7960
7995
  */
7961
7996
  chatzot() {
7962
7997
  const startOfDay = this.noaa.getSeaLevelSunrise();
@@ -7967,16 +8002,14 @@ class Zmanim {
7967
8002
  /**
7968
8003
  * Midnight – Chatzot; Sunset plus 6 halachic hours.
7969
8004
  * If elevation is enabled, this function will include elevation in the calculation.
7970
- * @return {Date}
7971
8005
  */
7972
8006
  chatzotNight() {
7973
- return new Date(this.sunrise().getTime() - (this.nightHour() * 6));
8007
+ return new Date(this.sunrise().getTime() - this.nightHour() * 6);
7974
8008
  }
7975
8009
  /**
7976
8010
  * Dawn – Alot haShachar; Sun is 16.1° below the horizon in the morning.
7977
8011
  * Because degree-based functions estimate the amount of light in the sky,
7978
8012
  * the result is not impacted by elevation.
7979
- * @return {Date}
7980
8013
  */
7981
8014
  alotHaShachar() {
7982
8015
  return this.timeAtAngle(16.1, true);
@@ -7985,7 +8018,6 @@ class Zmanim {
7985
8018
  * Earliest talis & tefillin – Misheyakir; Sun is 11.5° below the horizon in the morning.
7986
8019
  * Because degree-based functions estimate the amount of light in the sky,
7987
8020
  * the result is not impacted by elevation.
7988
- * @return {Date}
7989
8021
  */
7990
8022
  misheyakir() {
7991
8023
  return this.timeAtAngle(11.5, true);
@@ -7994,7 +8026,6 @@ class Zmanim {
7994
8026
  * Earliest talis & tefillin – Misheyakir Machmir; Sun is 10.2° below the horizon in the morning.
7995
8027
  * Because degree-based functions estimate the amount of light in the sky,
7996
8028
  * the result is not impacted by elevation.
7997
- * @return {Date}
7998
8029
  */
7999
8030
  misheyakirMachmir() {
8000
8031
  return this.timeAtAngle(10.2, true);
@@ -8002,12 +8033,15 @@ class Zmanim {
8002
8033
  /**
8003
8034
  * Utility method for using elevation-aware sunrise/sunset
8004
8035
  * @private
8005
- * @param {number} hours
8006
- * @return {Date}
8036
+ * @param hours
8007
8037
  */
8008
8038
  getShaahZmanisBasedZman(hours) {
8009
- const startOfDay = this.useElevation ? this.noaa.getSunrise() : this.noaa.getSeaLevelSunrise();
8010
- const endOfDay = this.useElevation ? this.noaa.getSunset() : this.noaa.getSeaLevelSunset();
8039
+ const startOfDay = this.useElevation
8040
+ ? this.noaa.getSunrise()
8041
+ : this.noaa.getSeaLevelSunrise();
8042
+ const endOfDay = this.useElevation
8043
+ ? this.noaa.getSunset()
8044
+ : this.noaa.getSeaLevelSunset();
8011
8045
  const temporalHour = this.noaa.getTemporalHour(startOfDay, endOfDay);
8012
8046
  const offset = Math.round(temporalHour * hours);
8013
8047
  const zdt = NOAACalculator.getTimeOffset(startOfDay, offset);
@@ -8016,9 +8050,9 @@ class Zmanim {
8016
8050
  /**
8017
8051
  * Latest Shema (Gra); Sunrise plus 3 halachic hours, according to the Gra.
8018
8052
  * If elevation is enabled, this function will include elevation in the calculation.
8019
- * @return {Date}
8020
8053
  */
8021
8054
  sofZmanShma() {
8055
+ // Gra
8022
8056
  return this.getShaahZmanisBasedZman(3);
8023
8057
  }
8024
8058
  /**
@@ -8030,9 +8064,9 @@ class Zmanim {
8030
8064
  * to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).
8031
8065
  *
8032
8066
  * If elevation is enabled, this function will include elevation in the calculation.
8033
- * @return {Date}
8034
8067
  */
8035
8068
  sofZmanTfilla() {
8069
+ // Gra
8036
8070
  return this.getShaahZmanisBasedZman(4);
8037
8071
  }
8038
8072
  /**
@@ -8060,9 +8094,9 @@ class Zmanim {
8060
8094
  * Based on the opinion of the MGA that the day is calculated from
8061
8095
  * dawn being fixed 72 minutes before sea-level sunrise, and nightfall is fixed
8062
8096
  * 72 minutes after sea-level sunset.
8063
- * @return {Date}
8064
8097
  */
8065
8098
  sofZmanShmaMGA() {
8099
+ // Magen Avraham
8066
8100
  const [alot72, temporalHour] = this.getTemporalHour72(true);
8067
8101
  const offset = Math.floor(3 * temporalHour);
8068
8102
  return new Date(alot72.getTime() + offset);
@@ -8071,7 +8105,6 @@ class Zmanim {
8071
8105
  * Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.
8072
8106
  * Based on the opinion of the MGA that the day is calculated from
8073
8107
  * dawn to nightfall with both being 16.1° below the horizon.
8074
- * @return {Date}
8075
8108
  */
8076
8109
  sofZmanShmaMGA16Point1() {
8077
8110
  const [alot, temporalHour] = this.getTemporalHourByDeg(16.1);
@@ -8086,7 +8119,6 @@ class Zmanim {
8086
8119
  * This calculation is based on the position of the sun 90 minutes after sunset in Jerusalem
8087
8120
  * around the equinox / equilux which calculates to 19.8° below geometric zenith.
8088
8121
  * https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/
8089
- * @return {Date}
8090
8122
  */
8091
8123
  sofZmanShmaMGA19Point8() {
8092
8124
  const [alot, temporalHour] = this.getTemporalHourByDeg(19.8);
@@ -8095,9 +8127,9 @@ class Zmanim {
8095
8127
  }
8096
8128
  /**
8097
8129
  * Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham
8098
- * @return {Date}
8099
8130
  */
8100
8131
  sofZmanTfillaMGA() {
8132
+ // Magen Avraham
8101
8133
  const [alot72, temporalHour] = this.getTemporalHour72(true);
8102
8134
  const offset = Math.floor(4 * temporalHour);
8103
8135
  return new Date(alot72.getTime() + offset);
@@ -8106,7 +8138,6 @@ class Zmanim {
8106
8138
  * Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham.
8107
8139
  * Based on the opinion of the MGA that the day is calculated from
8108
8140
  * dawn to nightfall with both being 16.1° below the horizon.
8109
- * @return {Date}
8110
8141
  */
8111
8142
  sofZmanTfillaMGA16Point1() {
8112
8143
  const [alot, temporalHour] = this.getTemporalHourByDeg(16.1);
@@ -8121,7 +8152,6 @@ class Zmanim {
8121
8152
  * This calculation is based on the position of the sun 90 minutes after sunset in Jerusalem
8122
8153
  * around the equinox / equilux which calculates to 19.8° below geometric zenith.
8123
8154
  * https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/
8124
- * @return {Date}
8125
8155
  */
8126
8156
  sofZmanTfillaMGA19Point8() {
8127
8157
  const [alot, temporalHour] = this.getTemporalHourByDeg(19.8);
@@ -8140,7 +8170,6 @@ class Zmanim {
8140
8170
  * The Ramba"m is of the opinion that it is better to delay *mincha* until
8141
8171
  * *mincha ketana* while the Ra"sh, Tur, GRA and others are of the
8142
8172
  * opinion that *mincha* can be prayed *lechatchila* starting at *mincha gedola*.
8143
- * @return {Date}
8144
8173
  */
8145
8174
  minchaGedola() {
8146
8175
  return this.getShaahZmanisBasedZman(6.5);
@@ -8152,7 +8181,6 @@ class Zmanim {
8152
8181
  * This method returns the time of *mincha gedola* according to the Magen Avraham
8153
8182
  * with the day starting 72 minutes before sunrise and ending 72 minutes after sunset.
8154
8183
  * This is the earliest time to pray *mincha*.
8155
- * @return {Date}
8156
8184
  */
8157
8185
  minchaGedolaMGA() {
8158
8186
  const [alot72, temporalHour] = this.getTemporalHour72(false);
@@ -8168,7 +8196,6 @@ class Zmanim {
8168
8196
  * that is 9.5 *shaos zmaniyos* (solar hours) after sunrise or sea level sunrise
8169
8197
  * (depending on the `useElevation` setting), according
8170
8198
  * to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).
8171
- * @return {Date}
8172
8199
  */
8173
8200
  minchaKetana() {
8174
8201
  return this.getShaahZmanisBasedZman(9.5);
@@ -8180,7 +8207,6 @@ class Zmanim {
8180
8207
  * the [Rambam](https://en.wikipedia.org/wiki/Maimonides) and others.
8181
8208
  *
8182
8209
  * If elevation is enabled, this function will include elevation in the calculation.
8183
- * @return {Date}
8184
8210
  */
8185
8211
  minchaKetanaMGA() {
8186
8212
  const [alot72, temporalHour] = this.getTemporalHour72(false);
@@ -8189,31 +8215,27 @@ class Zmanim {
8189
8215
  /**
8190
8216
  * Plag haMincha; Sunrise plus 10.75 halachic hours.
8191
8217
  * If elevation is enabled, this function will include elevation in the calculation.
8192
- * @return {Date}
8193
8218
  */
8194
8219
  plagHaMincha() {
8195
8220
  return this.getShaahZmanisBasedZman(10.75);
8196
8221
  }
8197
8222
  /**
8198
- * @param {number} [angle=8.5] optional time for solar depression.
8223
+ * @param [angle=8.5] optional time for solar depression.
8199
8224
  * Default is 8.5 degrees for 3 small stars, use 7.083 degrees for 3 medium-sized stars.
8200
8225
  * Because degree-based functions estimate the amount of light in the sky,
8201
8226
  * the result is not impacted by elevation.
8202
- * @return {Date}
8203
8227
  */
8204
8228
  tzeit(angle = 8.5) {
8205
8229
  return this.timeAtAngle(angle, false);
8206
8230
  }
8207
8231
  /**
8208
8232
  * Alias for sunrise
8209
- * @return {Date}
8210
8233
  */
8211
8234
  neitzHaChama() {
8212
8235
  return this.sunrise();
8213
8236
  }
8214
8237
  /**
8215
8238
  * Alias for sunset
8216
- * @return {Date}
8217
8239
  */
8218
8240
  shkiah() {
8219
8241
  return this.sunset();
@@ -8225,7 +8247,6 @@ class Zmanim {
8225
8247
  * it is 13.5 minutes before tzies 7.083.
8226
8248
  * Because degree-based functions estimate the amount of light in the sky,
8227
8249
  * the result is not impacted by elevation.
8228
- * @return {Date}
8229
8250
  */
8230
8251
  beinHaShmashos() {
8231
8252
  const tzeit = this.tzeit(7.083);
@@ -8233,13 +8254,10 @@ class Zmanim {
8233
8254
  if (isNaN(millis)) {
8234
8255
  return tzeit;
8235
8256
  }
8236
- return new Date(millis - (13.5 * 60 * 1000));
8257
+ return new Date(millis - 13.5 * 60 * 1000);
8237
8258
  }
8238
8259
  /**
8239
8260
  * Uses timeFormat to return a date like '20:34'
8240
- * @param {Date} dt
8241
- * @param {Intl.DateTimeFormat} timeFormat
8242
- * @return {string}
8243
8261
  */
8244
8262
  static formatTime(dt, timeFormat) {
8245
8263
  const time = timeFormat.format(dt);
@@ -8251,8 +8269,7 @@ class Zmanim {
8251
8269
  }
8252
8270
  /**
8253
8271
  * Discards seconds, rounding to nearest minute.
8254
- * @param {Date} dt
8255
- * @return {Date}
8272
+ * @param dt
8256
8273
  */
8257
8274
  static roundTime(dt) {
8258
8275
  const millis = dt.getTime();
@@ -8265,15 +8282,14 @@ class Zmanim {
8265
8282
  if (seconds === 0 && millisOnly === 0) {
8266
8283
  return dt;
8267
8284
  }
8268
- const secAndMillis = (seconds * 1000) + millisOnly;
8269
- const delta = (secAndMillis >= 30000) ? 60000 - secAndMillis : -1 * secAndMillis;
8285
+ const secAndMillis = seconds * 1000 + millisOnly;
8286
+ const delta = secAndMillis >= 30000 ? 60000 - secAndMillis : -1 * secAndMillis;
8270
8287
  return new Date(millis + delta);
8271
8288
  }
8272
8289
  /**
8273
8290
  * Get offset string (like "+05:00" or "-08:00") from tzid (like "Europe/Moscow")
8274
- * @param {string} tzid
8275
- * @param {Date} date
8276
- * @return {string}
8291
+ * @param tzid
8292
+ * @param date
8277
8293
  */
8278
8294
  static timeZoneOffset(tzid, date) {
8279
8295
  const offset = getTimezoneOffset(tzid, date);
@@ -8284,24 +8300,23 @@ class Zmanim {
8284
8300
  }
8285
8301
  /**
8286
8302
  * Returns a string like "2022-04-01T13:06:00-11:00"
8287
- * @param {string} tzid
8288
- * @param {Date} date
8289
- * @return {string}
8303
+ * @param tzid
8304
+ * @param date
8290
8305
  */
8291
8306
  static formatISOWithTimeZone(tzid, date) {
8292
8307
  if (isNaN(date.getTime())) {
8293
8308
  return '0000-00-00T00:00:00Z';
8294
8309
  }
8295
- return getPseudoISO(tzid, date).substring(0, 19) + Zmanim.timeZoneOffset(tzid, date);
8310
+ return (getPseudoISO(tzid, date).substring(0, 19) +
8311
+ Zmanim.timeZoneOffset(tzid, date));
8296
8312
  }
8297
8313
  /**
8298
8314
  * Returns sunrise + `offset` minutes (either positive or negative).
8299
8315
  * If elevation is enabled, this function will include elevation in the calculation
8300
8316
  * unless `forceSeaLevel` is `true`.
8301
- * @param {number} offset minutes
8302
- * @param {boolean} roundMinute round time to nearest minute (default true)
8303
- * @param {boolean} forceSeaLevel use sea-level sunrise (default false)
8304
- * @return {Date}
8317
+ * @param offset minutes
8318
+ * @param roundMinute round time to nearest minute (default true)
8319
+ * @param forceSeaLevel use sea-level sunrise (default false)
8305
8320
  */
8306
8321
  sunriseOffset(offset, roundMinute = true, forceSeaLevel = false) {
8307
8322
  const sunrise = forceSeaLevel ? this.seaLevelSunrise() : this.sunrise();
@@ -8315,16 +8330,15 @@ class Zmanim {
8315
8330
  }
8316
8331
  sunrise.setSeconds(0, 0);
8317
8332
  }
8318
- return new Date(sunrise.getTime() + (offset * 60 * 1000));
8333
+ return new Date(sunrise.getTime() + offset * 60 * 1000);
8319
8334
  }
8320
8335
  /**
8321
8336
  * Returns sunset + `offset` minutes (either positive or negative).
8322
8337
  * If elevation is enabled, this function will include elevation in the calculation
8323
8338
  * unless `forceSeaLevel` is `true`.
8324
- * @param {number} offset minutes
8325
- * @param {boolean} roundMinute round time to nearest minute (default true)
8326
- * @param {boolean} forceSeaLevel use sea-level sunset (default false)
8327
- * @return {Date}
8339
+ * @param offset minutes
8340
+ * @param roundMinute round time to nearest minute (default true)
8341
+ * @param forceSeaLevel use sea-level sunset (default false)
8328
8342
  */
8329
8343
  sunsetOffset(offset, roundMinute = true, forceSeaLevel = false) {
8330
8344
  const sunset = forceSeaLevel ? this.seaLevelSunset() : this.sunset();
@@ -8338,19 +8352,29 @@ class Zmanim {
8338
8352
  }
8339
8353
  sunset.setSeconds(0, 0);
8340
8354
  }
8341
- return new Date(sunset.getTime() + (offset * 60 * 1000));
8355
+ return new Date(sunset.getTime() + offset * 60 * 1000);
8342
8356
  }
8343
8357
  }
8344
8358
 
8345
8359
  const hour12cc = {
8346
- US: 1, CA: 1, BR: 1, AU: 1, NZ: 1, DO: 1, PR: 1, GR: 1, IN: 1, KR: 1, NP: 1, ZA: 1,
8360
+ US: 1,
8361
+ CA: 1,
8362
+ BR: 1,
8363
+ AU: 1,
8364
+ NZ: 1,
8365
+ DO: 1,
8366
+ PR: 1,
8367
+ GR: 1,
8368
+ IN: 1,
8369
+ KR: 1,
8370
+ NP: 1,
8371
+ ZA: 1,
8347
8372
  };
8348
8373
  /**
8349
8374
  * @private
8350
- * @param {string} timeStr - original time like "20:30"
8351
- * @param {string} suffix - "p" or "pm" or " P.M.". Add leading space if you want it
8352
- * @param {CalOptions} options
8353
- * @return {string}
8375
+ * @param timeStr - original time like "20:30"
8376
+ * @param suffix - "p" or "pm" or " P.M.". Add leading space if you want it
8377
+ * @param options
8354
8378
  */
8355
8379
  function reformatTimeStr(timeStr, suffix, options) {
8356
8380
  var _a;
@@ -8384,7 +8408,7 @@ function reformatTimeStr(timeStr, suffix, options) {
8384
8408
  /** An event that has an `eventTime` and `eventTimeStr` */
8385
8409
  class TimedEvent extends Event {
8386
8410
  /**
8387
- * @param {string} desc Description (not translated)
8411
+ * @param desc Description (not translated)
8388
8412
  */
8389
8413
  constructor(date, desc, mask, eventTime, location, linkedEvent, options) {
8390
8414
  super(date, desc, mask);
@@ -8399,21 +8423,18 @@ class TimedEvent extends Event {
8399
8423
  }
8400
8424
  }
8401
8425
  /**
8402
- * @param {string} [locale] Optional locale name (defaults to active locale).
8403
- * @return {string}
8426
+ * @param [locale] Optional locale name (defaults to active locale).
8404
8427
  */
8405
8428
  render(locale) {
8406
8429
  return Locale.gettext(this.getDesc(), locale) + ': ' + this.fmtTime;
8407
8430
  }
8408
8431
  /**
8409
8432
  * Returns translation of "Candle lighting" without the time.
8410
- * @param {string} [locale] Optional locale name (defaults to active locale).
8411
- * @return {string}
8433
+ * @param [locale] Optional locale name (defaults to active locale).
8412
8434
  */
8413
8435
  renderBrief(locale) {
8414
8436
  return Locale.gettext(this.getDesc(), locale);
8415
8437
  }
8416
- /** @return {string[]} */
8417
8438
  getCategories() {
8418
8439
  const desc = this.getDesc();
8419
8440
  switch (desc) {
@@ -8437,7 +8458,6 @@ class CandleLightingEvent extends TimedEvent {
8437
8458
  constructor(date, mask, eventTime, location, linkedEvent, options) {
8438
8459
  super(date, 'Candle lighting', mask, eventTime, location, linkedEvent, options);
8439
8460
  }
8440
- /** @return {string} */
8441
8461
  getEmoji() {
8442
8462
  return '🕯️';
8443
8463
  }
@@ -8451,16 +8471,14 @@ class HavdalahEvent extends TimedEvent {
8451
8471
  }
8452
8472
  }
8453
8473
  /**
8454
- * @param {string} [locale] Optional locale name (defaults to active locale).
8455
- * @return {string}
8474
+ * @param [locale] Optional locale name (defaults to active locale).
8456
8475
  */
8457
8476
  render(locale) {
8458
8477
  return this.renderBrief(locale) + ': ' + this.fmtTime;
8459
8478
  }
8460
8479
  /**
8461
8480
  * Returns translation of "Havdalah" without the time.
8462
- * @param {string} [locale] Optional locale name (defaults to active locale).
8463
- * @return {string}
8481
+ * @param [locale] Optional locale name (defaults to active locale).
8464
8482
  */
8465
8483
  renderBrief(locale) {
8466
8484
  let str = Locale.gettext(this.getDesc(), locale);
@@ -8470,7 +8488,6 @@ class HavdalahEvent extends TimedEvent {
8470
8488
  }
8471
8489
  return str;
8472
8490
  }
8473
- /** @return {string} */
8474
8491
  getEmoji() {
8475
8492
  return '✨';
8476
8493
  }
@@ -8478,7 +8495,15 @@ class HavdalahEvent extends TimedEvent {
8478
8495
 
8479
8496
  /* eslint-disable camelcase */
8480
8497
  const shortDayNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
8481
- const heDayNames = ['רִאשׁוֹן', 'שֵׁנִי', 'שְׁלִישִׁי', 'רְבִיעִי', 'חֲמִישִׁי', 'שִׁישִּׁי', 'שַׁבָּת'];
8498
+ const heDayNames = [
8499
+ 'רִאשׁוֹן',
8500
+ 'שֵׁנִי',
8501
+ 'שְׁלִישִׁי',
8502
+ 'רְבִיעִי',
8503
+ 'חֲמִישִׁי',
8504
+ 'שִׁישִּׁי',
8505
+ 'שַׁבָּת',
8506
+ ];
8482
8507
  const night = 'בַּלַּ֥יְלָה';
8483
8508
  function getHebrewTimeOfDay(hour) {
8484
8509
  if (hour < 5)
@@ -8497,58 +8522,54 @@ function getHebrewTimeOfDay(hour) {
8497
8522
  class Molad {
8498
8523
  /**
8499
8524
  * Calculates the molad for a Hebrew month
8500
- * @param {number} year
8501
- * @param {number} month
8525
+ * @param year
8526
+ * @param month
8502
8527
  */
8503
8528
  constructor(year, month) {
8504
8529
  this.m = molad(year, month);
8505
8530
  }
8506
8531
  /**
8507
- * @return {number}
8508
8532
  */
8509
8533
  getYear() {
8510
8534
  return this.m.year;
8511
8535
  }
8512
8536
  /**
8513
- * @return {number}
8514
8537
  */
8515
8538
  getMonth() {
8516
8539
  return this.m.month;
8517
8540
  }
8518
8541
  /**
8519
- * @return {string}
8520
8542
  */
8521
8543
  getMonthName() {
8522
8544
  return HDate.getMonthName(this.m.month, this.m.year);
8523
8545
  }
8524
8546
  /**
8525
- * @return {number} Day of Week (0=Sunday, 6=Saturday)
8547
+ * @returns Day of Week (0=Sunday, 6=Saturday)
8526
8548
  */
8527
8549
  getDow() {
8528
8550
  return this.m.dayOfWeek;
8529
8551
  }
8530
8552
  /**
8531
- * @return {number} hour of day (0-23)
8553
+ * @returns hour of day (0-23)
8532
8554
  */
8533
8555
  getHour() {
8534
8556
  return this.m.hour;
8535
8557
  }
8536
8558
  /**
8537
- * @return {number} minutes past hour (0-59)
8559
+ * @returns minutes past hour (0-59)
8538
8560
  */
8539
8561
  getMinutes() {
8540
8562
  return this.m.minutes;
8541
8563
  }
8542
8564
  /**
8543
- * @return {number} parts of a minute (0-17)
8565
+ * @returns parts of a minute (0-17)
8544
8566
  */
8545
8567
  getChalakim() {
8546
8568
  return this.m.chalakim;
8547
8569
  }
8548
8570
  /**
8549
- * @param {string} [locale] Optional locale name (defaults to active locale)
8550
- * @param {CalOptions} options
8551
- * @return {string}
8571
+ * @param [locale] Optional locale name (defaults to active locale)
8572
+ * @param options
8552
8573
  */
8553
8574
  render(locale, options) {
8554
8575
  var _a;
@@ -8585,10 +8606,10 @@ class Molad {
8585
8606
  /** Represents a Molad announcement on Shabbat Mevarchim */
8586
8607
  class MoladEvent extends Event {
8587
8608
  /**
8588
- * @param {HDate} date Hebrew date event occurs
8589
- * @param {number} hyear molad year
8590
- * @param {number} hmonth molad month
8591
- * @param {CalOptions} options
8609
+ * @param date Hebrew date event occurs
8610
+ * @param hyear molad year
8611
+ * @param hmonth molad month
8612
+ * @param options
8592
8613
  */
8593
8614
  constructor(date, hyear, hmonth, options) {
8594
8615
  const m = new Molad(hyear, hmonth);
@@ -8598,8 +8619,7 @@ class MoladEvent extends Event {
8598
8619
  this.options = options;
8599
8620
  }
8600
8621
  /**
8601
- * @param {string} [locale] Optional locale name (defaults to active locale).
8602
- * @return {string}
8622
+ * @param [locale] Optional locale name (defaults to active locale).
8603
8623
  */
8604
8624
  render(locale) {
8605
8625
  return this.molad.render(locale, this.options);
@@ -8609,8 +8629,8 @@ class MoladEvent extends Event {
8609
8629
  /** Represents a day 1-49 of counting the Omer from Pesach to Shavuot */
8610
8630
  class OmerEvent extends Event {
8611
8631
  /**
8612
- * @param {HDate} date
8613
- * @param {number} omerDay
8632
+ * @param date
8633
+ * @param omerDay
8614
8634
  */
8615
8635
  constructor(date, omerDay) {
8616
8636
  super(date, `Omer ${omerDay}`, flags.OMER_COUNT);
@@ -8618,12 +8638,11 @@ class OmerEvent extends Event {
8618
8638
  throw new RangeError(`Invalid Omer day ${omerDay}`);
8619
8639
  }
8620
8640
  this.weekNumber = Math.floor((omerDay - 1) / 7) + 1;
8621
- this.daysWithinWeeks = (omerDay % 7) || 7;
8641
+ this.daysWithinWeeks = omerDay % 7 || 7;
8622
8642
  this.omer = omerDay;
8623
8643
  }
8624
8644
  /**
8625
- * @param {string} lang
8626
- * @return {string}
8645
+ * @param lang
8627
8646
  */
8628
8647
  sefira(lang = 'en') {
8629
8648
  if (lang !== 'he' && lang !== 'translit') {
@@ -8633,8 +8652,7 @@ class OmerEvent extends Event {
8633
8652
  }
8634
8653
  /**
8635
8654
  * @todo use gettext()
8636
- * @param {string} [locale] Optional locale name (defaults to active locale).
8637
- * @return {string}
8655
+ * @param [locale] Optional locale name (defaults to active locale).
8638
8656
  */
8639
8657
  render(locale) {
8640
8658
  locale = locale !== null && locale !== void 0 ? locale : Locale.getLocaleName();
@@ -8648,30 +8666,29 @@ class OmerEvent extends Event {
8648
8666
  }
8649
8667
  /**
8650
8668
  * Returns translation of "Omer day 22" without ordinal numbers.
8651
- * @param {string} [locale] Optional locale name (defaults to active locale).
8652
- * @return {string}
8669
+ * @param [locale] Optional locale name (defaults to active locale).
8653
8670
  */
8654
8671
  renderBrief(locale) {
8655
- return Locale.gettext('Omer', locale) + ' ' + Locale.gettext('day', locale) + ' ' + this.omer;
8672
+ return (Locale.gettext('Omer', locale) +
8673
+ ' ' +
8674
+ Locale.gettext('day', locale) +
8675
+ ' ' +
8676
+ this.omer);
8656
8677
  }
8657
- /** @return {string} */
8658
8678
  getEmoji() {
8659
8679
  if (typeof this.emoji === 'string')
8660
8680
  return this.emoji;
8661
8681
  return omerEmoji(this.omer);
8662
8682
  }
8663
- /** @return {number} */
8664
8683
  getWeeks() {
8665
8684
  const day7 = this.daysWithinWeeks === 7;
8666
8685
  return day7 ? this.weekNumber : this.weekNumber - 1;
8667
8686
  }
8668
- /** @return {number} */
8669
8687
  getDaysWithinWeeks() {
8670
8688
  return this.daysWithinWeeks;
8671
8689
  }
8672
8690
  /**
8673
- * @param {string} locale
8674
- * @return {string}
8691
+ * @param locale
8675
8692
  */
8676
8693
  getTodayIs(locale) {
8677
8694
  locale = locale !== null && locale !== void 0 ? locale : Locale.getLocaleName();
@@ -8685,7 +8702,6 @@ class OmerEvent extends Event {
8685
8702
  }
8686
8703
  return str;
8687
8704
  }
8688
- /** @return {string} */
8689
8705
  url() {
8690
8706
  return `https://www.hebcal.com/omer/${this.getDate().getFullYear()}/${this.omer}`;
8691
8707
  }
@@ -9028,8 +9044,8 @@ function yearType(hyear) {
9028
9044
  class Sedra {
9029
9045
  /**
9030
9046
  * Caculates the Parashah HaShavua for an entire Hebrew year
9031
- * @param {number} hyear - Hebrew year (e.g. 5749)
9032
- * @param {boolean} il - Use Israel sedra schedule (false for Diaspora)
9047
+ * @param hyear - Hebrew year (e.g. 5749)
9048
+ * @param il - Use Israel sedra schedule (false for Diaspora)
9033
9049
  */
9034
9050
  constructor(hyear, il) {
9035
9051
  hyear = +hyear;
@@ -9047,7 +9063,7 @@ class Sedra {
9047
9063
  this.theSedraArray = types[key];
9048
9064
  }
9049
9065
  else {
9050
- key = key + (+this.il); // cast to num, then concat
9066
+ key = key + +this.il; // cast to num, then concat
9051
9067
  this.theSedraArray = types[key];
9052
9068
  }
9053
9069
  if (!this.theSedraArray) {
@@ -9056,24 +9072,22 @@ class Sedra {
9056
9072
  }
9057
9073
  /**
9058
9074
  * Returns the parsha (or parshiyot) read on Hebrew date
9059
- * @param {HDate|number} hd Hebrew date or R.D. days
9060
- * @return {string[]}
9075
+ * @param hd Hebrew date or R.D. days
9061
9076
  */
9062
9077
  get(hd) {
9063
9078
  return this.lookup(hd).parsha;
9064
9079
  }
9065
9080
  /**
9066
9081
  * Looks up parsha for the date, then returns a translated or transliterated string
9067
- * @param {HDate|number} hd Hebrew date or R.D. days
9068
- * @param {string} [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale
9069
- * @return {string}
9082
+ * @param hd Hebrew date or R.D. days
9083
+ * @param [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale
9070
9084
  */
9071
9085
  getString(hd, locale) {
9072
9086
  const parsha = this.get(hd);
9073
9087
  const locale0 = locale || Locale.getLocaleName();
9074
9088
  let name = Locale.gettext(parsha[0], locale0);
9075
- if (parsha.length == 2) {
9076
- const hyphen = locale0 == 'he' ? '־' : '-';
9089
+ if (parsha.length === 2) {
9090
+ const hyphen = locale0 === 'he' ? '־' : '-';
9077
9091
  name += hyphen + Locale.gettext(parsha[1], locale0);
9078
9092
  }
9079
9093
  name = name.replace(/'/g, '’');
@@ -9082,8 +9096,7 @@ class Sedra {
9082
9096
  /**
9083
9097
  * Checks to see if this day would be a regular parasha HaShavua
9084
9098
  * Torah reading or special holiday reading
9085
- * @param {HDate|number} hd Hebrew date or R.D. days
9086
- * @return {boolean}
9099
+ * @param hd Hebrew date or R.D. days
9087
9100
  */
9088
9101
  isParsha(hd) {
9089
9102
  return !this.lookup(hd).chag;
@@ -9091,8 +9104,6 @@ class Sedra {
9091
9104
  /**
9092
9105
  * Returns the date that a parsha occurs
9093
9106
  * or `null` if the parsha doesn't occur this year
9094
- * @param {number|string|string[]} parsha
9095
- * @return {HDate|null}
9096
9107
  */
9097
9108
  find(parsha) {
9098
9109
  if (typeof parsha === 'number') {
@@ -9103,7 +9114,7 @@ class Sedra {
9103
9114
  if (idx === -1) {
9104
9115
  return null; // doesn't occur this year
9105
9116
  }
9106
- return new HDate(this.firstSaturday + (idx * 7));
9117
+ return new HDate(this.firstSaturday + idx * 7);
9107
9118
  }
9108
9119
  else if (typeof parsha === 'string') {
9109
9120
  const num = parsha2id.get(parsha);
@@ -9119,15 +9130,18 @@ class Sedra {
9119
9130
  if (idx === -1) {
9120
9131
  return null; // doesn't occur this year
9121
9132
  }
9122
- return new HDate(this.firstSaturday + (idx * 7));
9133
+ return new HDate(this.firstSaturday + idx * 7);
9123
9134
  }
9124
9135
  }
9125
- else if (Array.isArray(parsha) && parsha.length === 1 &&
9136
+ else if (Array.isArray(parsha) &&
9137
+ parsha.length === 1 &&
9126
9138
  typeof parsha[0] === 'string') {
9127
9139
  return this.find(parsha[0]);
9128
9140
  }
9129
- else if (Array.isArray(parsha) && parsha.length === 2 &&
9130
- typeof parsha[0] === 'string' && typeof parsha[1] === 'string') {
9141
+ else if (Array.isArray(parsha) &&
9142
+ parsha.length === 2 &&
9143
+ typeof parsha[0] === 'string' &&
9144
+ typeof parsha[1] === 'string') {
9131
9145
  const p1 = parsha[0];
9132
9146
  const p2 = parsha[1];
9133
9147
  const num1 = parsha2id.get(p1);
@@ -9146,30 +9160,25 @@ class Sedra {
9146
9160
  /**
9147
9161
  * Returns the underlying annual sedra schedule.
9148
9162
  * Used by `@hebcal/triennial`
9149
- * @return {NumberOrString[]}
9150
9163
  */
9151
9164
  getSedraArray() {
9152
9165
  return this.theSedraArray;
9153
9166
  }
9154
9167
  /**
9155
9168
  * R.D. date of the first Saturday on or after Rosh Hashana
9156
- * @return {number}
9157
9169
  */
9158
9170
  getFirstSaturday() {
9159
9171
  return this.firstSaturday;
9160
9172
  }
9161
- /** @return {number} */
9162
9173
  getYear() {
9163
9174
  return this.year;
9164
9175
  }
9165
9176
  /**
9166
9177
  * Returns an object describing the parsha on the first Saturday on or after `hd`
9167
- * @param {HDate|number} hd Hebrew date or R.D. days
9168
- * @return {SedraResult}
9178
+ * @param hd Hebrew date or R.D. days
9169
9179
  */
9170
9180
  lookup(hd) {
9171
- const abs = (typeof hd === 'number') ? hd :
9172
- HDate.isHDate(hd) ? hd.abs() : NaN;
9181
+ const abs = typeof hd === 'number' ? hd : HDate.isHDate(hd) ? hd.abs() : NaN;
9173
9182
  if (isNaN(abs)) {
9174
9183
  throw new TypeError(`Bad date argument: ${hd}`);
9175
9184
  }
@@ -9238,8 +9247,8 @@ const parshiot = [
9238
9247
  'Bechukotai',
9239
9248
  'Bamidbar',
9240
9249
  'Nasso',
9241
- 'Beha\'alotcha',
9242
- 'Sh\'lach',
9250
+ "Beha'alotcha",
9251
+ "Sh'lach",
9243
9252
  'Korach',
9244
9253
  'Chukat',
9245
9254
  'Balak',
@@ -9249,13 +9258,13 @@ const parshiot = [
9249
9258
  'Devarim',
9250
9259
  'Vaetchanan',
9251
9260
  'Eikev',
9252
- 'Re\'eh',
9261
+ "Re'eh",
9253
9262
  'Shoftim',
9254
9263
  'Ki Teitzei',
9255
9264
  'Ki Tavo',
9256
9265
  'Nitzavim',
9257
9266
  'Vayeilech',
9258
- 'Ha\'azinu',
9267
+ "Ha'azinu",
9259
9268
  ];
9260
9269
  const parsha2id = new Map();
9261
9270
  for (let id = 0; id < parshiot.length; id++) {
@@ -9264,8 +9273,7 @@ for (let id = 0; id < parshiot.length; id++) {
9264
9273
  }
9265
9274
  /**
9266
9275
  * @private
9267
- * @param {number} id
9268
- * @return {boolean}
9276
+ * @param id
9269
9277
  */
9270
9278
  function isValidDouble(id) {
9271
9279
  switch (id) {
@@ -9283,8 +9291,7 @@ function isValidDouble(id) {
9283
9291
  /**
9284
9292
  * parsha doubler/undoubler
9285
9293
  * @private
9286
- * @param {number} p
9287
- * @return {number}
9294
+ * @param p
9288
9295
  */
9289
9296
  function D(p) {
9290
9297
  return -p;
@@ -9303,9 +9310,8 @@ const SHAVUOT$1 = 'Shavuot'; // 33
9303
9310
  /**
9304
9311
  * Returns an array from start to end
9305
9312
  * @private
9306
- * @param {number} start beginning number, inclusive
9307
- * @param {number} stop ending number, inclusive
9308
- * @return {number[]}
9313
+ * @param start beginning number, inclusive
9314
+ * @param stop ending number, inclusive
9309
9315
  */
9310
9316
  function range$1(start, stop) {
9311
9317
  return Array.from({ length: stop - start + 1 }, (v, k) => k + start);
@@ -9326,64 +9332,64 @@ const r4350 = range$1(43, 50);
9326
9332
  */
9327
9333
  const types = {
9328
9334
  /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and
9329
- * Kislev each have 29 days), and has Passover start on Tuesday. */
9335
+ * Kislev each have 29 days), and has Passover start on Tuesday. */
9330
9336
  // e.g. 5753
9331
9337
  '020': yearStartVayeilech.concat(r020, D(21), 23, 24, PESACH, 25, D(26), D(28), 30, D(31), r3340, D(41), r4349, D(50)),
9332
9338
  /* Hebrew year that starts on Monday, is `complete' (Heshvan and
9333
- * Kislev each have 30 days), and has Passover start on Thursday. */
9339
+ * Kislev each have 30 days), and has Passover start on Thursday. */
9334
9340
  // e.g. 5756
9335
9341
  '0220': yearStartVayeilech.concat(r020, D(21), 23, 24, PESACH, 25, D(26), D(28), 30, D(31), 33, SHAVUOT$1, range$1(34, 37), D(38), 40, D(41), r4349, D(50)),
9336
9342
  /* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29
9337
- * days and Kislev has 30 days), and has Passover start on Saturday. */
9343
+ * days and Kislev has 30 days), and has Passover start on Saturday. */
9338
9344
  // e.g. 5701
9339
9345
  '0510': yearStartHaazinu.concat(r020, D(21), 23, 24, PESACH1, PESACH8, 25, D(26), D(28), 30, D(31), r3340, D(41), r4350),
9340
9346
  /* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29
9341
- * days and Kislev has 30 days), and has Passover start on Saturday. */
9347
+ * days and Kislev has 30 days), and has Passover start on Saturday. */
9342
9348
  // e.g. 5745
9343
9349
  '0511': yearStartHaazinu.concat(r020, D(21), 23, 24, PESACH, 25, D(26), D(28), range$1(30, 40), D(41), r4350),
9344
9350
  /* Hebrew year that starts on Thursday, is `complete' (Heshvan and
9345
- * Kislev each have 30 days), and has Passover start on Sunday. */
9351
+ * Kislev each have 30 days), and has Passover start on Sunday. */
9346
9352
  // e.g. 5754
9347
9353
  '052': yearStartHaazinu.concat(range$1(0, 24), PESACH7, 25, D(26), D(28), 30, D(31), r3340, D(41), r4350),
9348
9354
  /* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and Kislev
9349
- * each have 29 days), and has Passover start on Sunday. */
9355
+ * each have 29 days), and has Passover start on Sunday. */
9350
9356
  // e.g. 5761
9351
9357
  '070': yearStartRH.concat(r020, D(21), 23, 24, PESACH7, 25, D(26), D(28), 30, D(31), r3340, D(41), r4350),
9352
9358
  /* Hebrew year that starts on Saturday, is `complete' (Heshvan and
9353
- * Kislev each have 30 days), and has Passover start on Tuesday. */
9359
+ * Kislev each have 30 days), and has Passover start on Tuesday. */
9354
9360
  // e.g. 5716
9355
9361
  '072': yearStartRH.concat(r020, D(21), 23, 24, CHMPESACH, 25, D(26), D(28), 30, D(31), r3340, D(41), r4349, D(50)),
9356
9362
  /* -- The leap year types (keviot) -- */
9357
9363
  /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and
9358
- * Kislev each have 29 days), and has Passover start on Thursday. */
9364
+ * Kislev each have 29 days), and has Passover start on Thursday. */
9359
9365
  // e.g. 5746
9360
9366
  '1200': yearStartVayeilech.concat(r027, CHMPESACH, range$1(28, 33), SHAVUOT$1, range$1(34, 37), D(38), 40, D(41), r4349, D(50)),
9361
9367
  /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and
9362
- * Kislev each have 29 days), and has Passover start on Thursday. */
9368
+ * Kislev each have 29 days), and has Passover start on Thursday. */
9363
9369
  // e.g. 5746
9364
9370
  '1201': yearStartVayeilech.concat(r027, CHMPESACH, range$1(28, 40), D(41), r4349, D(50)),
9365
9371
  /* Hebrew year that starts on Monday, is `complete' (Heshvan and
9366
- * Kislev each have 30 days), and has Passover start on Saturday. */
9372
+ * Kislev each have 30 days), and has Passover start on Saturday. */
9367
9373
  // e.g.5752
9368
9374
  '1220': yearStartVayeilech.concat(r027, PESACH1, PESACH8, range$1(28, 40), D(41), r4350),
9369
9375
  /* Hebrew year that starts on Monday, is `complete' (Heshvan and
9370
- * Kislev each have 30 days), and has Passover start on Saturday. */
9376
+ * Kislev each have 30 days), and has Passover start on Saturday. */
9371
9377
  // e.g.5752
9372
9378
  '1221': yearStartVayeilech.concat(r027, PESACH, range$1(28, 50)),
9373
9379
  /* Hebrew year that starts on Thursday, is `incomplete' (Heshvan and
9374
- * Kislev both have 29 days), and has Passover start on Sunday. */
9380
+ * Kislev both have 29 days), and has Passover start on Sunday. */
9375
9381
  // e.g. 5768
9376
9382
  '150': yearStartHaazinu.concat(range$1(0, 28), PESACH7, range$1(29, 50)),
9377
9383
  /* Hebrew year that starts on Thursday, is `complete' (Heshvan and
9378
- * Kislev both have 30 days), and has Passover start on Tuesday. */
9384
+ * Kislev both have 30 days), and has Passover start on Tuesday. */
9379
9385
  // eg. 5771
9380
9386
  '152': yearStartHaazinu.concat(range$1(0, 28), CHMPESACH, range$1(29, 49), D(50)),
9381
9387
  /* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and
9382
- * Kislev each have 29 days), and has Passover start on Tuesday. */
9388
+ * Kislev each have 29 days), and has Passover start on Tuesday. */
9383
9389
  // e.g.5757
9384
9390
  '170': yearStartRH.concat(r027, CHMPESACH, range$1(28, 40), D(41), r4349, D(50)),
9385
9391
  /* Hebrew year that starts on Saturday, is `complete' (Heshvan and
9386
- * Kislev each have 30 days), and has Passover start on Thursday. */
9392
+ * Kislev each have 30 days), and has Passover start on Thursday. */
9387
9393
  '1720': yearStartRH.concat(r027, CHMPESACH, range$1(28, 33), SHAVUOT$1, range$1(34, 37), D(38), 40, D(41), r4349, D(50)),
9388
9394
  };
9389
9395
  /* Hebrew year that starts on Monday, is `complete' (Heshvan and
@@ -9411,9 +9417,8 @@ const sedraCache = new QuickLRU({ maxSize: 400 });
9411
9417
  * Convenience function to create an instance of `Sedra` or reuse a previously
9412
9418
  * created and cached instance.
9413
9419
  * @private
9414
- * @param {number} hyear
9415
- * @param {boolean} il
9416
- * @return {Sedra}
9420
+ * @param hyear
9421
+ * @param il
9417
9422
  */
9418
9423
  function getSedra_(hyear, il) {
9419
9424
  const cacheKey = `${hyear}-${il ? 1 : 0}`;
@@ -9430,11 +9435,8 @@ function getSedra_(hyear, il) {
9430
9435
  */
9431
9436
  class ParshaEvent extends Event {
9432
9437
  /**
9433
- * @param {HDate} date
9434
- * @param {string[]} parsha - untranslated name of single or double parsha,
9438
+ * @param parsha - untranslated name of single or double parsha,
9435
9439
  * such as ['Bereshit'] or ['Achrei Mot', 'Kedoshim']
9436
- * @param {boolean} [il]
9437
- * @param {number|number[]} [num]
9438
9440
  */
9439
9441
  constructor(date, parsha, il = false, num = -1) {
9440
9442
  if (!Array.isArray(parsha) || parsha.length === 0 || parsha.length > 2) {
@@ -9447,26 +9449,23 @@ class ParshaEvent extends Event {
9447
9449
  this.num = num || -1;
9448
9450
  }
9449
9451
  /**
9450
- * @param {string} [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale.
9451
- * @return {string}
9452
+ * @param [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale.
9452
9453
  */
9453
9454
  render(locale) {
9454
9455
  const locale0 = locale !== null && locale !== void 0 ? locale : Locale.getLocaleName();
9455
9456
  const parsha = this.parsha;
9456
9457
  let name = Locale.gettext(parsha[0], locale);
9457
- if (parsha.length == 2) {
9458
- const hyphen = locale0 == 'he' ? '־' : '-';
9458
+ if (parsha.length === 2) {
9459
+ const hyphen = locale0 === 'he' ? '־' : '-';
9459
9460
  name += hyphen + Locale.gettext(parsha[1], locale);
9460
9461
  }
9461
9462
  name = name.replace(/'/g, '’');
9462
9463
  const str = Locale.gettext('Parashat', locale) + ' ' + name;
9463
9464
  return str.normalize();
9464
9465
  }
9465
- /** @return {string} */
9466
9466
  basename() {
9467
9467
  return this.parsha.join('-');
9468
9468
  }
9469
- /** @return {string | undefined} */
9470
9469
  url() {
9471
9470
  const year = this.getDate().greg().getFullYear();
9472
9471
  if (year < 100) {
@@ -9474,10 +9473,11 @@ class ParshaEvent extends Event {
9474
9473
  }
9475
9474
  const dt = this.urlDateSuffix();
9476
9475
  const url = 'https://www.hebcal.com/sedrot/' +
9477
- this.basename().toLowerCase().replace(/'/g, '').replace(/ /g, '-') + '-' + dt;
9476
+ this.basename().toLowerCase().replace(/'/g, '').replace(/ /g, '-') +
9477
+ '-' +
9478
+ dt;
9478
9479
  return this.il ? url + '?i=on' : url;
9479
9480
  }
9480
- /** @return {string} */
9481
9481
  urlDateSuffix() {
9482
9482
  const isoDate = isoDateString(this.getDate().greg());
9483
9483
  return isoDate.replace(/-/g, '');
@@ -9514,13 +9514,13 @@ const YOM_KIPPUR = 'Yom Kippur';
9514
9514
  const EREV_SUKKOT = 'Erev Sukkot';
9515
9515
  const SUKKOT_I = 'Sukkot I';
9516
9516
  const SUKKOT_II = 'Sukkot II';
9517
- const SUKKOT_III_CHM = 'Sukkot III (CH\'\'M)';
9518
- const SUKKOT_IV_CHM = 'Sukkot IV (CH\'\'M)';
9519
- const SUKKOT_V_CHM = 'Sukkot V (CH\'\'M)';
9520
- const SUKKOT_VI_CHM = 'Sukkot VI (CH\'\'M)';
9517
+ const SUKKOT_III_CHM = "Sukkot III (CH''M)";
9518
+ const SUKKOT_IV_CHM = "Sukkot IV (CH''M)";
9519
+ const SUKKOT_V_CHM = "Sukkot V (CH''M)";
9520
+ const SUKKOT_VI_CHM = "Sukkot VI (CH''M)";
9521
9521
  const SHMINI_ATZERET = 'Shmini Atzeret';
9522
9522
  const SIMCHAT_TORAH = 'Simchat Torah';
9523
- const SUKKOT_II_CHM = 'Sukkot II (CH\'\'M)';
9523
+ const SUKKOT_II_CHM = "Sukkot II (CH''M)";
9524
9524
  const SUKKOT_VII_HOSHANA_RABA = 'Sukkot VII (Hoshana Raba)';
9525
9525
  const CHANUKAH_1_CANDLE = 'Chanukah: 1 Candle';
9526
9526
  const TU_BISHVAT = 'Tu BiShvat';
@@ -9530,11 +9530,11 @@ const SHUSHAN_PURIM = 'Shushan Purim';
9530
9530
  const EREV_PESACH = 'Erev Pesach';
9531
9531
  const PESACH_I = 'Pesach I';
9532
9532
  const PESACH_II = 'Pesach II';
9533
- const PESACH_II_CHM = 'Pesach II (CH\'\'M)';
9534
- const PESACH_III_CHM = 'Pesach III (CH\'\'M)';
9535
- const PESACH_IV_CHM = 'Pesach IV (CH\'\'M)';
9536
- const PESACH_V_CHM = 'Pesach V (CH\'\'M)';
9537
- const PESACH_VI_CHM = 'Pesach VI (CH\'\'M)';
9533
+ const PESACH_II_CHM = "Pesach II (CH''M)";
9534
+ const PESACH_III_CHM = "Pesach III (CH''M)";
9535
+ const PESACH_IV_CHM = "Pesach IV (CH''M)";
9536
+ const PESACH_V_CHM = "Pesach V (CH''M)";
9537
+ const PESACH_VI_CHM = "Pesach VI (CH''M)";
9538
9538
  const PESACH_VII = 'Pesach VII';
9539
9539
  const PESACH_VIII = 'Pesach VIII';
9540
9540
  const PESACH_SHENI = 'Pesach Sheni';
@@ -9543,7 +9543,7 @@ const EREV_SHAVUOT = 'Erev Shavuot';
9543
9543
  const SHAVUOT = 'Shavuot';
9544
9544
  const SHAVUOT_I = 'Shavuot I';
9545
9545
  const SHAVUOT_II = 'Shavuot II';
9546
- const TU_BAV = 'Tu B\'Av';
9546
+ const TU_BAV = "Tu B'Av";
9547
9547
  const ROSH_HASHANA_LABEHEMOT = 'Rosh Hashana LaBehemot';
9548
9548
  const EREV_ROSH_HASHANA = 'Erev Rosh Hashana';
9549
9549
  const YOM_YERUSHALAYIM = 'Yom Yerushalayim';
@@ -9563,7 +9563,7 @@ const HEBREW_LANGUAGE_DAY = 'Hebrew Language Day';
9563
9563
  */
9564
9564
  const holidayDesc = {
9565
9565
  /** Asara B'Tevet */
9566
- ASARA_BTEVET: 'Asara B\'Tevet',
9566
+ ASARA_BTEVET: "Asara B'Tevet",
9567
9567
  /** Birkat Hachamah */
9568
9568
  BIRKAT_HACHAMAH: 'Birkat Hachamah',
9569
9569
  /** Chag HaBanot */
@@ -9571,7 +9571,7 @@ const holidayDesc = {
9571
9571
  /** Chanukah: 8th Day */
9572
9572
  CHANUKAH_8TH_DAY: 'Chanukah: 8th Day',
9573
9573
  /** Erev Tish'a B'Av */
9574
- EREV_TISHA_BAV: 'Erev Tish\'a B\'Av',
9574
+ EREV_TISHA_BAV: "Erev Tish'a B'Av",
9575
9575
  /** Leil Selichot */
9576
9576
  LEIL_SELICHOT: 'Leil Selichot',
9577
9577
  /** Purim Katan */
@@ -9599,17 +9599,17 @@ const holidayDesc = {
9599
9599
  /** Shushan Purim Katan */
9600
9600
  SHUSHAN_PURIM_KATAN: 'Shushan Purim Katan',
9601
9601
  /** Ta'anit Bechorot */
9602
- TAANIT_BECHOROT: 'Ta\'anit Bechorot',
9602
+ TAANIT_BECHOROT: "Ta'anit Bechorot",
9603
9603
  /** Ta'anit Esther */
9604
- TAANIT_ESTHER: 'Ta\'anit Esther',
9604
+ TAANIT_ESTHER: "Ta'anit Esther",
9605
9605
  /** Tish'a B'Av */
9606
- TISHA_BAV: 'Tish\'a B\'Av',
9606
+ TISHA_BAV: "Tish'a B'Av",
9607
9607
  /** Tzom Gedaliah */
9608
9608
  TZOM_GEDALIAH: 'Tzom Gedaliah',
9609
9609
  /** Tzom Tammuz */
9610
9610
  TZOM_TAMMUZ: 'Tzom Tammuz',
9611
9611
  /** Yom HaAtzma'ut */
9612
- YOM_HAATZMA_UT: 'Yom HaAtzma\'ut',
9612
+ YOM_HAATZMA_UT: "Yom HaAtzma'ut",
9613
9613
  /** Yom HaShoah */
9614
9614
  YOM_HASHOAH: 'Yom HaShoah',
9615
9615
  /** Yom HaZikaron */
@@ -9712,110 +9712,396 @@ const holidayDesc = {
9712
9712
  YOM_YERUSHALAYIM,
9713
9713
  };
9714
9714
  const staticHolidays = [
9715
- { mm: Tishrei, dd: 2, desc: ROSH_HASHANA_II, flags: CHAG$1 | YOM_TOV_ENDS$1, emoji: '🍏🍯' },
9715
+ {
9716
+ mm: Tishrei,
9717
+ dd: 2,
9718
+ desc: ROSH_HASHANA_II,
9719
+ flags: CHAG$1 | YOM_TOV_ENDS$1,
9720
+ emoji: '🍏🍯',
9721
+ },
9716
9722
  { mm: Tishrei, dd: 9, desc: EREV_YOM_KIPPUR, flags: EREV$2 | LIGHT_CANDLES$1 },
9717
- { mm: Tishrei, dd: 10, desc: YOM_KIPPUR, flags: CHAG$1 | MAJOR_FAST$2 | YOM_TOV_ENDS$1 },
9718
- { mm: Tishrei, dd: 14, desc: EREV_SUKKOT, flags: CHUL_ONLY$1 | EREV$2 | LIGHT_CANDLES$1, emoji: emojiSukkot },
9719
- { mm: Tishrei, dd: 15, desc: SUKKOT_I, flags: CHUL_ONLY$1 | CHAG$1 | LIGHT_CANDLES_TZEIS$2, emoji: emojiSukkot },
9720
- { mm: Tishrei, dd: 16, desc: SUKKOT_II, flags: CHUL_ONLY$1 | CHAG$1 | YOM_TOV_ENDS$1, emoji: emojiSukkot },
9721
- { mm: Tishrei, dd: 17, desc: SUKKOT_III_CHM, flags: CHUL_ONLY$1 | CHOL_HAMOED$1, chmDay: 1, emoji: emojiSukkot },
9722
- { mm: Tishrei, dd: 18, desc: SUKKOT_IV_CHM, flags: CHUL_ONLY$1 | CHOL_HAMOED$1, chmDay: 2, emoji: emojiSukkot },
9723
- { mm: Tishrei, dd: 19, desc: SUKKOT_V_CHM, flags: CHUL_ONLY$1 | CHOL_HAMOED$1, chmDay: 3, emoji: emojiSukkot },
9724
- { mm: Tishrei, dd: 20, desc: SUKKOT_VI_CHM, flags: CHUL_ONLY$1 | CHOL_HAMOED$1, chmDay: 4, emoji: emojiSukkot },
9725
- { mm: Tishrei, dd: 22, desc: SHMINI_ATZERET,
9726
- flags: CHUL_ONLY$1 | CHAG$1 | LIGHT_CANDLES_TZEIS$2 },
9727
- { mm: Tishrei, dd: 23, desc: SIMCHAT_TORAH,
9728
- flags: CHUL_ONLY$1 | CHAG$1 | YOM_TOV_ENDS$1 },
9729
- { mm: Tishrei, dd: 14, desc: EREV_SUKKOT, flags: IL_ONLY$2 | EREV$2 | LIGHT_CANDLES$1, emoji: emojiSukkot },
9730
- { mm: Tishrei, dd: 15, desc: SUKKOT_I, flags: IL_ONLY$2 | CHAG$1 | YOM_TOV_ENDS$1, emoji: emojiSukkot },
9731
- { mm: Tishrei, dd: 16, desc: SUKKOT_II_CHM, flags: IL_ONLY$2 | CHOL_HAMOED$1, chmDay: 1, emoji: emojiSukkot },
9732
- { mm: Tishrei, dd: 17, desc: SUKKOT_III_CHM, flags: IL_ONLY$2 | CHOL_HAMOED$1, chmDay: 2, emoji: emojiSukkot },
9733
- { mm: Tishrei, dd: 18, desc: SUKKOT_IV_CHM, flags: IL_ONLY$2 | CHOL_HAMOED$1, chmDay: 3, emoji: emojiSukkot },
9734
- { mm: Tishrei, dd: 19, desc: SUKKOT_V_CHM, flags: IL_ONLY$2 | CHOL_HAMOED$1, chmDay: 4, emoji: emojiSukkot },
9735
- { mm: Tishrei, dd: 20, desc: SUKKOT_VI_CHM, flags: IL_ONLY$2 | CHOL_HAMOED$1, chmDay: 5, emoji: emojiSukkot },
9736
- { mm: Tishrei, dd: 22, desc: SHMINI_ATZERET,
9737
- flags: IL_ONLY$2 | CHAG$1 | YOM_TOV_ENDS$1 },
9738
- { mm: Tishrei, dd: 21, desc: SUKKOT_VII_HOSHANA_RABA,
9739
- flags: LIGHT_CANDLES$1 | CHOL_HAMOED$1, chmDay: -1, emoji: emojiSukkot },
9740
- { mm: Kislev, dd: 24, desc: CHANUKAH_1_CANDLE,
9741
- flags: EREV$2 | MINOR_HOLIDAY$2 | CHANUKAH_CANDLES$2, emoji: '🕎1️⃣' },
9723
+ {
9724
+ mm: Tishrei,
9725
+ dd: 10,
9726
+ desc: YOM_KIPPUR,
9727
+ flags: CHAG$1 | MAJOR_FAST$2 | YOM_TOV_ENDS$1,
9728
+ },
9729
+ {
9730
+ mm: Tishrei,
9731
+ dd: 14,
9732
+ desc: EREV_SUKKOT,
9733
+ flags: CHUL_ONLY$1 | EREV$2 | LIGHT_CANDLES$1,
9734
+ emoji: emojiSukkot,
9735
+ },
9736
+ {
9737
+ mm: Tishrei,
9738
+ dd: 15,
9739
+ desc: SUKKOT_I,
9740
+ flags: CHUL_ONLY$1 | CHAG$1 | LIGHT_CANDLES_TZEIS$2,
9741
+ emoji: emojiSukkot,
9742
+ },
9743
+ {
9744
+ mm: Tishrei,
9745
+ dd: 16,
9746
+ desc: SUKKOT_II,
9747
+ flags: CHUL_ONLY$1 | CHAG$1 | YOM_TOV_ENDS$1,
9748
+ emoji: emojiSukkot,
9749
+ },
9750
+ {
9751
+ mm: Tishrei,
9752
+ dd: 17,
9753
+ desc: SUKKOT_III_CHM,
9754
+ flags: CHUL_ONLY$1 | CHOL_HAMOED$1,
9755
+ chmDay: 1,
9756
+ emoji: emojiSukkot,
9757
+ },
9758
+ {
9759
+ mm: Tishrei,
9760
+ dd: 18,
9761
+ desc: SUKKOT_IV_CHM,
9762
+ flags: CHUL_ONLY$1 | CHOL_HAMOED$1,
9763
+ chmDay: 2,
9764
+ emoji: emojiSukkot,
9765
+ },
9766
+ {
9767
+ mm: Tishrei,
9768
+ dd: 19,
9769
+ desc: SUKKOT_V_CHM,
9770
+ flags: CHUL_ONLY$1 | CHOL_HAMOED$1,
9771
+ chmDay: 3,
9772
+ emoji: emojiSukkot,
9773
+ },
9774
+ {
9775
+ mm: Tishrei,
9776
+ dd: 20,
9777
+ desc: SUKKOT_VI_CHM,
9778
+ flags: CHUL_ONLY$1 | CHOL_HAMOED$1,
9779
+ chmDay: 4,
9780
+ emoji: emojiSukkot,
9781
+ },
9782
+ {
9783
+ mm: Tishrei,
9784
+ dd: 22,
9785
+ desc: SHMINI_ATZERET,
9786
+ flags: CHUL_ONLY$1 | CHAG$1 | LIGHT_CANDLES_TZEIS$2,
9787
+ },
9788
+ {
9789
+ mm: Tishrei,
9790
+ dd: 23,
9791
+ desc: SIMCHAT_TORAH,
9792
+ flags: CHUL_ONLY$1 | CHAG$1 | YOM_TOV_ENDS$1,
9793
+ },
9794
+ {
9795
+ mm: Tishrei,
9796
+ dd: 14,
9797
+ desc: EREV_SUKKOT,
9798
+ flags: IL_ONLY$2 | EREV$2 | LIGHT_CANDLES$1,
9799
+ emoji: emojiSukkot,
9800
+ },
9801
+ {
9802
+ mm: Tishrei,
9803
+ dd: 15,
9804
+ desc: SUKKOT_I,
9805
+ flags: IL_ONLY$2 | CHAG$1 | YOM_TOV_ENDS$1,
9806
+ emoji: emojiSukkot,
9807
+ },
9808
+ {
9809
+ mm: Tishrei,
9810
+ dd: 16,
9811
+ desc: SUKKOT_II_CHM,
9812
+ flags: IL_ONLY$2 | CHOL_HAMOED$1,
9813
+ chmDay: 1,
9814
+ emoji: emojiSukkot,
9815
+ },
9816
+ {
9817
+ mm: Tishrei,
9818
+ dd: 17,
9819
+ desc: SUKKOT_III_CHM,
9820
+ flags: IL_ONLY$2 | CHOL_HAMOED$1,
9821
+ chmDay: 2,
9822
+ emoji: emojiSukkot,
9823
+ },
9824
+ {
9825
+ mm: Tishrei,
9826
+ dd: 18,
9827
+ desc: SUKKOT_IV_CHM,
9828
+ flags: IL_ONLY$2 | CHOL_HAMOED$1,
9829
+ chmDay: 3,
9830
+ emoji: emojiSukkot,
9831
+ },
9832
+ {
9833
+ mm: Tishrei,
9834
+ dd: 19,
9835
+ desc: SUKKOT_V_CHM,
9836
+ flags: IL_ONLY$2 | CHOL_HAMOED$1,
9837
+ chmDay: 4,
9838
+ emoji: emojiSukkot,
9839
+ },
9840
+ {
9841
+ mm: Tishrei,
9842
+ dd: 20,
9843
+ desc: SUKKOT_VI_CHM,
9844
+ flags: IL_ONLY$2 | CHOL_HAMOED$1,
9845
+ chmDay: 5,
9846
+ emoji: emojiSukkot,
9847
+ },
9848
+ {
9849
+ mm: Tishrei,
9850
+ dd: 22,
9851
+ desc: SHMINI_ATZERET,
9852
+ flags: IL_ONLY$2 | CHAG$1 | YOM_TOV_ENDS$1,
9853
+ },
9854
+ {
9855
+ mm: Tishrei,
9856
+ dd: 21,
9857
+ desc: SUKKOT_VII_HOSHANA_RABA,
9858
+ flags: LIGHT_CANDLES$1 | CHOL_HAMOED$1,
9859
+ chmDay: -1,
9860
+ emoji: emojiSukkot,
9861
+ },
9862
+ {
9863
+ mm: Kislev,
9864
+ dd: 24,
9865
+ desc: CHANUKAH_1_CANDLE,
9866
+ flags: EREV$2 | MINOR_HOLIDAY$2 | CHANUKAH_CANDLES$2,
9867
+ emoji: '🕎1️⃣',
9868
+ },
9742
9869
  { mm: Shvat, dd: 15, desc: TU_BISHVAT, flags: MINOR_HOLIDAY$2, emoji: '🌳' },
9743
- { mm: Adar2, dd: 13, desc: EREV_PURIM, flags: EREV$2 | MINOR_HOLIDAY$2, emoji: '🎭️📜' },
9870
+ {
9871
+ mm: Adar2,
9872
+ dd: 13,
9873
+ desc: EREV_PURIM,
9874
+ flags: EREV$2 | MINOR_HOLIDAY$2,
9875
+ emoji: '🎭️📜',
9876
+ },
9744
9877
  { mm: Adar2, dd: 14, desc: PURIM, flags: MINOR_HOLIDAY$2, emoji: '🎭️📜' },
9745
- { mm: Adar2, dd: 15, desc: SHUSHAN_PURIM, flags: MINOR_HOLIDAY$2, emoji: '🎭️📜' },
9878
+ {
9879
+ mm: Adar2,
9880
+ dd: 15,
9881
+ desc: SHUSHAN_PURIM,
9882
+ flags: MINOR_HOLIDAY$2,
9883
+ emoji: '🎭️📜',
9884
+ },
9746
9885
  // Pesach Israel
9747
- { mm: Nisan, dd: 14, desc: EREV_PESACH,
9748
- flags: IL_ONLY$2 | EREV$2 | LIGHT_CANDLES$1, emoji: '🫓🍷' },
9749
- { mm: Nisan, dd: 15, desc: PESACH_I,
9750
- flags: IL_ONLY$2 | CHAG$1 | YOM_TOV_ENDS$1, emoji: emojiPesach },
9751
- { mm: Nisan, dd: 16, desc: PESACH_II_CHM,
9752
- flags: IL_ONLY$2 | CHOL_HAMOED$1, chmDay: 1, emoji: emojiPesach },
9753
- { mm: Nisan, dd: 17, desc: PESACH_III_CHM,
9754
- flags: IL_ONLY$2 | CHOL_HAMOED$1, chmDay: 2, emoji: emojiPesach },
9755
- { mm: Nisan, dd: 18, desc: PESACH_IV_CHM,
9756
- flags: IL_ONLY$2 | CHOL_HAMOED$1, chmDay: 3, emoji: emojiPesach },
9757
- { mm: Nisan, dd: 19, desc: PESACH_V_CHM,
9758
- flags: IL_ONLY$2 | CHOL_HAMOED$1, chmDay: 4, emoji: emojiPesach },
9759
- { mm: Nisan, dd: 20, desc: PESACH_VI_CHM,
9760
- flags: IL_ONLY$2 | CHOL_HAMOED$1 | LIGHT_CANDLES$1, chmDay: 5, emoji: emojiPesach },
9761
- { mm: Nisan, dd: 21, desc: PESACH_VII,
9762
- flags: IL_ONLY$2 | CHAG$1 | YOM_TOV_ENDS$1, emoji: emojiPesach },
9886
+ {
9887
+ mm: Nisan,
9888
+ dd: 14,
9889
+ desc: EREV_PESACH,
9890
+ flags: IL_ONLY$2 | EREV$2 | LIGHT_CANDLES$1,
9891
+ emoji: '🫓🍷',
9892
+ },
9893
+ {
9894
+ mm: Nisan,
9895
+ dd: 15,
9896
+ desc: PESACH_I,
9897
+ flags: IL_ONLY$2 | CHAG$1 | YOM_TOV_ENDS$1,
9898
+ emoji: emojiPesach,
9899
+ },
9900
+ {
9901
+ mm: Nisan,
9902
+ dd: 16,
9903
+ desc: PESACH_II_CHM,
9904
+ flags: IL_ONLY$2 | CHOL_HAMOED$1,
9905
+ chmDay: 1,
9906
+ emoji: emojiPesach,
9907
+ },
9908
+ {
9909
+ mm: Nisan,
9910
+ dd: 17,
9911
+ desc: PESACH_III_CHM,
9912
+ flags: IL_ONLY$2 | CHOL_HAMOED$1,
9913
+ chmDay: 2,
9914
+ emoji: emojiPesach,
9915
+ },
9916
+ {
9917
+ mm: Nisan,
9918
+ dd: 18,
9919
+ desc: PESACH_IV_CHM,
9920
+ flags: IL_ONLY$2 | CHOL_HAMOED$1,
9921
+ chmDay: 3,
9922
+ emoji: emojiPesach,
9923
+ },
9924
+ {
9925
+ mm: Nisan,
9926
+ dd: 19,
9927
+ desc: PESACH_V_CHM,
9928
+ flags: IL_ONLY$2 | CHOL_HAMOED$1,
9929
+ chmDay: 4,
9930
+ emoji: emojiPesach,
9931
+ },
9932
+ {
9933
+ mm: Nisan,
9934
+ dd: 20,
9935
+ desc: PESACH_VI_CHM,
9936
+ flags: IL_ONLY$2 | CHOL_HAMOED$1 | LIGHT_CANDLES$1,
9937
+ chmDay: 5,
9938
+ emoji: emojiPesach,
9939
+ },
9940
+ {
9941
+ mm: Nisan,
9942
+ dd: 21,
9943
+ desc: PESACH_VII,
9944
+ flags: IL_ONLY$2 | CHAG$1 | YOM_TOV_ENDS$1,
9945
+ emoji: emojiPesach,
9946
+ },
9763
9947
  // Pesach chutz l'aretz
9764
- { mm: Nisan, dd: 14, desc: EREV_PESACH,
9765
- flags: CHUL_ONLY$1 | EREV$2 | LIGHT_CANDLES$1, emoji: '🫓🍷' },
9766
- { mm: Nisan, dd: 15, desc: PESACH_I,
9767
- flags: CHUL_ONLY$1 | CHAG$1 | LIGHT_CANDLES_TZEIS$2, emoji: '🫓🍷' },
9768
- { mm: Nisan, dd: 16, desc: PESACH_II,
9769
- flags: CHUL_ONLY$1 | CHAG$1 | YOM_TOV_ENDS$1, emoji: emojiPesach },
9770
- { mm: Nisan, dd: 17, desc: PESACH_III_CHM,
9771
- flags: CHUL_ONLY$1 | CHOL_HAMOED$1, chmDay: 1, emoji: emojiPesach },
9772
- { mm: Nisan, dd: 18, desc: PESACH_IV_CHM,
9773
- flags: CHUL_ONLY$1 | CHOL_HAMOED$1, chmDay: 2, emoji: emojiPesach },
9774
- { mm: Nisan, dd: 19, desc: PESACH_V_CHM,
9775
- flags: CHUL_ONLY$1 | CHOL_HAMOED$1, chmDay: 3, emoji: emojiPesach },
9776
- { mm: Nisan, dd: 20, desc: PESACH_VI_CHM,
9777
- flags: CHUL_ONLY$1 | CHOL_HAMOED$1 | LIGHT_CANDLES$1, chmDay: 4, emoji: emojiPesach },
9778
- { mm: Nisan, dd: 21, desc: PESACH_VII,
9779
- flags: CHUL_ONLY$1 | CHAG$1 | LIGHT_CANDLES_TZEIS$2, emoji: emojiPesach },
9780
- { mm: Nisan, dd: 22, desc: PESACH_VIII,
9781
- flags: CHUL_ONLY$1 | CHAG$1 | YOM_TOV_ENDS$1, emoji: emojiPesach },
9948
+ {
9949
+ mm: Nisan,
9950
+ dd: 14,
9951
+ desc: EREV_PESACH,
9952
+ flags: CHUL_ONLY$1 | EREV$2 | LIGHT_CANDLES$1,
9953
+ emoji: '🫓🍷',
9954
+ },
9955
+ {
9956
+ mm: Nisan,
9957
+ dd: 15,
9958
+ desc: PESACH_I,
9959
+ flags: CHUL_ONLY$1 | CHAG$1 | LIGHT_CANDLES_TZEIS$2,
9960
+ emoji: '🫓🍷',
9961
+ },
9962
+ {
9963
+ mm: Nisan,
9964
+ dd: 16,
9965
+ desc: PESACH_II,
9966
+ flags: CHUL_ONLY$1 | CHAG$1 | YOM_TOV_ENDS$1,
9967
+ emoji: emojiPesach,
9968
+ },
9969
+ {
9970
+ mm: Nisan,
9971
+ dd: 17,
9972
+ desc: PESACH_III_CHM,
9973
+ flags: CHUL_ONLY$1 | CHOL_HAMOED$1,
9974
+ chmDay: 1,
9975
+ emoji: emojiPesach,
9976
+ },
9977
+ {
9978
+ mm: Nisan,
9979
+ dd: 18,
9980
+ desc: PESACH_IV_CHM,
9981
+ flags: CHUL_ONLY$1 | CHOL_HAMOED$1,
9982
+ chmDay: 2,
9983
+ emoji: emojiPesach,
9984
+ },
9985
+ {
9986
+ mm: Nisan,
9987
+ dd: 19,
9988
+ desc: PESACH_V_CHM,
9989
+ flags: CHUL_ONLY$1 | CHOL_HAMOED$1,
9990
+ chmDay: 3,
9991
+ emoji: emojiPesach,
9992
+ },
9993
+ {
9994
+ mm: Nisan,
9995
+ dd: 20,
9996
+ desc: PESACH_VI_CHM,
9997
+ flags: CHUL_ONLY$1 | CHOL_HAMOED$1 | LIGHT_CANDLES$1,
9998
+ chmDay: 4,
9999
+ emoji: emojiPesach,
10000
+ },
10001
+ {
10002
+ mm: Nisan,
10003
+ dd: 21,
10004
+ desc: PESACH_VII,
10005
+ flags: CHUL_ONLY$1 | CHAG$1 | LIGHT_CANDLES_TZEIS$2,
10006
+ emoji: emojiPesach,
10007
+ },
10008
+ {
10009
+ mm: Nisan,
10010
+ dd: 22,
10011
+ desc: PESACH_VIII,
10012
+ flags: CHUL_ONLY$1 | CHAG$1 | YOM_TOV_ENDS$1,
10013
+ emoji: emojiPesach,
10014
+ },
9782
10015
  { mm: Iyyar, dd: 14, desc: PESACH_SHENI, flags: MINOR_HOLIDAY$2 },
9783
10016
  { mm: Iyyar, dd: 18, desc: LAG_BAOMER, flags: MINOR_HOLIDAY$2, emoji: '🔥' },
9784
- { mm: Sivan, dd: 5, desc: EREV_SHAVUOT,
9785
- flags: EREV$2 | LIGHT_CANDLES$1, emoji: '⛰️🌸' },
9786
- { mm: Sivan, dd: 6, desc: SHAVUOT,
9787
- flags: IL_ONLY$2 | CHAG$1 | YOM_TOV_ENDS$1, emoji: '⛰️🌸' },
9788
- { mm: Sivan, dd: 6, desc: SHAVUOT_I,
9789
- flags: CHUL_ONLY$1 | CHAG$1 | LIGHT_CANDLES_TZEIS$2, emoji: '⛰️🌸' },
9790
- { mm: Sivan, dd: 7, desc: SHAVUOT_II,
9791
- flags: CHUL_ONLY$1 | CHAG$1 | YOM_TOV_ENDS$1, emoji: '⛰️🌸' },
9792
- { mm: Av, dd: 15, desc: TU_BAV,
9793
- flags: MINOR_HOLIDAY$2, emoji: '❤️' },
9794
- { mm: Elul, dd: 1, desc: ROSH_HASHANA_LABEHEMOT,
9795
- flags: MINOR_HOLIDAY$2, emoji: '🐑' },
9796
- { mm: Elul, dd: 29, desc: EREV_ROSH_HASHANA,
9797
- flags: EREV$2 | LIGHT_CANDLES$1, emoji: '🍏🍯' },
10017
+ {
10018
+ mm: Sivan,
10019
+ dd: 5,
10020
+ desc: EREV_SHAVUOT,
10021
+ flags: EREV$2 | LIGHT_CANDLES$1,
10022
+ emoji: '⛰️🌸',
10023
+ },
10024
+ {
10025
+ mm: Sivan,
10026
+ dd: 6,
10027
+ desc: SHAVUOT,
10028
+ flags: IL_ONLY$2 | CHAG$1 | YOM_TOV_ENDS$1,
10029
+ emoji: '⛰️🌸',
10030
+ },
10031
+ {
10032
+ mm: Sivan,
10033
+ dd: 6,
10034
+ desc: SHAVUOT_I,
10035
+ flags: CHUL_ONLY$1 | CHAG$1 | LIGHT_CANDLES_TZEIS$2,
10036
+ emoji: '⛰️🌸',
10037
+ },
10038
+ {
10039
+ mm: Sivan,
10040
+ dd: 7,
10041
+ desc: SHAVUOT_II,
10042
+ flags: CHUL_ONLY$1 | CHAG$1 | YOM_TOV_ENDS$1,
10043
+ emoji: '⛰️🌸',
10044
+ },
10045
+ { mm: Av, dd: 15, desc: TU_BAV, flags: MINOR_HOLIDAY$2, emoji: '❤️' },
10046
+ {
10047
+ mm: Elul,
10048
+ dd: 1,
10049
+ desc: ROSH_HASHANA_LABEHEMOT,
10050
+ flags: MINOR_HOLIDAY$2,
10051
+ emoji: '🐑',
10052
+ },
10053
+ {
10054
+ mm: Elul,
10055
+ dd: 29,
10056
+ desc: EREV_ROSH_HASHANA,
10057
+ flags: EREV$2 | LIGHT_CANDLES$1,
10058
+ emoji: '🍏🍯',
10059
+ },
9798
10060
  ];
9799
10061
  const staticModernHolidays = [
9800
- { firstYear: 5727, mm: Iyyar, dd: 28, desc: YOM_YERUSHALAYIM,
9801
- chul: true },
9802
- { firstYear: 5737, mm: Kislev, dd: 6, desc: BEN_GURION_DAY,
9803
- satPostponeToSun: true, friPostponeToSun: true },
10062
+ { firstYear: 5727, mm: Iyyar, dd: 28, desc: YOM_YERUSHALAYIM, chul: true },
10063
+ {
10064
+ firstYear: 5737,
10065
+ mm: Kislev,
10066
+ dd: 6,
10067
+ desc: BEN_GURION_DAY,
10068
+ satPostponeToSun: true,
10069
+ friPostponeToSun: true,
10070
+ },
9804
10071
  { firstYear: 5750, mm: Shvat, dd: 30, desc: FAMILY_DAY },
9805
- { firstYear: 5758, mm: Cheshvan, dd: 12, desc: YITZHAK_RABIN_MEMORIAL_DAY,
9806
- friSatMovetoThu: true },
9807
- { firstYear: 5764, mm: Iyyar, dd: 10, desc: HERZL_DAY,
9808
- satPostponeToSun: true },
9809
- { firstYear: 5765, mm: Tamuz, dd: 29, desc: JABOTINSKY_DAY,
9810
- satPostponeToSun: true },
9811
- { firstYear: 5769, mm: Cheshvan, dd: 29, desc: SIGD,
9812
- chul: true, suppressEmoji: true },
9813
- { firstYear: 5777, mm: Nisan, dd: 10, desc: YOM_HAALIYAH,
9814
- chul: true },
10072
+ {
10073
+ firstYear: 5758,
10074
+ mm: Cheshvan,
10075
+ dd: 12,
10076
+ desc: YITZHAK_RABIN_MEMORIAL_DAY,
10077
+ friSatMovetoThu: true,
10078
+ },
10079
+ { firstYear: 5764, mm: Iyyar, dd: 10, desc: HERZL_DAY, satPostponeToSun: true },
10080
+ {
10081
+ firstYear: 5765,
10082
+ mm: Tamuz,
10083
+ dd: 29,
10084
+ desc: JABOTINSKY_DAY,
10085
+ satPostponeToSun: true,
10086
+ },
10087
+ {
10088
+ firstYear: 5769,
10089
+ mm: Cheshvan,
10090
+ dd: 29,
10091
+ desc: SIGD,
10092
+ chul: true,
10093
+ suppressEmoji: true,
10094
+ },
10095
+ { firstYear: 5777, mm: Nisan, dd: 10, desc: YOM_HAALIYAH, chul: true },
9815
10096
  { firstYear: 5777, mm: Cheshvan, dd: 7, desc: YOM_HAALIYAH_SCHOOL_OBSERVANCE },
9816
10097
  // https://www.gov.il/he/departments/policies/2012_des5234
9817
- { firstYear: 5773, mm: months.TEVET, dd: 21, desc: HEBREW_LANGUAGE_DAY,
9818
- friSatMovetoThu: true },
10098
+ {
10099
+ firstYear: 5773,
10100
+ mm: months.TEVET,
10101
+ dd: 21,
10102
+ desc: HEBREW_LANGUAGE_DAY,
10103
+ friSatMovetoThu: true,
10104
+ },
9819
10105
  ];
9820
10106
 
9821
10107
  const minorHolidays = [
@@ -9831,9 +10117,9 @@ const minorHolidays = [
9831
10117
  ];
9832
10118
  /** Represents a built-in holiday like Pesach, Purim or Tu BiShvat */
9833
10119
  class HolidayEvent extends Event {
9834
- /** @return {string} */
9835
10120
  basename() {
9836
- return this.getDesc().replace(/ \d{4}$/, '')
10121
+ return this.getDesc()
10122
+ .replace(/ \d{4}$/, '')
9837
10123
  .replace(/ \(CH''M\)$/, '')
9838
10124
  .replace(/ \(observed\)$/, '')
9839
10125
  .replace(/ \(Hoshana Raba\)$/, '')
@@ -9842,23 +10128,21 @@ class HolidayEvent extends Event {
9842
10128
  .replace(/: 8th Day$/, '')
9843
10129
  .replace(/^Erev /, '');
9844
10130
  }
9845
- /** @return {string | undefined} */
9846
10131
  url() {
9847
10132
  const year = this.getDate().greg().getFullYear();
9848
10133
  if (year < 100) {
9849
10134
  return undefined;
9850
10135
  }
9851
10136
  const url = 'https://www.hebcal.com/holidays/' +
9852
- this.basename().toLowerCase().replace(/'/g, '').replace(/ /g, '-') + '-' +
10137
+ this.basename().toLowerCase().replace(/'/g, '').replace(/ /g, '-') +
10138
+ '-' +
9853
10139
  this.urlDateSuffix();
9854
- return (this.getFlags() & flags.IL_ONLY) ? url + '?i=on' : url;
10140
+ return this.getFlags() & flags.IL_ONLY ? url + '?i=on' : url;
9855
10141
  }
9856
- /** @return {string} */
9857
10142
  urlDateSuffix() {
9858
10143
  const year = this.getDate().greg().getFullYear();
9859
10144
  return String(year);
9860
10145
  }
9861
- /** @return {string} */
9862
10146
  getEmoji() {
9863
10147
  if (this.emoji) {
9864
10148
  return this.emoji;
@@ -9870,7 +10154,6 @@ class HolidayEvent extends Event {
9870
10154
  return '✡️';
9871
10155
  }
9872
10156
  }
9873
- /** @return {string[]} */
9874
10157
  getCategories() {
9875
10158
  if (this.cholHaMoedDay) {
9876
10159
  return ['holiday', 'major', 'cholhamoed'];
@@ -9888,8 +10171,7 @@ class HolidayEvent extends Event {
9888
10171
  }
9889
10172
  /**
9890
10173
  * Returns (translated) description of this event
9891
- * @param {string} [locale] Optional locale name (defaults to active locale).
9892
- * @return {string}
10174
+ * @param [locale] Optional locale name (defaults to active locale).
9893
10175
  */
9894
10176
  render(locale) {
9895
10177
  const str = super.render(locale);
@@ -9899,8 +10181,7 @@ class HolidayEvent extends Event {
9899
10181
  * Returns a brief (translated) description of this event.
9900
10182
  * For most events, this is the same as render(). For some events, it procudes
9901
10183
  * a shorter text (e.g. without a time or added description).
9902
- * @param {string} [locale] Optional locale name (defaults to active locale).
9903
- * @return {string}
10184
+ * @param [locale] Optional locale name (defaults to active locale).
9904
10185
  */
9905
10186
  renderBrief(locale) {
9906
10187
  const str = super.renderBrief(locale);
@@ -9908,11 +10189,11 @@ class HolidayEvent extends Event {
9908
10189
  }
9909
10190
  /**
9910
10191
  * Makes a clone of this Event object
9911
- * @return {Event}
9912
10192
  */
9913
10193
  clone() {
9914
10194
  const ev = new HolidayEvent(this.date, this.desc, this.mask);
9915
10195
  for (const property in this) {
10196
+ // eslint-disable-next-line no-prototype-builtins
9916
10197
  if (this.hasOwnProperty(property)) {
9917
10198
  Object.defineProperty(ev, property, { value: this[property] });
9918
10199
  }
@@ -9925,7 +10206,6 @@ class HolidayEvent extends Event {
9925
10206
  * we subclass HolidayEvent to override the `url()` method.
9926
10207
  */
9927
10208
  class AsaraBTevetEvent extends HolidayEvent {
9928
- /** @return {string} */
9929
10209
  urlDateSuffix() {
9930
10210
  const isoDate = isoDateString(this.getDate().greg());
9931
10211
  return isoDate.replace(/-/g, '');
@@ -9935,9 +10215,9 @@ class AsaraBTevetEvent extends HolidayEvent {
9935
10215
  class RoshHashanaEvent extends HolidayEvent {
9936
10216
  /**
9937
10217
  * @private
9938
- * @param {HDate} date Hebrew date event occurs
9939
- * @param {number} hyear Hebrew year
9940
- * @param {number} mask optional holiday flags
10218
+ * @param date Hebrew date event occurs
10219
+ * @param hyear Hebrew year
10220
+ * @param mask optional holiday flags
9941
10221
  */
9942
10222
  constructor(date, hyear, mask) {
9943
10223
  super(date, `Rosh Hashana ${hyear}`, mask);
@@ -9945,13 +10225,11 @@ class RoshHashanaEvent extends HolidayEvent {
9945
10225
  }
9946
10226
  /**
9947
10227
  * Returns (translated) description of this event
9948
- * @param {string} [locale] Optional locale name (defaults to active locale).
9949
- * @return {string}
10228
+ * @param [locale] Optional locale name (defaults to active locale).
9950
10229
  */
9951
10230
  render(locale) {
9952
10231
  return Locale.gettext('Rosh Hashana', locale) + ' ' + this.hyear;
9953
10232
  }
9954
- /** @return {string} */
9955
10233
  getEmoji() {
9956
10234
  return '🍏🍯';
9957
10235
  }
@@ -9961,16 +10239,15 @@ const roshChodeshStr = 'Rosh Chodesh';
9961
10239
  class RoshChodeshEvent extends HolidayEvent {
9962
10240
  /**
9963
10241
  * Constructs Rosh Chodesh event
9964
- * @param {HDate} date Hebrew date event occurs
9965
- * @param {string} monthName Hebrew month name (not translated)
10242
+ * @param date Hebrew date event occurs
10243
+ * @param monthName Hebrew month name (not translated)
9966
10244
  */
9967
10245
  constructor(date, monthName) {
9968
10246
  super(date, `${roshChodeshStr} ${monthName}`, flags.ROSH_CHODESH);
9969
10247
  }
9970
10248
  /**
9971
10249
  * Returns (translated) description of this event
9972
- * @param {string} [locale] Optional locale name (defaults to active locale).
9973
- * @return {string}
10250
+ * @param [locale] Optional locale name (defaults to active locale).
9974
10251
  */
9975
10252
  render(locale) {
9976
10253
  const monthName = this.getDesc().substring(roshChodeshStr.length + 1);
@@ -9978,11 +10255,9 @@ class RoshChodeshEvent extends HolidayEvent {
9978
10255
  const monthName1 = monthName0.replace(/'/g, '’');
9979
10256
  return Locale.gettext(roshChodeshStr, locale) + ' ' + monthName1;
9980
10257
  }
9981
- /** @return {string} */
9982
10258
  basename() {
9983
10259
  return this.getDesc();
9984
10260
  }
9985
- /** @return {string} */
9986
10261
  getEmoji() {
9987
10262
  return this.emoji || '🌒';
9988
10263
  }
@@ -9993,9 +10268,9 @@ const mevarchimChodeshStr = 'Shabbat Mevarchim Chodesh';
9993
10268
  class MevarchimChodeshEvent extends Event {
9994
10269
  /**
9995
10270
  * Constructs Mevarchim haChodesh event
9996
- * @param {HDate} date Hebrew date event occurs
9997
- * @param {string} monthName Hebrew month name (not translated)
9998
- * @param {string} [memo]
10271
+ * @param date Hebrew date event occurs
10272
+ * @param monthName Hebrew month name (not translated)
10273
+ * @param [memo]
9999
10274
  */
10000
10275
  constructor(date, monthName, memo) {
10001
10276
  super(date, `${mevarchimChodeshStr} ${monthName}`, flags.SHABBAT_MEVARCHIM);
@@ -10006,19 +10281,17 @@ class MevarchimChodeshEvent extends Event {
10006
10281
  else {
10007
10282
  const hyear = date.getFullYear();
10008
10283
  const hmonth = date.getMonth();
10009
- const monNext = (hmonth == HDate.monthsInYear(hyear) ? months.NISAN : hmonth + 1);
10284
+ const monNext = hmonth === HDate.monthsInYear(hyear) ? months.NISAN : hmonth + 1;
10010
10285
  const molad = new Molad(hyear, monNext);
10011
10286
  this.memo = molad.render('en', { hour12: false });
10012
10287
  }
10013
10288
  }
10014
- /** @return {string} */
10015
10289
  basename() {
10016
10290
  return this.getDesc();
10017
10291
  }
10018
10292
  /**
10019
10293
  * Returns (translated) description of this event
10020
- * @param {string} [locale] Optional locale name (defaults to active locale).
10021
- * @return {string}
10294
+ * @param [locale] Optional locale name (defaults to active locale).
10022
10295
  */
10023
10296
  render(locale) {
10024
10297
  const monthName0 = Locale.gettext(this.monthName, locale);
@@ -10027,8 +10300,7 @@ class MevarchimChodeshEvent extends Event {
10027
10300
  }
10028
10301
  /**
10029
10302
  * Returns (translated) description of this event
10030
- * @param {string} [locale] Optional locale name (defaults to active locale).
10031
- * @return {string}
10303
+ * @param [locale] Optional locale name (defaults to active locale).
10032
10304
  */
10033
10305
  renderBrief(locale) {
10034
10306
  const str = this.render(locale);
@@ -10047,8 +10319,6 @@ const cals = new Map();
10047
10319
  class DailyLearning {
10048
10320
  /**
10049
10321
  * Register a new learning calendar.
10050
- * @param {string} name
10051
- * @param {Function} calendar
10052
10322
  */
10053
10323
  static addCalendar(name, calendar) {
10054
10324
  if (typeof calendar !== 'function') {
@@ -10059,10 +10329,9 @@ class DailyLearning {
10059
10329
  /**
10060
10330
  * Returns an event from daily calendar for a given date. Returns `null` if there
10061
10331
  * is no learning from this calendar on this date.
10062
- * @param {string} name
10063
- * @param {HDate} hd
10064
- * @param {boolean} il
10065
- * @return {Event | null}
10332
+ * @param name
10333
+ * @param hd
10334
+ * @param il
10066
10335
  */
10067
10336
  static lookup(name, hd, il) {
10068
10337
  const fn = cals.get(name);
@@ -10074,7 +10343,7 @@ class DailyLearning {
10074
10343
  }
10075
10344
 
10076
10345
  /** DO NOT EDIT THIS AUTO-GENERATED FILE! */
10077
- const version = '5.4.7';
10346
+ const version = '5.4.9';
10078
10347
 
10079
10348
  /* eslint-disable max-len */
10080
10349
  /**
@@ -10101,11 +10370,15 @@ function makeCandleEvent(ev, hd, options, isFriday, isSaturday) {
10101
10370
  mask = flags.LIGHT_CANDLES_TZEIS;
10102
10371
  }
10103
10372
  // if offset is 0 or undefined, we'll use tzeit time
10104
- const offset = useHavdalahOffset ? options.havdalahMins : options.candleLightingMins;
10373
+ const offset = useHavdalahOffset
10374
+ ? options.havdalahMins
10375
+ : options.candleLightingMins;
10105
10376
  const location = options.location;
10106
10377
  const useElevation = Boolean(options.useElevation);
10107
10378
  const zmanim = new Zmanim(location, hd, useElevation);
10108
- const time = offset ? zmanim.sunsetOffset(offset, true) : zmanim.tzeit(options.havdalahDeg);
10379
+ const time = offset
10380
+ ? zmanim.sunsetOffset(offset, true)
10381
+ : zmanim.tzeit(options.havdalahDeg);
10109
10382
  if (isNaN(time.getTime())) {
10110
10383
  return undefined; // no sunset
10111
10384
  }
@@ -10134,13 +10407,13 @@ function makeFastStartEnd(ev, options) {
10134
10407
  const fastEndDeg = options.fastEndDeg;
10135
10408
  const useElevation = Boolean(options.useElevation);
10136
10409
  const zmanim = new Zmanim(location, dt, useElevation);
10137
- if (desc === 'Erev Tish\'a B\'Av') {
10410
+ if (desc === "Erev Tish'a B'Av") {
10138
10411
  const sunset = zmanim.sunset();
10139
10412
  if (!isNaN(sunset.getTime())) {
10140
10413
  ev.startEvent = makeTimedEvent(ev, sunset, FAST_BEGINS, options);
10141
10414
  }
10142
10415
  }
10143
- else if (desc.startsWith('Tish\'a B\'Av')) {
10416
+ else if (desc.startsWith("Tish'a B'Av")) {
10144
10417
  const tzeit = zmanim.tzeit(fastEndDeg);
10145
10418
  if (!isNaN(tzeit.getTime())) {
10146
10419
  ev.endEvent = makeTimedEvent(ev, tzeit, FAST_ENDS, options);
@@ -10151,7 +10424,8 @@ function makeFastStartEnd(ev, options) {
10151
10424
  if (!isNaN(dawn.getTime())) {
10152
10425
  ev.startEvent = makeTimedEvent(ev, dawn, FAST_BEGINS, options);
10153
10426
  }
10154
- if (dt.getDay() !== 5 && !(hd.getDate() === 14 && hd.getMonth() === months.NISAN)) {
10427
+ if (dt.getDay() !== 5 &&
10428
+ !(hd.getDate() === 14 && hd.getMonth() === months.NISAN)) {
10155
10429
  const tzeit = zmanim.tzeit(fastEndDeg);
10156
10430
  if (!isNaN(tzeit.getTime())) {
10157
10431
  ev.endEvent = makeTimedEvent(ev, tzeit, FAST_ENDS, options);
@@ -10202,34 +10476,39 @@ const HALF = 1;
10202
10476
  const WHOLE = 2;
10203
10477
  /**
10204
10478
  * @private
10205
- * @param {Event[]} events
10206
- * @param {HDate} hdate
10207
- * @return {number}
10208
10479
  */
10209
10480
  function hallel_(events, hdate) {
10210
- const whole = events.filter((ev) => {
10481
+ const whole = events
10482
+ .filter(ev => {
10211
10483
  const desc = ev.getDesc();
10212
10484
  const hd = ev.getDate();
10213
10485
  const month = hd.getMonth();
10214
10486
  const mday = hd.getDate();
10215
- return desc.startsWith('Chanukah') ||
10487
+ return (desc.startsWith('Chanukah') ||
10216
10488
  desc.startsWith('Shavuot') ||
10217
10489
  desc.startsWith('Sukkot') ||
10218
- (month === months.NISAN && (mday === 15 || mday === 16) && (ev.getFlags() & flags.CHAG)) || // Pesach
10219
- desc === 'Yom HaAtzma\'ut' ||
10220
- desc === 'Yom Yerushalayim';
10221
- }).map((ev) => {
10490
+ (month === months.NISAN &&
10491
+ (mday === 15 || mday === 16) &&
10492
+ ev.getFlags() & flags.CHAG) || // Pesach
10493
+ desc === "Yom HaAtzma'ut" ||
10494
+ desc === 'Yom Yerushalayim');
10495
+ })
10496
+ .map(ev => {
10222
10497
  return ev.getDate().abs();
10223
10498
  });
10224
10499
  const abs = hdate.abs();
10225
10500
  if (whole.includes(abs)) {
10226
10501
  return WHOLE;
10227
10502
  }
10228
- const half = events.filter((ev) => {
10503
+ const half = events
10504
+ .filter(ev => {
10229
10505
  const desc = ev.getDesc();
10230
- return ev.getFlags() & flags.ROSH_CHODESH ||
10231
- (desc.startsWith('Pesach') && desc !== 'Pesach I' && desc !== 'Pesach II');
10232
- }).map((ev) => {
10506
+ return (ev.getFlags() & flags.ROSH_CHODESH ||
10507
+ (desc.startsWith('Pesach') &&
10508
+ desc !== 'Pesach I' &&
10509
+ desc !== 'Pesach II'));
10510
+ })
10511
+ .map(ev => {
10233
10512
  return ev.getDate().abs();
10234
10513
  });
10235
10514
  if (half.includes(abs)) {
@@ -10252,8 +10531,7 @@ const IYYAR = months.IYYAR;
10252
10531
  * on the following Monday.
10253
10532
  * http://www.ushmm.org/remembrance/dor/calendar/
10254
10533
  * @private
10255
- * @param {number} year
10256
- * @return {HDate|null}
10534
+ * @param year
10257
10535
  */
10258
10536
  function dateYomHaShoah(year) {
10259
10537
  if (year < 5711) {
@@ -10271,8 +10549,7 @@ function dateYomHaShoah(year) {
10271
10549
  /**
10272
10550
  * Yom HaAtzma'ut only celebrated after 1948
10273
10551
  * @private
10274
- * @param {number} year
10275
- * @return {HDate|null}
10552
+ * @param year
10276
10553
  */
10277
10554
  function dateYomHaZikaron(year) {
10278
10555
  if (year < 5708) {
@@ -10304,21 +10581,19 @@ const ykk = 'Yom Kippur Katan';
10304
10581
  class YomKippurKatanEvent extends HolidayEvent {
10305
10582
  /**
10306
10583
  * @private
10307
- * @param {HDate} date Hebrew date event occurs
10308
- * @param {string} nextMonthName name of the upcoming month
10584
+ * @param date Hebrew date event occurs
10585
+ * @param nextMonthName name of the upcoming month
10309
10586
  */
10310
10587
  constructor(date, nextMonthName) {
10311
10588
  super(date, `${ykk} ${nextMonthName}`, flags.MINOR_FAST | flags.YOM_KIPPUR_KATAN);
10312
10589
  this.nextMonthName = nextMonthName;
10313
10590
  this.memo = `Minor Day of Atonement on the day preceeding Rosh Chodesh ${nextMonthName}`;
10314
10591
  }
10315
- /** @return {string} */
10316
10592
  basename() {
10317
10593
  return this.getDesc();
10318
10594
  }
10319
10595
  /**
10320
- * @param {string} [locale] Optional locale name (defaults to active locale).
10321
- * @return {string}
10596
+ * @param [locale] Optional locale name (defaults to active locale).
10322
10597
  */
10323
10598
  render(locale) {
10324
10599
  const monthName0 = Locale.gettext(this.nextMonthName, locale);
@@ -10326,13 +10601,11 @@ class YomKippurKatanEvent extends HolidayEvent {
10326
10601
  return Locale.gettext(ykk, locale) + ' ' + monthName;
10327
10602
  }
10328
10603
  /**
10329
- * @param {string} [locale] Optional locale name (defaults to active locale).
10330
- * @return {string}
10604
+ * @param [locale] Optional locale name (defaults to active locale).
10331
10605
  */
10332
10606
  renderBrief(locale) {
10333
10607
  return Locale.gettext(ykk, locale);
10334
10608
  }
10335
- /** @return {string | undefined} */
10336
10609
  url() {
10337
10610
  return undefined;
10338
10611
  }
@@ -10385,8 +10658,16 @@ const emojiIsraelFlag = { emoji: '🇮🇱' };
10385
10658
  const chanukahEmoji = '🕎';
10386
10659
  const yearCache = new QuickLRU({ maxSize: 400 });
10387
10660
  const KEYCAP_DIGITS = [
10388
- '0️⃣', '1️⃣', '2️⃣', '3️⃣', '4️⃣',
10389
- '5️⃣', '6️⃣', '7️⃣', '8️⃣', '9️⃣',
10661
+ '0️⃣',
10662
+ '1️⃣',
10663
+ '2️⃣',
10664
+ '3️⃣',
10665
+ '4️⃣',
10666
+ '5️⃣',
10667
+ '6️⃣',
10668
+ '7️⃣',
10669
+ '8️⃣',
10670
+ '9️⃣',
10390
10671
  ];
10391
10672
  /**
10392
10673
  * Lower-level holidays interface, which returns a `Map` of `Event`s indexed by
@@ -10441,14 +10722,18 @@ function getHolidaysForYear_(year) {
10441
10722
  add(new HolidayEvent(new HDate(tzomGedaliahDay, TISHREI$2, year), holidayDesc.TZOM_GEDALIAH, MINOR_FAST$1));
10442
10723
  // first SAT after RH
10443
10724
  add(new HolidayEvent(new HDate(HDate.dayOnOrBefore(SAT$1, 7 + RH.abs())), holidayDesc.SHABBAT_SHUVA, SPECIAL_SHABBAT$1));
10444
- const rchTevet = HDate.shortKislev(year) ?
10445
- new HDate(1, TEVET, year) : new HDate(30, KISLEV, year);
10725
+ const rchTevet = HDate.shortKislev(year)
10726
+ ? new HDate(1, TEVET, year)
10727
+ : new HDate(30, KISLEV, year);
10446
10728
  add(new HolidayEvent(rchTevet, holidayDesc.CHAG_HABANOT, MINOR_HOLIDAY$1));
10447
10729
  // yes, we know Kislev 30-32 are wrong
10448
10730
  // HDate() corrects the month automatically
10449
10731
  for (let candles = 2; candles <= 8; candles++) {
10450
10732
  const hd = new HDate(23 + candles, KISLEV, year);
10451
- add(new HolidayEvent(hd, `Chanukah: ${candles} Candles`, MINOR_HOLIDAY$1 | CHANUKAH_CANDLES$1, { chanukahDay: candles - 1, emoji: chanukahEmoji + KEYCAP_DIGITS[candles] }));
10733
+ add(new HolidayEvent(hd, `Chanukah: ${candles} Candles`, MINOR_HOLIDAY$1 | CHANUKAH_CANDLES$1, {
10734
+ chanukahDay: candles - 1,
10735
+ emoji: chanukahEmoji + KEYCAP_DIGITS[candles],
10736
+ }));
10452
10737
  }
10453
10738
  add(new HolidayEvent(new HDate(32, KISLEV, year), holidayDesc.CHANUKAH_8TH_DAY, MINOR_HOLIDAY$1, { chanukahDay: 8, emoji: chanukahEmoji }));
10454
10739
  add(new AsaraBTevetEvent(new HDate(10, TEVET, year), holidayDesc.ASARA_BTEVET, MINOR_FAST$1));
@@ -10457,9 +10742,9 @@ function getHolidaysForYear_(year) {
10457
10742
  const haChodeshAbs = HDate.dayOnOrBefore(SAT$1, pesachAbs - 14);
10458
10743
  add(new HolidayEvent(new HDate(haChodeshAbs - 7), holidayDesc.SHABBAT_PARAH, SPECIAL_SHABBAT$1), new HolidayEvent(new HDate(haChodeshAbs), holidayDesc.SHABBAT_HACHODESH, SPECIAL_SHABBAT$1), new HolidayEvent(new HDate(HDate.dayOnOrBefore(SAT$1, pesachAbs - 1)), holidayDesc.SHABBAT_HAGADOL, SPECIAL_SHABBAT$1), new HolidayEvent(
10459
10744
  // if the fast falls on Shabbat, move to Thursday
10460
- pesach.prev().getDay() === SAT$1 ?
10461
- pesach.onOrBefore(THU) :
10462
- new HDate(14, NISAN$1, year), holidayDesc.TAANIT_BECHOROT, MINOR_FAST$1));
10745
+ pesach.prev().getDay() === SAT$1
10746
+ ? pesach.onOrBefore(THU)
10747
+ : new HDate(14, NISAN$1, year), holidayDesc.TAANIT_BECHOROT, MINOR_FAST$1));
10463
10748
  add(new HolidayEvent(new HDate(HDate.dayOnOrBefore(SAT$1, new HDate(1, TISHREI$2, year + 1).abs() - 4)), holidayDesc.LEIL_SELICHOT, MINOR_HOLIDAY$1, { emoji: '🕍' }));
10464
10749
  if (pesach.getDay() === SUN) {
10465
10750
  add(new HolidayEvent(new HDate(16, ADAR_II, year), holidayDesc.PURIM_MESHULASH, MINOR_HOLIDAY$1));
@@ -10489,7 +10774,7 @@ function getHolidaysForYear_(year) {
10489
10774
  else if (h.satPostponeToSun && dow === SAT$1) {
10490
10775
  hd = hd.next();
10491
10776
  }
10492
- const mask = h.chul ? MODERN_HOLIDAY$1 : (MODERN_HOLIDAY$1 | IL_ONLY$1);
10777
+ const mask = h.chul ? MODERN_HOLIDAY$1 : MODERN_HOLIDAY$1 | IL_ONLY$1;
10493
10778
  const ev = new HolidayEvent(hd, h.desc, mask);
10494
10779
  if (!h.suppressEmoji) {
10495
10780
  ev.emoji = '🇮🇱';
@@ -10517,9 +10802,9 @@ function getHolidaysForYear_(year) {
10517
10802
  const monthsInYear = HDate.monthsInYear(year);
10518
10803
  for (let month = 1; month <= monthsInYear; month++) {
10519
10804
  const monthName = HDate.getMonthName(month, year);
10520
- if ((month === NISAN$1 ?
10521
- HDate.daysInMonth(HDate.monthsInYear(year - 1), year - 1) :
10522
- HDate.daysInMonth(month - 1, year)) === 30) {
10805
+ if ((month === NISAN$1
10806
+ ? HDate.daysInMonth(HDate.monthsInYear(year - 1), year - 1)
10807
+ : HDate.daysInMonth(month - 1, year)) === 30) {
10523
10808
  add(new RoshChodeshEvent(new HDate(1, month, year), monthName));
10524
10809
  add(new RoshChodeshEvent(new HDate(30, month - 1, year), monthName));
10525
10810
  }
@@ -10534,7 +10819,9 @@ function getHolidaysForYear_(year) {
10534
10819
  // Yom Kippur Katan is not observed on the day before Rosh Hashanah.
10535
10820
  // Not observed prior to Rosh Chodesh Cheshvan because Yom Kippur has just passed.
10536
10821
  // Not observed before Rosh Chodesh Tevet, because that day is Hanukkah.
10537
- if (nextMonth === TISHREI$2 || nextMonth === months.CHESHVAN || nextMonth === TEVET) {
10822
+ if (nextMonth === TISHREI$2 ||
10823
+ nextMonth === months.CHESHVAN ||
10824
+ nextMonth === TEVET) {
10538
10825
  continue;
10539
10826
  }
10540
10827
  let ykk = new HDate(29, month, year);
@@ -10623,7 +10910,7 @@ function tachanun0(hdate, il, checkNext) {
10623
10910
  ret.mincha = tmp.shacharit;
10624
10911
  }
10625
10912
  else {
10626
- ret.mincha = (dow !== 5);
10913
+ ret.mincha = dow !== 5;
10627
10914
  }
10628
10915
  if (ret.allCongs && !ret.mincha && !ret.shacharit) {
10629
10916
  return NONE;
@@ -10645,37 +10932,31 @@ function tachanunYear(year, il) {
10645
10932
  new HDate(2, months.TISHREI, year), // Rosh Hashana II
10646
10933
  ].concat(
10647
10934
  // Rosh Chodesh - 1st of every month. Also includes RH day 1 (1 Tishrei)
10648
- range(1, monthsInYear)
10649
- .map((month) => new HDate(1, month, year)),
10935
+ range(1, monthsInYear).map(month => new HDate(1, month, year)),
10650
10936
  // Rosh Chodesh - 30th of months that have one
10651
10937
  range(1, monthsInYear)
10652
- .filter((month) => HDate.daysInMonth(month, year) === 30)
10653
- .map((month) => new HDate(30, month, year)),
10938
+ .filter(month => HDate.daysInMonth(month, year) === 30)
10939
+ .map(month => new HDate(30, month, year)),
10654
10940
  // entire month of Nisan
10655
- range(1, HDate.daysInMonth(months.NISAN, year))
10656
- .map((mday) => new HDate(mday, months.NISAN, year)), new HDate(18, months.IYYAR, year), // Lag BaOmer
10941
+ range(1, HDate.daysInMonth(months.NISAN, year)).map(mday => new HDate(mday, months.NISAN, year)), new HDate(18, months.IYYAR, year), // Lag BaOmer
10657
10942
  // Rosh Chodesh Sivan thru Isru Chag
10658
- range(1, 8 - (il ? 1 : 0))
10659
- .map((mday) => new HDate(mday, months.SIVAN, year)), av9dt, // Tisha B'Av
10943
+ range(1, 8 - (il ? 1 : 0)).map(mday => new HDate(mday, months.SIVAN, year)), av9dt, // Tisha B'Av
10660
10944
  new HDate(15, months.AV, year), // Tu B'Av
10661
10945
  new HDate(29, months.ELUL, year), // Erev Rosh Hashanah
10662
10946
  // Erev Yom Kippur thru Isru Chag
10663
- range(9, 24 - (il ? 1 : 0))
10664
- .map((mday) => new HDate(mday, months.TISHREI, year)),
10947
+ range(9, 24 - (il ? 1 : 0)).map(mday => new HDate(mday, months.TISHREI, year)),
10665
10948
  // Chanukah
10666
- range(25, 33)
10667
- .map((mday) => new HDate(mday, months.KISLEV, year)), new HDate(15, months.SHVAT, year), // Tu BiShvat
10949
+ range(25, 33).map(mday => new HDate(mday, months.KISLEV, year)), new HDate(15, months.SHVAT, year), // Tu BiShvat
10668
10950
  new HDate(14, months.ADAR_II, year), // Purim
10669
- shushPurim, leap ? new HDate(14, months.ADAR_I, year) : []);
10951
+ shushPurim, leap ? new HDate(14, months.ADAR_I, year) : [] // Purim Katan
10952
+ );
10670
10953
  const some = [
10671
10954
  new HDate(14, months.IYYAR, year), // Pesach Sheini
10672
10955
  ].concat(
10673
10956
  // Until 14 Sivan
10674
- range(1, 13)
10675
- .map((mday) => new HDate(mday, months.SIVAN, year)),
10957
+ range(1, 13).map(mday => new HDate(mday, months.SIVAN, year)),
10676
10958
  // Until after Rosh Chodesh Cheshvan
10677
- range(20, 31)
10678
- .map((mday) => new HDate(mday, months.TISHREI, year)),
10959
+ range(20, 31).map(mday => new HDate(mday, months.TISHREI, year)),
10679
10960
  // Yom HaAtzma'ut, which changes based on day of week
10680
10961
  year >= 5708 ? dateYomHaZikaron(year).next() : [],
10681
10962
  // Yom Yerushalayim
@@ -10686,9 +10967,9 @@ function tachanunYear(year, il) {
10686
10967
  new HDate(14, months.IYYAR, year), // Pesach Sheini
10687
10968
  ];
10688
10969
  return {
10689
- none: none.map((hd) => hd.abs()).sort((a, b) => a - b),
10690
- some: some.map((hd) => hd.abs()).sort((a, b) => a - b),
10691
- yesPrev: yesPrev.map((hd) => hd.abs()).sort((a, b) => a - b),
10970
+ none: none.map(hd => hd.abs()).sort((a, b) => a - b),
10971
+ some: some.map(hd => hd.abs()).sort((a, b) => a - b),
10972
+ yesPrev: yesPrev.map(hd => hd.abs()).sort((a, b) => a - b),
10692
10973
  };
10693
10974
  }
10694
10975
 
@@ -10698,10 +10979,10 @@ const TISHREI$1 = months.TISHREI;
10698
10979
  * @private
10699
10980
  */
10700
10981
  function getAbs(d) {
10701
- if (typeof d == 'number')
10982
+ if (typeof d === 'number')
10702
10983
  return d;
10703
- if (exports.greg.isDate(d))
10704
- return exports.greg.greg2abs(d);
10984
+ if (isDate(d))
10985
+ return greg2abs(d);
10705
10986
  if (HDate.isHDate(d))
10706
10987
  return d.abs();
10707
10988
  throw new TypeError(`Invalid date type: ${d}`);
@@ -10710,8 +10991,9 @@ function getYear(options) {
10710
10991
  if (typeof options.year !== 'undefined') {
10711
10992
  return Number(options.year);
10712
10993
  }
10713
- return options.isHebrewYear ? new HDate().getFullYear() :
10714
- new Date().getFullYear();
10994
+ return options.isHebrewYear
10995
+ ? new HDate().getFullYear()
10996
+ : new Date().getFullYear();
10715
10997
  }
10716
10998
  /**
10717
10999
  * Parse options object to determine start & end days
@@ -10758,10 +11040,10 @@ function startEndGregorian(theMonth, theYear, numYears) {
10758
11040
  if (theYear < 100) {
10759
11041
  startGreg.setFullYear(theYear);
10760
11042
  }
10761
- const startAbs = exports.greg.greg2abs(startGreg);
11043
+ const startAbs = greg2abs(startGreg);
10762
11044
  let endAbs;
10763
11045
  if (theMonth) {
10764
- endAbs = startAbs + exports.greg.daysInMonth(theMonth, theYear) - 1;
11046
+ endAbs = startAbs + daysInGregMonth(theMonth, theYear) - 1;
10765
11047
  }
10766
11048
  else {
10767
11049
  const endYear = theYear + numYears;
@@ -10769,16 +11051,16 @@ function startEndGregorian(theMonth, theYear, numYears) {
10769
11051
  if (endYear < 100) {
10770
11052
  endGreg.setFullYear(endYear);
10771
11053
  }
10772
- endAbs = exports.greg.greg2abs(endGreg) - 1;
11054
+ endAbs = greg2abs(endGreg) - 1;
10773
11055
  }
10774
11056
  return [startAbs, endAbs];
10775
11057
  }
10776
11058
  function startEndHebrew(theMonth, theYear, numYears) {
10777
11059
  const startDate = new HDate(1, theMonth || TISHREI$1, theYear);
10778
11060
  let startAbs = startDate.abs();
10779
- const endAbs = theMonth ?
10780
- startAbs + startDate.daysInMonth() :
10781
- new HDate(1, TISHREI$1, theYear + numYears).abs() - 1;
11061
+ const endAbs = theMonth
11062
+ ? startAbs + startDate.daysInMonth()
11063
+ : new HDate(1, TISHREI$1, theYear + numYears).abs() - 1;
10782
11064
  // for full Hebrew year, start on Erev Rosh Hashana which
10783
11065
  // is technically in the previous Hebrew year
10784
11066
  // (but conveniently lets us get candle-lighting time for Erev)
@@ -10876,19 +11158,20 @@ const RECOGNIZED_OPTIONS = {
10876
11158
  */
10877
11159
  function warnUnrecognizedOptions(options) {
10878
11160
  for (const k of Object.keys(options)) {
10879
- if (typeof RECOGNIZED_OPTIONS[k] === 'undefined' && !unrecognizedAlreadyWarned.has(k)) {
11161
+ if (typeof RECOGNIZED_OPTIONS[k] === 'undefined' &&
11162
+ !unrecognizedAlreadyWarned.has(k)) {
10880
11163
  console.warn(`Ignoring unrecognized HebrewCalendar option: ${k}`);
10881
11164
  unrecognizedAlreadyWarned.add(k);
10882
11165
  }
10883
11166
  }
10884
11167
  }
10885
11168
  const israelCityOffset = {
10886
- 'Jerusalem': 40,
10887
- 'Haifa': 30,
10888
- 'Zikhron Ya\'aqov': 30,
10889
- 'Zikhron Ya\'akov': 30,
11169
+ Jerusalem: 40,
11170
+ Haifa: 30,
11171
+ "Zikhron Ya'aqov": 30,
11172
+ "Zikhron Ya'akov": 30,
10890
11173
  'Zikhron Yaakov': 30,
10891
- 'Zichron Ya\'akov': 30,
11174
+ "Zichron Ya'akov": 30,
10892
11175
  'Zichron Yaakov': 30,
10893
11176
  };
10894
11177
  const geoIdCandleOffset = {
@@ -10918,7 +11201,6 @@ const TZEIT_3MEDIUM_STARS = 7.0833333;
10918
11201
  /**
10919
11202
  * Modifies options in-place
10920
11203
  * @private
10921
- * @param {CalOptions} options
10922
11204
  */
10923
11205
  function checkCandleOptions(options) {
10924
11206
  if (!options.candlelighting) {
@@ -10928,7 +11210,8 @@ function checkCandleOptions(options) {
10928
11210
  if (typeof location === 'undefined' || !(location instanceof Location)) {
10929
11211
  throw new TypeError('options.candlelighting requires valid options.location');
10930
11212
  }
10931
- if (typeof options.havdalahMins === 'number' && typeof options.havdalahDeg === 'number') {
11213
+ if (typeof options.havdalahMins === 'number' &&
11214
+ typeof options.havdalahDeg === 'number') {
10932
11215
  throw new TypeError('options.havdalahMins and options.havdalahDeg are mutually exclusive');
10933
11216
  }
10934
11217
  let min = Number(options.candleLightingMins) || 18;
@@ -10969,8 +11252,6 @@ function overrideIsraelCandleMins(location, min) {
10969
11252
  /**
10970
11253
  * Mask to filter Holiday array
10971
11254
  * @private
10972
- * @param {CalOptions} options
10973
- * @return {number}
10974
11255
  */
10975
11256
  function getMaskFromOptions(options) {
10976
11257
  var _a;
@@ -10981,9 +11262,19 @@ function getMaskFromOptions(options) {
10981
11262
  let mask = 0;
10982
11263
  // default options
10983
11264
  if (!options.noHolidays) {
10984
- mask |= ROSH_CHODESH | YOM_TOV_ENDS | MINOR_FAST | SPECIAL_SHABBAT | MODERN_HOLIDAY | MAJOR_FAST |
10985
- MINOR_HOLIDAY | EREV | CHOL_HAMOED |
10986
- LIGHT_CANDLES | LIGHT_CANDLES_TZEIS | CHANUKAH_CANDLES;
11265
+ mask |=
11266
+ ROSH_CHODESH |
11267
+ YOM_TOV_ENDS |
11268
+ MINOR_FAST |
11269
+ SPECIAL_SHABBAT |
11270
+ MODERN_HOLIDAY |
11271
+ MAJOR_FAST |
11272
+ MINOR_HOLIDAY |
11273
+ EREV |
11274
+ CHOL_HAMOED |
11275
+ LIGHT_CANDLES |
11276
+ LIGHT_CANDLES_TZEIS |
11277
+ CHANUKAH_CANDLES;
10987
11278
  }
10988
11279
  if (options.candlelighting) {
10989
11280
  mask |= LIGHT_CANDLES | LIGHT_CANDLES_TZEIS | YOM_TOV_ENDS;
@@ -11038,15 +11329,10 @@ function getMaskFromOptions(options) {
11038
11329
  }
11039
11330
  return mask;
11040
11331
  }
11041
- const MASK_LIGHT_CANDLES = LIGHT_CANDLES |
11042
- LIGHT_CANDLES_TZEIS |
11043
- CHANUKAH_CANDLES |
11044
- YOM_TOV_ENDS;
11332
+ const MASK_LIGHT_CANDLES = LIGHT_CANDLES | LIGHT_CANDLES_TZEIS | CHANUKAH_CANDLES | YOM_TOV_ENDS;
11045
11333
  const defaultLocation = new Location(0, 0, false, 'UTC');
11046
11334
  /**
11047
11335
  * @private
11048
- * @param {CalOptions} options
11049
- * @return {number}
11050
11336
  */
11051
11337
  function setOptionsFromMask(options) {
11052
11338
  const m = options.mask || 0;
@@ -11085,16 +11371,12 @@ function setOptionsFromMask(options) {
11085
11371
  }
11086
11372
  /**
11087
11373
  * @private
11088
- * @param {Event} ev
11089
- * @return {boolean}
11090
11374
  */
11091
11375
  function observedInIsrael(ev) {
11092
11376
  return ev.observedInIsrael();
11093
11377
  }
11094
11378
  /**
11095
11379
  * @private
11096
- * @param {Event} ev
11097
- * @return {boolean}
11098
11380
  */
11099
11381
  function observedInDiaspora(ev) {
11100
11382
  return ev.observedInDiaspora();
@@ -11212,21 +11494,21 @@ class HebrewCalendar {
11212
11494
  * const date = hd.greg();
11213
11495
  * console.log(date.toLocaleDateString(), ev.render('en'), hd.toString());
11214
11496
  * }
11215
- * @param {CalOptions} [options={}]
11216
- * @return {Event[]}
11217
11497
  */
11218
11498
  static calendar(options = {}) {
11219
11499
  options = Object.assign({}, options); // so we can modify freely
11220
11500
  checkCandleOptions(options);
11221
- const location = options.location = options.location || defaultLocation;
11222
- const il = options.il = options.il || location.getIsrael() || false;
11501
+ const location = (options.location = options.location || defaultLocation);
11502
+ const il = (options.il = options.il || location.getIsrael() || false);
11223
11503
  const hasUserMask = typeof options.mask === 'number';
11224
11504
  options.mask = getMaskFromOptions(options);
11225
11505
  if (options.ashkenazi || options.locale) {
11226
11506
  if (options.locale && typeof options.locale !== 'string') {
11227
11507
  throw new TypeError(`Invalid options.locale: ${options.locale}`);
11228
11508
  }
11229
- const locale = options.ashkenazi ? 'ashkenazi' : options.locale;
11509
+ const locale = options.ashkenazi
11510
+ ? 'ashkenazi'
11511
+ : options.locale;
11230
11512
  const translationObj = Locale.useLocale(locale);
11231
11513
  if (!translationObj) {
11232
11514
  throw new TypeError(`Locale '${locale}' not found; did you forget to import @hebcal/locales?`);
@@ -11245,14 +11527,14 @@ class HebrewCalendar {
11245
11527
  warnUnrecognizedOptions(options);
11246
11528
  const startAbs = startAndEnd[0];
11247
11529
  const endAbs = startAndEnd[1];
11248
- const startGreg = exports.greg.abs2greg(startAbs);
11530
+ const startGreg = abs2greg(startAbs);
11249
11531
  if (startGreg.getFullYear() < 100) {
11250
11532
  options.candlelighting = false;
11251
11533
  }
11252
11534
  for (let abs = startAbs; abs <= endAbs; abs++) {
11253
11535
  const hd = new HDate(abs);
11254
11536
  const hyear = hd.getFullYear();
11255
- if (hyear != currentYear) {
11537
+ if (hyear !== currentYear) {
11256
11538
  currentYear = hyear;
11257
11539
  holidaysYear = getHolidaysForYear_(currentYear);
11258
11540
  if (options.sedrot) {
@@ -11299,16 +11581,17 @@ class HebrewCalendar {
11299
11581
  }
11300
11582
  }
11301
11583
  // suppress Havdalah when options.havdalahMins=0 or options.havdalahDeg=0
11302
- if (candlesEv instanceof HavdalahEvent && (options.havdalahMins === 0 || options.havdalahDeg === 0)) {
11584
+ if (candlesEv instanceof HavdalahEvent &&
11585
+ (options.havdalahMins === 0 || options.havdalahDeg === 0)) {
11303
11586
  candlesEv = undefined;
11304
11587
  }
11305
11588
  if (candlesEv) {
11306
11589
  evts.push(candlesEv);
11307
11590
  }
11308
11591
  if (options.addHebrewDates ||
11309
- (options.addHebrewDatesForEvents && prevEventsLength != evts.length)) {
11592
+ (options.addHebrewDatesForEvents && prevEventsLength !== evts.length)) {
11310
11593
  const e2 = new HebrewDateEvent(hd);
11311
- if (prevEventsLength == evts.length) {
11594
+ if (prevEventsLength === evts.length) {
11312
11595
  evts.push(e2);
11313
11596
  }
11314
11597
  else {
@@ -11340,9 +11623,9 @@ class HebrewCalendar {
11340
11623
  * const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'
11341
11624
  * const hd = HebrewCalendar.getBirthdayOrAnniversary(5780, dt); // '1 Nisan 5780'
11342
11625
  * console.log(hd.greg().toLocaleDateString('en-US')); // '3/26/2020'
11343
- * @param {number} hyear Hebrew year
11344
- * @param {Date|HDate} gdate Gregorian or Hebrew date of event
11345
- * @return {HDate | undefined} anniversary occurring in `hyear`
11626
+ * @param hyear Hebrew year
11627
+ * @param gdate Gregorian or Hebrew date of event
11628
+ * @returns anniversary occurring in `hyear`
11346
11629
  */
11347
11630
  static getBirthdayOrAnniversary(hyear, gdate) {
11348
11631
  const dt = getBirthdayHD(hyear, gdate);
@@ -11381,9 +11664,9 @@ class HebrewCalendar {
11381
11664
  * const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'
11382
11665
  * const hd = HebrewCalendar.getYahrzeit(5780, dt); // '30 Sh\'vat 5780'
11383
11666
  * console.log(hd.greg().toLocaleDateString('en-US')); // '2/25/2020'
11384
- * @param {number} hyear Hebrew year
11385
- * @param {Date|HDate} gdate Gregorian or Hebrew date of death
11386
- * @return {HDate | undefined} anniversary occurring in hyear
11667
+ * @param hyear Hebrew year
11668
+ * @param gdate Gregorian or Hebrew date of death
11669
+ * @returns anniversary occurring in hyear
11387
11670
  */
11388
11671
  static getYahrzeit(hyear, gdate) {
11389
11672
  const dt = getYahrzeitHD(hyear, gdate);
@@ -11396,18 +11679,15 @@ class HebrewCalendar {
11396
11679
  * Lower-level holidays interface, which returns a `Map` of `Event`s indexed by
11397
11680
  * `HDate.toString()`. These events must filtered especially for `flags.IL_ONLY`
11398
11681
  * or `flags.CHUL_ONLY` depending on Israel vs. Diaspora holiday scheme.
11399
- * @function
11400
- * @param {number} year Hebrew year
11401
- * @return {HolidayYearMap}
11682
+ * @param year Hebrew year
11402
11683
  */
11403
11684
  static getHolidaysForYear(year) {
11404
11685
  return getHolidaysForYear_(year);
11405
11686
  }
11406
11687
  /**
11407
11688
  * Returns an array of holidays for the year
11408
- * @param {number} year Hebrew year
11409
- * @param {boolean} il use the Israeli schedule for holidays
11410
- * @return {HolidayEvent[]}
11689
+ * @param year Hebrew year
11690
+ * @param il use the Israeli schedule for holidays
11411
11691
  */
11412
11692
  static getHolidaysForYearArray(year, il) {
11413
11693
  const yearMap = getHolidaysForYear_(year);
@@ -11427,9 +11707,8 @@ class HebrewCalendar {
11427
11707
  }
11428
11708
  /**
11429
11709
  * Returns an array of Events on this date (or `undefined` if no events)
11430
- * @param {HDate|Date|number} date Hebrew Date, Gregorian date, or absolute R.D. day number
11431
- * @param {boolean} [il] use the Israeli schedule for holidays
11432
- * @return {HolidayEvent[] | undefined}
11710
+ * @param date Hebrew Date, Gregorian date, or absolute R.D. day number
11711
+ * @param [il] use the Israeli schedule for holidays
11433
11712
  */
11434
11713
  static getHolidaysOnDate(date, il) {
11435
11714
  const hd = HDate.isHDate(date) ? date : new HDate(date);
@@ -11446,9 +11725,6 @@ class HebrewCalendar {
11446
11725
  }
11447
11726
  /**
11448
11727
  * Eruv Tavshilin
11449
- * @param {Date | HDate} date
11450
- * @param {boolean} il
11451
- * @return {boolean}
11452
11728
  */
11453
11729
  static eruvTavshilin(date, il) {
11454
11730
  if (date.getDay() < 3 || date.getDay() > 4) {
@@ -11468,25 +11744,19 @@ class HebrewCalendar {
11468
11744
  * locale.
11469
11745
  * If `options.hour12` is `false`, locale is ignored and always returns 24-hour time.
11470
11746
  * If `options.hour12` is `true`, locale is ignored and always returns 12-hour time.
11471
- * @param {string} timeStr - original time like "20:30"
11472
- * @param {string} suffix - "p" or "pm" or " P.M.". Add leading space if you want it
11473
- * @param {CalOptions} options
11474
- * @return {string}
11747
+ * @param timeStr - original time like "20:30"
11748
+ * @param suffix - "p" or "pm" or " P.M.". Add leading space if you want it
11749
+ * @param options
11475
11750
  */
11476
11751
  static reformatTimeStr(timeStr, suffix, options) {
11477
11752
  return reformatTimeStr(timeStr, suffix, options);
11478
11753
  }
11479
- /** @return {string} */
11480
11754
  static version() {
11481
11755
  return version;
11482
11756
  }
11483
11757
  /**
11484
11758
  * Convenience function to create an instance of `Sedra` or reuse a previously
11485
11759
  * created and cached instance.
11486
- * @function
11487
- * @param {number} hyear
11488
- * @param {boolean} il
11489
- * @return {Sedra}
11490
11760
  */
11491
11761
  static getSedra(hyear, il) {
11492
11762
  return getSedra_(hyear, il);
@@ -11504,10 +11774,6 @@ class HebrewCalendar {
11504
11774
  * 0 - No Hallel
11505
11775
  * 1 - Half Hallel
11506
11776
  * 2 - Whole Hallel
11507
- *
11508
- * @param {HDate} hdate
11509
- * @param {boolean} il
11510
- * @return {number}
11511
11777
  */
11512
11778
  static hallel(hdate, il) {
11513
11779
  const events = HebrewCalendar.getHolidaysForYearArray(hdate.getFullYear(), il);
@@ -11528,9 +11794,6 @@ class HebrewCalendar {
11528
11794
  * Tachanun is not said at Mincha on days before it is not said at Shacharit.
11529
11795
  *
11530
11796
  * Tachanun is not said at Shacharit on Shabbat, but is at Mincha, usually.
11531
- * @param {HDate} hdate
11532
- * @param {boolean} il
11533
- * @return {TachanunResult}
11534
11797
  */
11535
11798
  static tachanun(hdate, il) {
11536
11799
  return tachanun_(hdate, il);
@@ -11538,13 +11801,10 @@ class HebrewCalendar {
11538
11801
  }
11539
11802
  /**
11540
11803
  * @private
11541
- * @param {HDate} date
11542
- * @param {boolean} il
11543
- * @return {boolean}
11544
11804
  */
11545
11805
  function isChag(date, il) {
11546
11806
  const events = HebrewCalendar.getHolidaysOnDate(date, il) || [];
11547
- const chag = events.filter((ev) => ev.getFlags() & flags.CHAG);
11807
+ const chag = events.filter(ev => ev.getFlags() & flags.CHAG);
11548
11808
  return chag.length !== 0;
11549
11809
  }
11550
11810
  /**
@@ -11558,19 +11818,20 @@ function appendHolidayAndRelated(candlesEv, events, ev, options, isFriday, isSat
11558
11818
  return candlesEv; // holiday isn't observed here; bail out early
11559
11819
  }
11560
11820
  const eFlags = ev.getFlags();
11561
- if ((!options.yomKippurKatan && (eFlags & YOM_KIPPUR_KATAN)) ||
11562
- (options.noModern && (eFlags & MODERN_HOLIDAY))) {
11821
+ if ((!options.yomKippurKatan && eFlags & YOM_KIPPUR_KATAN) ||
11822
+ (options.noModern && eFlags & MODERN_HOLIDAY)) {
11563
11823
  return candlesEv; // bail out early
11564
11824
  }
11565
11825
  const isMajorFast = Boolean(eFlags & MAJOR_FAST);
11566
11826
  const isMinorFast = Boolean(eFlags & MINOR_FAST);
11567
11827
  if (options.candlelighting && (isMajorFast || isMinorFast)) {
11568
11828
  ev = makeFastStartEnd(ev, options);
11569
- if (ev.startEvent && (isMajorFast || (isMinorFast && !options.noMinorFast))) {
11829
+ if (ev.startEvent &&
11830
+ (isMajorFast || (isMinorFast && !options.noMinorFast))) {
11570
11831
  events.push(ev.startEvent);
11571
11832
  }
11572
11833
  }
11573
- if ((eFlags & Number(options.mask)) || (!eFlags && !hasUserMask)) {
11834
+ if (eFlags & Number(options.mask) || (!eFlags && !hasUserMask)) {
11574
11835
  if (options.candlelighting && eFlags & MASK_LIGHT_CANDLES) {
11575
11836
  const hd = ev.getDate();
11576
11837
  candlesEv = makeCandleEvent(ev, hd, options, isFriday, isSaturday);
@@ -11588,7 +11849,8 @@ function appendHolidayAndRelated(candlesEv, events, ev, options, isFriday, isSat
11588
11849
  candlesEv = undefined;
11589
11850
  }
11590
11851
  }
11591
- if (!options.noHolidays || (options.yomKippurKatan && (eFlags & YOM_KIPPUR_KATAN))) {
11852
+ if (!options.noHolidays ||
11853
+ (options.yomKippurKatan && eFlags & YOM_KIPPUR_KATAN)) {
11592
11854
  events.push(ev); // the original event itself
11593
11855
  }
11594
11856
  }
@@ -11601,9 +11863,9 @@ function makeMoladAndMevarchimChodesh(hd, options) {
11601
11863
  const evts = [];
11602
11864
  const hmonth = hd.getMonth();
11603
11865
  const hdate = hd.getDate();
11604
- if (hmonth != ELUL && hdate >= 23 && hdate <= 29) {
11866
+ if (hmonth !== ELUL && hdate >= 23 && hdate <= 29) {
11605
11867
  const hyear = hd.getFullYear();
11606
- const monNext = (hmonth == HDate.monthsInYear(hyear) ? NISAN : hmonth + 1);
11868
+ const monNext = hmonth === HDate.monthsInYear(hyear) ? NISAN : hmonth + 1;
11607
11869
  if (options.molad) {
11608
11870
  evts.push(new MoladEvent(hd, hyear, monNext, options));
11609
11871
  }
@@ -11678,3 +11940,4 @@ exports.holidayDesc = holidayDesc;
11678
11940
  exports.months = months;
11679
11941
  exports.parshiot = parshiot;
11680
11942
  exports.version = version;
11943
+ //# sourceMappingURL=index.cjs.map