@hebcal/core 3.41.2 → 3.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v3.41.2 */
1
+ /*! @hebcal/core v3.42.0 */
2
2
  'use strict';
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -81,32 +81,11 @@ function daysInMonth$1(month, year) {
81
81
  function isDate(obj) {
82
82
  return typeof obj === 'object' && Date.prototype === obj.__proto__;
83
83
  }
84
- /**
85
- * Returns number of days since January 1 of that year
86
- * @private
87
- * @param {Date} date Gregorian date
88
- * @return {number}
89
- */
90
-
91
- function dayOfYear(date) {
92
- if (!isDate(date)) {
93
- throw new TypeError(`Argument not a Date: ${date}`);
94
- }
95
-
96
- const month = date.getMonth();
97
- let doy = date.getDate() + 31 * month;
98
-
99
- if (month > 1) {
100
- // FEB
101
- doy -= Math.floor((4 * (month + 1) + 23) / 10);
102
-
103
- if (isLeapYear$1(date.getFullYear())) {
104
- doy++;
105
- }
106
- }
84
+ /*
85
+ const ABS_14SEP1752 = 639797;
86
+ const ABS_2SEP1752 = 639785;
87
+ */
107
88
 
108
- return doy;
109
- }
110
89
  /**
111
90
  * Converts Gregorian date to absolute R.D. (Rata Die) days
112
91
  * @private
@@ -119,12 +98,14 @@ function greg2abs(date) {
119
98
  throw new TypeError(`Argument not a Date: ${date}`);
120
99
  }
121
100
 
122
- const year = date.getFullYear() - 1;
123
- return dayOfYear(date) + // days this year
124
- 365 * year + ( // + days in prior years
125
- Math.floor(year / 4) - // + Julian Leap years
126
- Math.floor(year / 100) + // - century years
127
- Math.floor(year / 400)); // + Gregorian leap years
101
+ const abs = toFixed(date.getFullYear(), date.getMonth() + 1, date.getDate());
102
+ /*
103
+ if (abs < ABS_14SEP1752 && abs > ABS_2SEP1752) {
104
+ throw new RangeError(`Invalid Date: ${date}`);
105
+ }
106
+ */
107
+
108
+ return abs;
128
109
  }
129
110
  /**
130
111
  * @private
@@ -147,8 +128,8 @@ function yearFromFixed(abs) {
147
128
  /**
148
129
  * @private
149
130
  * @param {number} year
150
- * @param {number} month
151
- * @param {number} day
131
+ * @param {number} month (1-12)
132
+ * @param {number} day (1-31)
152
133
  * @return {number}
153
134
  */
154
135
 
@@ -175,6 +156,12 @@ function abs2greg(abs) {
175
156
  }
176
157
 
177
158
  abs = Math.trunc(abs);
159
+ /*
160
+ if (abs < ABS_14SEP1752 && abs > ABS_2SEP1752) {
161
+ throw new RangeError(`Invalid Date: ${abs}`);
162
+ }
163
+ */
164
+
178
165
  const year = yearFromFixed(abs);
179
166
  const priorDays = abs - toFixed(year, 1, 1);
180
167
  const correction = abs < toFixed(year, 3, 1) ? 0 : isLeapYear$1(year) ? 1 : 2;
@@ -231,13 +218,30 @@ class greg {
231
218
  }
232
219
  /**
233
220
  * Returns number of days since January 1 of that year
221
+ * @deprecated
234
222
  * @param {Date} date Gregorian date
235
223
  * @return {number}
236
224
  */
237
225
 
238
226
 
239
227
  static dayOfYear(date) {
240
- return dayOfYear(date);
228
+ if (!isDate(date)) {
229
+ throw new TypeError(`Argument not a Date: ${date}`);
230
+ }
231
+
232
+ const month = date.getMonth();
233
+ let doy = date.getDate() + 31 * month;
234
+
235
+ if (month > 1) {
236
+ // FEB
237
+ doy -= Math.floor((4 * (month + 1) + 23) / 10);
238
+
239
+ if (isLeapYear$1(date.getFullYear())) {
240
+ doy++;
241
+ }
242
+ }
243
+
244
+ return doy;
241
245
  }
242
246
  /**
243
247
  * Converts Gregorian date to absolute R.D. (Rata Die) days
@@ -627,8 +631,8 @@ Locale.useLocale('en');
627
631
  /*
628
632
  * More minimal HDate
629
633
  */
630
- const NISAN$3 = 1;
631
- const IYYAR$1 = 2; // const SIVAN = 3;
634
+ const NISAN$4 = 1;
635
+ const IYYAR$2 = 2; // const SIVAN = 3;
632
636
 
633
637
  const TAMUZ$1 = 4; // const AV = 5;
634
638
 
@@ -717,7 +721,7 @@ function hebrew2abs(year, month, day) {
717
721
  tempabs += daysInMonth(m, year);
718
722
  }
719
723
 
720
- for (let m = NISAN$3; m < month; m++) {
724
+ for (let m = NISAN$4; m < month; m++) {
721
725
  tempabs += daysInMonth(m, year);
722
726
  }
723
727
  } else {
@@ -802,7 +806,7 @@ function monthsInYear(year) {
802
806
 
803
807
  function daysInMonth(month, year) {
804
808
  switch (month) {
805
- case IYYAR$1:
809
+ case IYYAR$2:
806
810
  case TAMUZ$1:
807
811
  case ELUL$2:
808
812
  case TEVET$2:
@@ -1930,7 +1934,10 @@ const flags = {
1930
1934
  CHOL_HAMOED: 0x200000,
1931
1935
 
1932
1936
  /** Mishna Yomi */
1933
- MISHNA_YOMI: 0x400000
1937
+ MISHNA_YOMI: 0x400000,
1938
+
1939
+ /** Yom Kippur Katan, minor day of atonement on the day preceeding each Rosh Chodesh */
1940
+ YOM_KIPPUR_KATAN: 0x800000
1934
1941
  };
1935
1942
  /** Represents an Event with a title, date, and flags */
1936
1943
 
@@ -3351,6 +3358,7 @@ class Location {
3351
3358
  }
3352
3359
  /**
3353
3360
  * Builds a city description from geonameid string components
3361
+ * @deprecated
3354
3362
  * @param {string} cityName e.g. 'Tel Aviv' or 'Chicago'
3355
3363
  * @param {string} admin1 e.g. 'England' or 'Massachusetts'
3356
3364
  * @param {string} countryName full country name, e.g. 'Israel' or 'United States'
@@ -4488,7 +4496,7 @@ const SHAVUOT = 'Shavuot'; // 33
4488
4496
  * @return {number[]}
4489
4497
  */
4490
4498
 
4491
- function range(start, stop) {
4499
+ function range$1(start, stop) {
4492
4500
  return Array.from({
4493
4501
  length: stop - start + 1
4494
4502
  }, (v, k) => k + start);
@@ -4506,78 +4514,78 @@ const types = {
4506
4514
  /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and
4507
4515
  * Kislev each have 29 days), and has Passover start on Tuesday. */
4508
4516
  // e.g. 5753
4509
- '020': [51, 52].concat(EOY, range(0, 20), D(21), 23, 24, PESACH, 25, D(26), D(28), 30, D(31), range(33, 40), D(41), range(43, 49), D(50)),
4517
+ '020': [51, 52].concat(EOY, range$1(0, 20), D(21), 23, 24, PESACH, 25, D(26), D(28), 30, D(31), range$1(33, 40), D(41), range$1(43, 49), D(50)),
4510
4518
 
4511
4519
  /* Hebrew year that starts on Monday, is `complete' (Heshvan and
4512
4520
  * Kislev each have 30 days), and has Passover start on Thursday. */
4513
4521
  // e.g. 5756
4514
- '0220': [51, 52].concat(EOY, range(0, 20), D(21), 23, 24, PESACH, 25, D(26), D(28), 30, D(31), 33, SHAVUOT, range(34, 37), D(38), 40, D(41), range(43, 49), D(50)),
4522
+ '0220': [51, 52].concat(EOY, range$1(0, 20), D(21), 23, 24, PESACH, 25, D(26), D(28), 30, D(31), 33, SHAVUOT, range$1(34, 37), D(38), 40, D(41), range$1(43, 49), D(50)),
4515
4523
 
4516
4524
  /* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29
4517
4525
  * days and Kislev has 30 days), and has Passover start on Saturday. */
4518
4526
  // e.g. 5701
4519
- '0510': [52].concat(YK, EOY, range(0, 20), D(21), 23, 24, PESACH1, PESACH8, 25, D(26), D(28), 30, D(31), range(33, 40), D(41), range(43, 50)),
4527
+ '0510': [52].concat(YK, EOY, range$1(0, 20), D(21), 23, 24, PESACH1, PESACH8, 25, D(26), D(28), 30, D(31), range$1(33, 40), D(41), range$1(43, 50)),
4520
4528
 
4521
4529
  /* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29
4522
4530
  * days and Kislev has 30 days), and has Passover start on Saturday. */
4523
4531
  // e.g. 5745
4524
- '0511': [52].concat(YK, EOY, range(0, 20), D(21), 23, 24, PESACH, 25, D(26), D(28), range(30, 40), D(41), range(43, 50)),
4532
+ '0511': [52].concat(YK, EOY, range$1(0, 20), D(21), 23, 24, PESACH, 25, D(26), D(28), range$1(30, 40), D(41), range$1(43, 50)),
4525
4533
 
4526
4534
  /* Hebrew year that starts on Thursday, is `complete' (Heshvan and
4527
4535
  * Kislev each have 30 days), and has Passover start on Sunday. */
4528
4536
  // e.g. 5754
4529
- '052': [52].concat(YK, CHMSUKOT, range(0, 24), PESACH7, 25, D(26), D(28), 30, D(31), range(33, 40), D(41), range(43, 50)),
4537
+ '052': [52].concat(YK, CHMSUKOT, range$1(0, 24), PESACH7, 25, D(26), D(28), 30, D(31), range$1(33, 40), D(41), range$1(43, 50)),
4530
4538
 
4531
4539
  /* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and Kislev
4532
4540
  * each have 29 days), and has Passover start on Sunday. */
4533
4541
  // e.g. 5761
4534
- '070': [].concat(RH, 52, SUKKOT, SHMINI, range(0, 20), D(21), 23, 24, PESACH7, 25, D(26), D(28), 30, D(31), range(33, 40), D(41), range(43, 50)),
4542
+ '070': [].concat(RH, 52, SUKKOT, SHMINI, range$1(0, 20), D(21), 23, 24, PESACH7, 25, D(26), D(28), 30, D(31), range$1(33, 40), D(41), range$1(43, 50)),
4535
4543
 
4536
4544
  /* Hebrew year that starts on Saturday, is `complete' (Heshvan and
4537
4545
  * Kislev each have 30 days), and has Passover start on Tuesday. */
4538
4546
  // e.g. 5716
4539
- '072': [].concat(RH, 52, SUKKOT, SHMINI, range(0, 20), D(21), 23, 24, CHMPESACH, 25, D(26), D(28), 30, D(31), range(33, 40), D(41), range(43, 49), D(50)),
4547
+ '072': [].concat(RH, 52, SUKKOT, SHMINI, range$1(0, 20), D(21), 23, 24, CHMPESACH, 25, D(26), D(28), 30, D(31), range$1(33, 40), D(41), range$1(43, 49), D(50)),
4540
4548
 
4541
4549
  /* -- The leap year types (keviot) -- */
4542
4550
 
4543
4551
  /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and
4544
4552
  * Kislev each have 29 days), and has Passover start on Thursday. */
4545
4553
  // e.g. 5746
4546
- '1200': [51, 52].concat(CHMSUKOT, range(0, 27), CHMPESACH, range(28, 33), SHAVUOT, range(34, 37), D(38), 40, D(41), range(43, 49), D(50)),
4554
+ '1200': [51, 52].concat(CHMSUKOT, range$1(0, 27), CHMPESACH, range$1(28, 33), SHAVUOT, range$1(34, 37), D(38), 40, D(41), range$1(43, 49), D(50)),
4547
4555
 
4548
4556
  /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and
4549
4557
  * Kislev each have 29 days), and has Passover start on Thursday. */
4550
4558
  // e.g. 5746
4551
- '1201': [51, 52].concat(CHMSUKOT, range(0, 27), CHMPESACH, range(28, 40), D(41), range(43, 49), D(50)),
4559
+ '1201': [51, 52].concat(CHMSUKOT, range$1(0, 27), CHMPESACH, range$1(28, 40), D(41), range$1(43, 49), D(50)),
4552
4560
 
4553
4561
  /* Hebrew year that starts on Monday, is `complete' (Heshvan and
4554
4562
  * Kislev each have 30 days), and has Passover start on Saturday. */
4555
4563
  // e.g.5752
4556
- '1220': [51, 52].concat(CHMSUKOT, range(0, 27), PESACH1, PESACH8, range(28, 40), D(41), range(43, 50)),
4564
+ '1220': [51, 52].concat(CHMSUKOT, range$1(0, 27), PESACH1, PESACH8, range$1(28, 40), D(41), range$1(43, 50)),
4557
4565
 
4558
4566
  /* Hebrew year that starts on Monday, is `complete' (Heshvan and
4559
4567
  * Kislev each have 30 days), and has Passover start on Saturday. */
4560
4568
  // e.g.5752
4561
- '1221': [51, 52].concat(CHMSUKOT, range(0, 27), PESACH, range(28, 50)),
4569
+ '1221': [51, 52].concat(CHMSUKOT, range$1(0, 27), PESACH, range$1(28, 50)),
4562
4570
 
4563
4571
  /* Hebrew year that starts on Thursday, is `incomplete' (Heshvan and
4564
4572
  * Kislev both have 29 days), and has Passover start on Sunday. */
4565
4573
  // e.g. 5768
4566
- '150': [52].concat(YK, CHMSUKOT, range(0, 28), PESACH7, range(29, 50)),
4574
+ '150': [52].concat(YK, CHMSUKOT, range$1(0, 28), PESACH7, range$1(29, 50)),
4567
4575
 
4568
4576
  /* Hebrew year that starts on Thursday, is `complete' (Heshvan and
4569
4577
  * Kislev both have 30 days), and has Passover start on Tuesday. */
4570
4578
  // eg. 5771
4571
- '152': [52].concat(YK, CHMSUKOT, range(0, 28), CHMPESACH, range(29, 49), D(50)),
4579
+ '152': [52].concat(YK, CHMSUKOT, range$1(0, 28), CHMPESACH, range$1(29, 49), D(50)),
4572
4580
 
4573
4581
  /* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and
4574
4582
  * Kislev each have 29 days), and has Passover start on Tuesday. */
4575
4583
  // e.g.5757
4576
- '170': [].concat(RH, 52, SUKKOT, SHMINI, range(0, 27), CHMPESACH, range(28, 40), D(41), range(43, 49), D(50)),
4584
+ '170': [].concat(RH, 52, SUKKOT, SHMINI, range$1(0, 27), CHMPESACH, range$1(28, 40), D(41), range$1(43, 49), D(50)),
4577
4585
 
4578
4586
  /* Hebrew year that starts on Saturday, is `complete' (Heshvan and
4579
4587
  * Kislev each have 30 days), and has Passover start on Thursday. */
4580
- '1720': [].concat(RH, 52, SUKKOT, SHMINI, range(0, 27), CHMPESACH, range(28, 33), SHAVUOT, range(34, 37), D(38), 40, D(41), range(43, 49), D(50))
4588
+ '1720': [].concat(RH, 52, SUKKOT, SHMINI, range$1(0, 27), CHMPESACH, range$1(28, 33), SHAVUOT, range$1(34, 37), D(38), 40, D(41), range$1(43, 49), D(50))
4581
4589
  };
4582
4590
  /* Hebrew year that starts on Monday, is `complete' (Heshvan and
4583
4591
  * Kislev each have 30 days), and has Passover start on Thursday. */
@@ -4679,6 +4687,70 @@ class ParshaEvent extends Event {
4679
4687
 
4680
4688
  }
4681
4689
 
4690
+ const SUN$1 = 0;
4691
+ const TUE$1 = 2;
4692
+ const FRI$2 = 5;
4693
+ const SAT$2 = 6;
4694
+ const NISAN$3 = months.NISAN;
4695
+ const IYYAR$1 = months.IYYAR;
4696
+ /**
4697
+ * Yom HaShoah first observed in 1951.
4698
+ * When the actual date of Yom Hashoah falls on a Friday, the
4699
+ * state of Israel observes Yom Hashoah on the preceding
4700
+ * Thursday. When it falls on a Sunday, Yom Hashoah is observed
4701
+ * on the following Monday.
4702
+ * http://www.ushmm.org/remembrance/dor/calendar/
4703
+ * @private
4704
+ * @param {number} year
4705
+ * @return {HDate|null}
4706
+ */
4707
+
4708
+ function dateYomHaShoah(year) {
4709
+ if (year < 5711) {
4710
+ return null;
4711
+ }
4712
+
4713
+ let nisan27dt = new HDate(27, NISAN$3, year);
4714
+
4715
+ if (nisan27dt.getDay() === FRI$2) {
4716
+ nisan27dt = new HDate(26, NISAN$3, year);
4717
+ } else if (nisan27dt.getDay() === SUN$1) {
4718
+ nisan27dt = new HDate(28, NISAN$3, year);
4719
+ }
4720
+
4721
+ return nisan27dt;
4722
+ }
4723
+ /**
4724
+ * Yom HaAtzma'ut only celebrated after 1948
4725
+ * @private
4726
+ * @param {number} year
4727
+ * @return {HDate|null}
4728
+ */
4729
+
4730
+ function dateYomHaZikaron(year) {
4731
+ if (year < 5708) {
4732
+ return null;
4733
+ }
4734
+
4735
+ let day;
4736
+ const pesach = new HDate(15, NISAN$3, year);
4737
+ const pdow = pesach.getDay();
4738
+
4739
+ if (pdow === SUN$1) {
4740
+ day = 2;
4741
+ } else if (pdow === SAT$2) {
4742
+ day = 3;
4743
+ } else if (year < 5764) {
4744
+ day = 4;
4745
+ } else if (pdow === TUE$1) {
4746
+ day = 5;
4747
+ } else {
4748
+ day = 4;
4749
+ }
4750
+
4751
+ return new HDate(day, IYYAR$1, year);
4752
+ }
4753
+
4682
4754
  /*
4683
4755
  Hebcal - A Jewish Calendar Generator
4684
4756
  Copyright (c) 1994-2020 Danny Sadinoff
@@ -4888,7 +4960,7 @@ class YomKippurKatanEvent extends HolidayEvent {
4888
4960
  * @param {string} nextMonthName name of the upcoming month
4889
4961
  */
4890
4962
  constructor(date, nextMonthName) {
4891
- super(date, `${ykk} ${nextMonthName}`, flags.MINOR_FAST);
4963
+ super(date, `${ykk} ${nextMonthName}`, flags.MINOR_FAST | flags.YOM_KIPPUR_KATAN);
4892
4964
  this.nextMonthName = nextMonthName;
4893
4965
  this.memo = `Minor Day of Atonement on the day preceeding Rosh Chodesh ${nextMonthName}`;
4894
4966
  }
@@ -5226,42 +5298,16 @@ function getHolidaysForYear_(year) {
5226
5298
  }));
5227
5299
  }
5228
5300
 
5229
- if (year >= 5711) {
5230
- // Yom HaShoah first observed in 1951
5231
- let nisan27dt = new HDate(27, NISAN$2, year);
5232
- /* When the actual date of Yom Hashoah falls on a Friday, the
5233
- * state of Israel observes Yom Hashoah on the preceding
5234
- * Thursday. When it falls on a Sunday, Yom Hashoah is observed
5235
- * on the following Monday.
5236
- * http://www.ushmm.org/remembrance/dor/calendar/
5237
- */
5238
-
5239
- if (nisan27dt.getDay() == FRI$1) {
5240
- nisan27dt = new HDate(26, NISAN$2, year);
5241
- } else if (nisan27dt.getDay() == SUN) {
5242
- nisan27dt = new HDate(28, NISAN$2, year);
5243
- }
5301
+ const nisan27dt = dateYomHaShoah(year);
5244
5302
 
5303
+ if (nisan27dt) {
5245
5304
  add(new HolidayEvent(nisan27dt, 'Yom HaShoah', MODERN_HOLIDAY$1));
5246
5305
  }
5247
5306
 
5248
- if (year >= 5708) {
5249
- // Yom HaAtzma'ut only celebrated after 1948
5250
- let day;
5251
-
5252
- if (pesach.getDay() == SUN) {
5253
- day = 2;
5254
- } else if (pesach.getDay() == SAT$1) {
5255
- day = 3;
5256
- } else if (year < 5764) {
5257
- day = 4;
5258
- } else if (pesach.getDay() == TUE) {
5259
- day = 5;
5260
- } else {
5261
- day = 4;
5262
- }
5307
+ const yomHaZikaronDt = dateYomHaZikaron(year);
5263
5308
 
5264
- add(new HolidayEvent(new HDate(day, IYYAR, year), 'Yom HaZikaron', MODERN_HOLIDAY$1, emojiIsraelFlag), new HolidayEvent(new HDate(day + 1, IYYAR, year), 'Yom HaAtzma\'ut', MODERN_HOLIDAY$1, emojiIsraelFlag));
5309
+ if (yomHaZikaronDt) {
5310
+ add(new HolidayEvent(yomHaZikaronDt, 'Yom HaZikaron', MODERN_HOLIDAY$1, emojiIsraelFlag), new HolidayEvent(yomHaZikaronDt.next(), 'Yom HaAtzma\'ut', MODERN_HOLIDAY$1, emojiIsraelFlag));
5265
5311
  }
5266
5312
 
5267
5313
  if (year >= 5727) {
@@ -5605,9 +5651,9 @@ function getBirthdayOrAnniversary_(hyear, gdate) {
5605
5651
  return new HDate(day, month, hyear);
5606
5652
  }
5607
5653
 
5608
- var version="3.41.2";
5654
+ var version="3.42.0";
5609
5655
 
5610
- var headers$1={"plural-forms":"nplurals=2; plural=(n > 1);",language:"en_CA@ashkenazi"};var contexts$1={"":{Berachot:["Berachos"],Shabbat:["Shabbos"],Taanit:["Taanis"],Yevamot:["Yevamos"],Ketubot:["Kesubos"],"Baba Batra":["Baba Basra"],Makkot:["Makkos"],Shevuot:["Shevuos"],Horayot:["Horayos"],Menachot:["Menachos"],Bechorot:["Bechoros"],Keritot:["Kerisos"],Midot:["Midos"],"Achrei Mot":["Achrei Mos"],Bechukotai:["Bechukosai"],"Beha'alotcha":["Beha'aloscha"],Bereshit:["Bereshis"],Chukat:["Chukas"],"Erev Shavuot":["Erev Shavuos"],"Erev Sukkot":["Erev Sukkos"],"Ki Tavo":["Ki Savo"],"Ki Teitzei":["Ki Seitzei"],"Ki Tisa":["Ki Sisa"],Matot:["Matos"],"Purim Katan":["Purim Koton"],Tazria:["Sazria"],"Shabbat Chazon":["Shabbos Chazon"],"Shabbat HaChodesh":["Shabbos HaChodesh"],"Shabbat HaGadol":["Shabbos HaGadol"],"Shabbat Nachamu":["Shabbos Nachamu"],"Shabbat Parah":["Shabbos Parah"],"Shabbat Shekalim":["Shabbos Shekalim"],"Shabbat Shuva":["Shabbos Shuvah"],"Shabbat Zachor":["Shabbos Zachor"],Shavuot:["Shavuos"],"Shavuot I":["Shavuos I"],"Shavuot II":["Shavuos II"],Shemot:["Shemos"],"Shmini Atzeret":["Shmini Atzeres"],"Simchat Torah":["Simchas Torah"],Sukkot:["Sukkos"],"Sukkot I":["Sukkos I"],"Sukkot II":["Sukkos II"],"Sukkot II (CH''M)":["Sukkos II (CH''M)"],"Sukkot III (CH''M)":["Sukkos III (CH''M)"],"Sukkot IV (CH''M)":["Sukkos IV (CH''M)"],"Sukkot V (CH''M)":["Sukkos V (CH''M)"],"Sukkot VI (CH''M)":["Sukkos VI (CH''M)"],"Sukkot VII (Hoshana Raba)":["Sukkos VII (Hoshana Raba)"],"Ta'anit Bechorot":["Ta'anis Bechoros"],"Ta'anit Esther":["Ta'anis Esther"],Toldot:["Toldos"],Vaetchanan:["Vaeschanan"],Yitro:["Yisro"],"Vezot Haberakhah":["Vezos Haberakhah"],Parashat:["Parshas"],"Leil Selichot":["Leil Selichos"],"Shabbat Mevarchim Chodesh":["Shabbos Mevorchim Chodesh"],"Shabbat Shirah":["Shabbos Shirah"],Tevet:["Teves"],"Asara B'Tevet":["Asara B'Teves"],Berakhot:["Berakhos"],Sheviit:["Sheviis"],Terumot:["Terumos"],Maasrot:["Maasros"],Eduyot:["Eduyos"],Avot:["Avos"],Bekhorot:["Bekhoros"],Middot:["Middos"],Oholot:["Oholos"],Tahorot:["Tahoros"],Mikvaot:["Mikvaos"]}};var poAshkenazi = {headers:headers$1,contexts:contexts$1};
5656
+ var headers$1={"plural-forms":"nplurals=2; plural=(n > 1);",language:"en_CA@ashkenazi"};var contexts$1={"":{Berachot:["Berachos"],Shabbat:["Shabbos"],Taanit:["Taanis"],Yevamot:["Yevamos"],Ketubot:["Kesubos"],"Baba Batra":["Baba Basra"],Makkot:["Makkos"],Shevuot:["Shevuos"],Horayot:["Horayos"],Menachot:["Menachos"],Bechorot:["Bechoros"],Keritot:["Kerisos"],Midot:["Midos"],"Achrei Mot":["Achrei Mos"],Bechukotai:["Bechukosai"],"Beha'alotcha":["Beha'aloscha"],Bereshit:["Bereshis"],Chukat:["Chukas"],"Erev Shavuot":["Erev Shavuos"],"Erev Sukkot":["Erev Sukkos"],"Ki Tavo":["Ki Savo"],"Ki Teitzei":["Ki Seitzei"],"Ki Tisa":["Ki Sisa"],Matot:["Matos"],"Purim Katan":["Purim Koton"],Tazria:["Sazria"],"Shabbat Chazon":["Shabbos Chazon"],"Shabbat HaChodesh":["Shabbos HaChodesh"],"Shabbat HaGadol":["Shabbos HaGadol"],"Shabbat Nachamu":["Shabbos Nachamu"],"Shabbat Parah":["Shabbos Parah"],"Shabbat Shekalim":["Shabbos Shekalim"],"Shabbat Shuva":["Shabbos Shuvah"],"Shabbat Zachor":["Shabbos Zachor"],Shavuot:["Shavuos"],"Shavuot I":["Shavuos I"],"Shavuot II":["Shavuos II"],Shemot:["Shemos"],"Shmini Atzeret":["Shmini Atzeres"],"Simchat Torah":["Simchas Torah"],Sukkot:["Sukkos"],"Sukkot I":["Sukkos I"],"Sukkot II":["Sukkos II"],"Sukkot II (CH''M)":["Sukkos II (CH''M)"],"Sukkot III (CH''M)":["Sukkos III (CH''M)"],"Sukkot IV (CH''M)":["Sukkos IV (CH''M)"],"Sukkot V (CH''M)":["Sukkos V (CH''M)"],"Sukkot VI (CH''M)":["Sukkos VI (CH''M)"],"Sukkot VII (Hoshana Raba)":["Sukkos VII (Hoshana Raba)"],"Ta'anit Bechorot":["Ta'anis Bechoros"],"Ta'anit Esther":["Ta'anis Esther"],Toldot:["Toldos"],Vaetchanan:["Vaeschanan"],Yitro:["Yisro"],"Vezot Haberakhah":["Vezos Haberakhah"],Parashat:["Parshas"],"Leil Selichot":["Leil Selichos"],"Shabbat Mevarchim Chodesh":["Shabbos Mevorchim Chodesh"],"Shabbat Shirah":["Shabbos Shirah"],Tevet:["Teves"],"Asara B'Tevet":["Asara B'Teves"],Berakhot:["Berakhos"],Sheviit:["Sheviis"],Terumot:["Terumos"],Maasrot:["Maasros"],Eduyot:["Eduyos"],Avot:["Avos"],Bekhorot:["Bekhoros"],Middot:["Middos"],Oholot:["Oholos"],Tahorot:["Tahoros"],Mikvaot:["Mikvaos"],"Alot HaShachar":["Alos HaShachar"],Misheyakir:["Misheyakir"],"Kriat Shema, sof zeman":["Krias Shema, sof zman"],"Tefilah, sof zeman":["Tefilah, sof zman"],"Chatzot hayom":["Chatzos"],"Tzait HaKochavim":["Tzeis HaKochavim"]}};var poAshkenazi = {headers:headers$1,contexts:contexts$1};
5611
5657
 
5612
5658
  Locale.addLocale('ashkenazi', poAshkenazi);
5613
5659
  Locale.addLocale('a', poAshkenazi);
@@ -5629,6 +5675,186 @@ const poHeNoNikud = {
5629
5675
  };
5630
5676
  Locale.addLocale('he-x-NoNikud', poHeNoNikud);
5631
5677
 
5678
+ const NONE$1 = 0;
5679
+ const HALF = 1;
5680
+ const WHOLE = 2;
5681
+ /**
5682
+ * @private
5683
+ * @param {Event[]} events
5684
+ * @param {HDate} hdate
5685
+ * @return {number}
5686
+ */
5687
+
5688
+ function hallel_(events, hdate) {
5689
+ const whole = events.filter(ev => {
5690
+ /** @type {string} */
5691
+ const desc = ev.getDesc();
5692
+ /** @type {HDate} */
5693
+
5694
+ const hd = ev.getDate();
5695
+ const month = hd.getMonth();
5696
+ const mday = hd.getDate();
5697
+ return desc.startsWith('Chanukah') || desc.startsWith('Shavuot') || desc.startsWith('Sukkot') || month === months.NISAN && (mday === 15 || mday === 16) && ev.getFlags() & flags.CHAG || // Pesach
5698
+ desc === 'Yom HaAtzma\'ut' || desc === 'Yom Yerushalayim';
5699
+ }).map(ev => {
5700
+ return ev.getDate().abs();
5701
+ });
5702
+ const abs = hdate.abs();
5703
+
5704
+ if (whole.includes(abs)) {
5705
+ return WHOLE;
5706
+ }
5707
+
5708
+ const half = events.filter(ev => {
5709
+ const desc = ev.getDesc();
5710
+ return ev.getFlags() & flags.ROSH_CHODESH || desc.startsWith('Pesach') && desc !== 'Pesach I' && desc !== 'Pesach II';
5711
+ }).map(ev => {
5712
+ return ev.getDate().abs();
5713
+ });
5714
+
5715
+ if (half.includes(abs)) {
5716
+ return HALF;
5717
+ }
5718
+
5719
+ return NONE$1;
5720
+ }
5721
+
5722
+ /**
5723
+ * @private
5724
+ * @param {number} start
5725
+ * @param {number} end
5726
+ * @return {number[]}
5727
+ */
5728
+
5729
+ function range(start, end) {
5730
+ const arr = [];
5731
+
5732
+ for (let i = start; i <= end; i++) {
5733
+ arr.push(i);
5734
+ }
5735
+
5736
+ return arr;
5737
+ }
5738
+
5739
+ const cache = Object.create(null);
5740
+ const NONE = {
5741
+ shacharit: false,
5742
+ mincha: false,
5743
+ allCongs: false
5744
+ };
5745
+ /**
5746
+ * @private
5747
+ * @param {HDate} hdate
5748
+ * @param {boolean} il
5749
+ * @return {TachanunResult}
5750
+ */
5751
+
5752
+ function tachanun_(hdate, il) {
5753
+ return tachanun0(hdate, il, true);
5754
+ }
5755
+ /**
5756
+ * @private
5757
+ * @param {HDate} hdate
5758
+ * @param {boolean} il
5759
+ * @param {boolean} checkNext
5760
+ * @return {TachanunResult}
5761
+ */
5762
+
5763
+ function tachanun0(hdate, il, checkNext) {
5764
+ const year = hdate.getFullYear();
5765
+ const key = `${year}-${il ? 1 : 0}`;
5766
+ const dates = cache[key] = cache[key] || tachanunYear(year, il);
5767
+ const abs = hdate.abs();
5768
+
5769
+ if (dates.none.indexOf(abs) > -1) {
5770
+ return NONE;
5771
+ }
5772
+
5773
+ const dow = hdate.getDay();
5774
+ const ret = {
5775
+ shacharit: false,
5776
+ mincha: false,
5777
+ allCongs: false
5778
+ };
5779
+
5780
+ if (dates.some.indexOf(abs) === -1) {
5781
+ ret.allCongs = true;
5782
+ }
5783
+
5784
+ if (dow !== 6) {
5785
+ ret.shacharit = true;
5786
+ }
5787
+
5788
+ const tomorrow = abs + 1;
5789
+
5790
+ if (checkNext && dates.yesPrev.indexOf(tomorrow) === -1) {
5791
+ const tmp = tachanun0(new HDate(tomorrow), il, false);
5792
+ ret.mincha = tmp.shacharit;
5793
+ } else {
5794
+ ret.mincha = dow !== 5;
5795
+ }
5796
+
5797
+ if (ret.allCongs && !ret.mincha && !ret.shacharit) {
5798
+ return NONE;
5799
+ }
5800
+
5801
+ return ret;
5802
+ }
5803
+ /**
5804
+ * @private
5805
+ * @param {number} year
5806
+ * @param {boolean} il
5807
+ * @return {*}
5808
+ */
5809
+
5810
+
5811
+ function tachanunYear(year, il) {
5812
+ const leap = HDate.isLeapYear(year);
5813
+ const monthsInYear = 12 + leap;
5814
+ let av9dt = new HDate(9, months.AV, year);
5815
+
5816
+ if (av9dt.getDay() === 6) {
5817
+ av9dt = av9dt.next();
5818
+ }
5819
+
5820
+ let shushPurim = new HDate(15, months.ADAR_II, year);
5821
+
5822
+ if (shushPurim.getDay() === 6) {
5823
+ shushPurim = shushPurim.next();
5824
+ }
5825
+
5826
+ const none = [].concat( // Rosh Chodesh - 1st of every month. Also includes RH day 1 (1 Tishrei)
5827
+ range(1, monthsInYear).map(month => new HDate(1, month, year)), // Rosh Chodesh - 30th of months that have one
5828
+ range(1, monthsInYear).filter(month => HDate.daysInMonth(month, year) === 30).map(month => new HDate(30, month, year)), new HDate(2, months.TISHREI, year), // Rosh Hashana II
5829
+ // entire month of Nisan
5830
+ range(1, HDate.daysInMonth(months.NISAN, year)).map(mday => new HDate(mday, months.NISAN, year)), new HDate(18, months.IYYAR, year), // Lag BaOmer
5831
+ // Rosh Chodesh Sivan thru Isru Chag
5832
+ range(1, 8 - (il ? 1 : 0)).map(mday => new HDate(mday, months.SIVAN, year)), av9dt, // Tisha B'Av
5833
+ new HDate(15, months.AV, year), // Tu B'Av
5834
+ new HDate(29, months.ELUL, year), // Erev Rosh Hashanah
5835
+ // Erev Yom Kippur thru Isru Chag
5836
+ range(9, 24 - (il ? 1 : 0)).map(mday => new HDate(mday, months.TISHREI, year)), // Chanukah
5837
+ range(25, 33).map(mday => new HDate(mday, months.KISLEV, year)), new HDate(15, months.SHVAT, year), // Tu BiShvat
5838
+ new HDate(14, months.ADAR_II, year), // Purim
5839
+ shushPurim, leap ? new HDate(14, months.ADAR_I, year) : [] // Purim Katan
5840
+ );
5841
+ const some = [].concat( // Until 14 Sivan
5842
+ range(1, 13).map(mday => new HDate(mday, months.SIVAN, year)), // Until after Rosh Chodesh Cheshvan
5843
+ range(20, 31).map(mday => new HDate(mday, months.TISHREI, year)), new HDate(14, months.IYYAR, year), // Pesach Sheini
5844
+ // Yom HaAtzma'ut, which changes based on day of week
5845
+ year >= 5708 ? dateYomHaZikaron(year).next() : [], // Yom Yerushalayim
5846
+ year >= 5727 ? new HDate(28, months.IYYAR, year) : []);
5847
+ const yesPrev = [].concat(new HDate(29, months.ELUL, year - 1), // Erev Rosh Hashanah
5848
+ new HDate(9, months.TISHREI, year), // Erev Yom Kippur
5849
+ new HDate(14, months.IYYAR, year) // Pesach Sheini
5850
+ );
5851
+ return {
5852
+ none: none.map(hd => hd.abs()).sort(),
5853
+ some: some.map(hd => hd.abs()).sort(),
5854
+ yesPrev: yesPrev.map(hd => hd.abs()).sort()
5855
+ };
5856
+ }
5857
+
5632
5858
  /*
5633
5859
  Hebcal - A Jewish Calendar Generator
5634
5860
  Copyright (c) 1994-2020 Danny Sadinoff
@@ -5823,6 +6049,13 @@ function checkCandleOptions(options) {
5823
6049
  * Possible values are `true` and `false`; the default is locale dependent.
5824
6050
  */
5825
6051
 
6052
+ /**
6053
+ * @typedef {Object} TachanunResult
6054
+ * @property {boolean} shacharit Tachanun is said at Shacharit
6055
+ * @property {boolean} mincha Tachanun is said at Mincha
6056
+ * @property {boolean} allCongs All congregations say Tachanun on the day
6057
+ */
6058
+
5826
6059
  /**
5827
6060
  * Gets the R.D. days for a number, Date, or HDate
5828
6061
  * @private
@@ -5933,6 +6166,7 @@ function getMaskFromOptions(options) {
5933
6166
  if (m & OMER_COUNT) options.omer = true;
5934
6167
  if (m & SHABBAT_MEVARCHIM) options.shabbatMevarchim = true;
5935
6168
  if (m & flags.MISHNA_YOMI) options.mishnaYomi = true;
6169
+ if (m & flags.YOM_KIPPUR_KATAN) options.yomKippurKatan = true;
5936
6170
  options.userMask = true;
5937
6171
  return m;
5938
6172
  }
@@ -5993,6 +6227,10 @@ function getMaskFromOptions(options) {
5993
6227
  mask |= SHABBAT_MEVARCHIM;
5994
6228
  }
5995
6229
 
6230
+ if (options.yomKippurKatan) {
6231
+ mask |= flags.YOM_KIPPUR_KATAN;
6232
+ }
6233
+
5996
6234
  return mask;
5997
6235
  }
5998
6236
 
@@ -6031,6 +6269,8 @@ function observedInIsrael(ev) {
6031
6269
  function observedInDiaspora(ev) {
6032
6270
  return ev.observedInDiaspora();
6033
6271
  }
6272
+
6273
+ const yearArrayCache = Object.create(null);
6034
6274
  /**
6035
6275
  * HebrewCalendar is the main interface to the `@hebcal/core` library.
6036
6276
  * This namespace is used to calculate holidays, rosh chodesh, candle lighting & havdalah times,
@@ -6038,7 +6278,6 @@ function observedInDiaspora(ev) {
6038
6278
  * Event names can be rendered in several languges using the `locale` option.
6039
6279
  */
6040
6280
 
6041
-
6042
6281
  class HebrewCalendar {
6043
6282
  /**
6044
6283
  * Calculates holidays and other Hebrew calendar events based on {@link CalOptions}.
@@ -6075,6 +6314,7 @@ class HebrewCalendar {
6075
6314
  * * Mishna Yomi (`options.mishnaYomi`)
6076
6315
  * * Shabbat Mevarchim HaChodesh on Saturday before Rosh Chodesh (`options.shabbatMevarchim`)
6077
6316
  * * Molad announcement on Saturday before Rosh Chodesh (`options.molad`)
6317
+ * * Yom Kippur Katan (`options.yomKippurKatan`)
6078
6318
  *
6079
6319
  * Candle-lighting and Havdalah times are approximated using latitude and longitude
6080
6320
  * specified by the {@link Location} class. The `Location` class contains a small
@@ -6373,10 +6613,17 @@ class HebrewCalendar {
6373
6613
 
6374
6614
 
6375
6615
  static getHolidaysForYearArray(year, il) {
6616
+ const cacheKey = `${year}-${il ? 1 : 0}`;
6617
+ let events = yearArrayCache[cacheKey];
6618
+
6619
+ if (events) {
6620
+ return events;
6621
+ }
6622
+
6376
6623
  const yearMap = getHolidaysForYear_(year);
6377
6624
  const startAbs = HDate.hebrew2abs(year, TISHREI, 1);
6378
6625
  const endAbs = HDate.hebrew2abs(year + 1, TISHREI, 1) - 1;
6379
- let events = [];
6626
+ events = [];
6380
6627
  const myFilter = il ? observedInIsrael : observedInDiaspora;
6381
6628
 
6382
6629
  for (let absDt = startAbs; absDt <= endAbs; absDt++) {
@@ -6389,6 +6636,7 @@ class HebrewCalendar {
6389
6636
  }
6390
6637
  }
6391
6638
 
6639
+ yearArrayCache[cacheKey] = events;
6392
6640
  return events;
6393
6641
  }
6394
6642
  /**
@@ -6466,6 +6714,54 @@ class HebrewCalendar {
6466
6714
  static getSedra(hyear, il) {
6467
6715
  return getSedra_(hyear, il);
6468
6716
  }
6717
+ /**
6718
+ * Return a number containing information on what Hallel is said on that day.
6719
+ *
6720
+ * Whole Hallel is said on Chanukah, the first Yom Tov of Pesach, Shavuot, Sukkot,
6721
+ * Yom Ha'atzmaut, and Yom Yerushalayim.
6722
+ *
6723
+ * Half Hallel is said on Rosh Chodesh (not Rosh Hashanah), and the last 6 days of Pesach.
6724
+ *
6725
+ * The number is one of the following values:
6726
+ *
6727
+ * 0 - No Hallel
6728
+ * 1 - Half Hallel
6729
+ * 2 - Whole Hallel
6730
+ *
6731
+ * @param {HDate} hdate
6732
+ * @param {boolean} il
6733
+ * @return {number}
6734
+ */
6735
+
6736
+
6737
+ static hallel(hdate, il) {
6738
+ const events = HebrewCalendar.getHolidaysForYearArray(hdate.getFullYear(), il);
6739
+ return hallel_(events, hdate);
6740
+ }
6741
+ /**
6742
+ * Return details on what Tachanun (or Tzidchatcha on Shabbat) is said on `hdate`.
6743
+ *
6744
+ * Tachanun is not said on Rosh Chodesh, the month of Nisan, Lag Baomer,
6745
+ * Rosh Chodesh Sivan until Isru Chag, Tisha B'av, 15 Av, Erev Rosh Hashanah,
6746
+ * Rosh Hashanah, Erev Yom Kippur until after Simchat Torah, Chanukah,
6747
+ * Tu B'shvat, Purim and Shushan Purim, and Purim and Shushan Purim Katan.
6748
+ *
6749
+ * In some congregations Tachanun is not said until from Rosh Chodesh Sivan
6750
+ * until 14th Sivan, Sukkot until after Rosh Chodesh Cheshvan, Pesach Sheini,
6751
+ * Yom Ha'atzmaut, and Yom Yerushalayim.
6752
+ *
6753
+ * Tachanun is not said at Mincha on days before it is not said at Shacharit.
6754
+ *
6755
+ * Tachanun is not said at Shacharit on Shabbat, but is at Mincha, usually.
6756
+ * @param {HDate} hdate
6757
+ * @param {boolean} il
6758
+ * @return {TachanunResult}
6759
+ */
6760
+
6761
+
6762
+ static tachanun(hdate, il) {
6763
+ return tachanun_(hdate, il);
6764
+ }
6469
6765
 
6470
6766
  }
6471
6767
  /**
@@ -6487,11 +6783,12 @@ function appendHolidayAndRelated(events, ev, options, candlesEv, dow) {
6487
6783
  return candlesEv; // holiday isn't observed here; bail out early
6488
6784
  }
6489
6785
 
6490
- if (ev instanceof YomKippurKatanEvent && !options.yomKippurKatan) {
6786
+ const eFlags = ev.getFlags();
6787
+
6788
+ if (!options.yomKippurKatan && eFlags & flags.YOM_KIPPUR_KATAN) {
6491
6789
  return candlesEv; // bail out early
6492
6790
  }
6493
6791
 
6494
- const eFlags = ev.getFlags();
6495
6792
  const location = options.location;
6496
6793
  const isMajorFast = Boolean(eFlags & MAJOR_FAST);
6497
6794
  const isMinorFast = Boolean(eFlags & MINOR_FAST);
@@ -6525,7 +6822,9 @@ function appendHolidayAndRelated(events, ev, options, candlesEv, dow) {
6525
6822
  }
6526
6823
  }
6527
6824
 
6528
- if (!options.noHolidays) {
6825
+ if (options.yomKippurKatan && eFlags & flags.YOM_KIPPUR_KATAN) {
6826
+ events.push(ev);
6827
+ } else if (!options.noHolidays) {
6529
6828
  events.push(ev); // the original event itself
6530
6829
  }
6531
6830
  }