@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/README.md +80 -4
- package/dist/bundle.js +927 -340
- package/dist/bundle.min.js +2 -2
- package/dist/greg0.mjs +20 -33
- package/dist/hdate-bundle.js +41 -37
- package/dist/hdate-bundle.min.js +2 -2
- package/dist/hdate.js +40 -36
- package/dist/hdate.mjs +34 -34
- package/dist/hdate0-bundle.js +21 -34
- package/dist/hdate0-bundle.min.js +2 -2
- package/dist/hdate0.mjs +19 -32
- package/dist/index.js +394 -95
- package/dist/index.mjs +394 -95
- package/hebcal.d.ts +45 -0
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v3.
|
|
1
|
+
/*! @hebcal/core v3.42.0 */
|
|
2
2
|
/*
|
|
3
3
|
* More minimal greg routines
|
|
4
4
|
*/
|
|
@@ -62,32 +62,11 @@ function daysInMonth$1(month, year) {
|
|
|
62
62
|
function isDate(obj) {
|
|
63
63
|
return typeof obj === 'object' && Date.prototype === obj.__proto__;
|
|
64
64
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
* @return {number}
|
|
70
|
-
*/
|
|
71
|
-
|
|
72
|
-
function dayOfYear(date) {
|
|
73
|
-
if (!isDate(date)) {
|
|
74
|
-
throw new TypeError(`Argument not a Date: ${date}`);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const month = date.getMonth();
|
|
78
|
-
let doy = date.getDate() + 31 * month;
|
|
79
|
-
|
|
80
|
-
if (month > 1) {
|
|
81
|
-
// FEB
|
|
82
|
-
doy -= Math.floor((4 * (month + 1) + 23) / 10);
|
|
83
|
-
|
|
84
|
-
if (isLeapYear$1(date.getFullYear())) {
|
|
85
|
-
doy++;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
65
|
+
/*
|
|
66
|
+
const ABS_14SEP1752 = 639797;
|
|
67
|
+
const ABS_2SEP1752 = 639785;
|
|
68
|
+
*/
|
|
88
69
|
|
|
89
|
-
return doy;
|
|
90
|
-
}
|
|
91
70
|
/**
|
|
92
71
|
* Converts Gregorian date to absolute R.D. (Rata Die) days
|
|
93
72
|
* @private
|
|
@@ -100,12 +79,14 @@ function greg2abs(date) {
|
|
|
100
79
|
throw new TypeError(`Argument not a Date: ${date}`);
|
|
101
80
|
}
|
|
102
81
|
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
82
|
+
const abs = toFixed(date.getFullYear(), date.getMonth() + 1, date.getDate());
|
|
83
|
+
/*
|
|
84
|
+
if (abs < ABS_14SEP1752 && abs > ABS_2SEP1752) {
|
|
85
|
+
throw new RangeError(`Invalid Date: ${date}`);
|
|
86
|
+
}
|
|
87
|
+
*/
|
|
88
|
+
|
|
89
|
+
return abs;
|
|
109
90
|
}
|
|
110
91
|
/**
|
|
111
92
|
* @private
|
|
@@ -128,8 +109,8 @@ function yearFromFixed(abs) {
|
|
|
128
109
|
/**
|
|
129
110
|
* @private
|
|
130
111
|
* @param {number} year
|
|
131
|
-
* @param {number} month
|
|
132
|
-
* @param {number} day
|
|
112
|
+
* @param {number} month (1-12)
|
|
113
|
+
* @param {number} day (1-31)
|
|
133
114
|
* @return {number}
|
|
134
115
|
*/
|
|
135
116
|
|
|
@@ -156,6 +137,12 @@ function abs2greg(abs) {
|
|
|
156
137
|
}
|
|
157
138
|
|
|
158
139
|
abs = Math.trunc(abs);
|
|
140
|
+
/*
|
|
141
|
+
if (abs < ABS_14SEP1752 && abs > ABS_2SEP1752) {
|
|
142
|
+
throw new RangeError(`Invalid Date: ${abs}`);
|
|
143
|
+
}
|
|
144
|
+
*/
|
|
145
|
+
|
|
159
146
|
const year = yearFromFixed(abs);
|
|
160
147
|
const priorDays = abs - toFixed(year, 1, 1);
|
|
161
148
|
const correction = abs < toFixed(year, 3, 1) ? 0 : isLeapYear$1(year) ? 1 : 2;
|
|
@@ -233,13 +220,30 @@ class greg {
|
|
|
233
220
|
}
|
|
234
221
|
/**
|
|
235
222
|
* Returns number of days since January 1 of that year
|
|
223
|
+
* @deprecated
|
|
236
224
|
* @param {Date} date Gregorian date
|
|
237
225
|
* @return {number}
|
|
238
226
|
*/
|
|
239
227
|
|
|
240
228
|
|
|
241
229
|
static dayOfYear(date) {
|
|
242
|
-
|
|
230
|
+
if (!isDate(date)) {
|
|
231
|
+
throw new TypeError(`Argument not a Date: ${date}`);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const month = date.getMonth();
|
|
235
|
+
let doy = date.getDate() + 31 * month;
|
|
236
|
+
|
|
237
|
+
if (month > 1) {
|
|
238
|
+
// FEB
|
|
239
|
+
doy -= Math.floor((4 * (month + 1) + 23) / 10);
|
|
240
|
+
|
|
241
|
+
if (isLeapYear$1(date.getFullYear())) {
|
|
242
|
+
doy++;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
return doy;
|
|
243
247
|
}
|
|
244
248
|
/**
|
|
245
249
|
* Converts Gregorian date to absolute R.D. (Rata Die) days
|
|
@@ -623,8 +627,8 @@ Locale.useLocale('en');
|
|
|
623
627
|
/*
|
|
624
628
|
* More minimal HDate
|
|
625
629
|
*/
|
|
626
|
-
const NISAN$
|
|
627
|
-
const IYYAR$
|
|
630
|
+
const NISAN$4 = 1;
|
|
631
|
+
const IYYAR$2 = 2; // const SIVAN = 3;
|
|
628
632
|
|
|
629
633
|
const TAMUZ$1 = 4; // const AV = 5;
|
|
630
634
|
|
|
@@ -713,7 +717,7 @@ function hebrew2abs(year, month, day) {
|
|
|
713
717
|
tempabs += daysInMonth(m, year);
|
|
714
718
|
}
|
|
715
719
|
|
|
716
|
-
for (let m = NISAN$
|
|
720
|
+
for (let m = NISAN$4; m < month; m++) {
|
|
717
721
|
tempabs += daysInMonth(m, year);
|
|
718
722
|
}
|
|
719
723
|
} else {
|
|
@@ -798,7 +802,7 @@ function monthsInYear(year) {
|
|
|
798
802
|
|
|
799
803
|
function daysInMonth(month, year) {
|
|
800
804
|
switch (month) {
|
|
801
|
-
case IYYAR$
|
|
805
|
+
case IYYAR$2:
|
|
802
806
|
case TAMUZ$1:
|
|
803
807
|
case ELUL$2:
|
|
804
808
|
case TEVET$2:
|
|
@@ -1926,7 +1930,10 @@ const flags = {
|
|
|
1926
1930
|
CHOL_HAMOED: 0x200000,
|
|
1927
1931
|
|
|
1928
1932
|
/** Mishna Yomi */
|
|
1929
|
-
MISHNA_YOMI: 0x400000
|
|
1933
|
+
MISHNA_YOMI: 0x400000,
|
|
1934
|
+
|
|
1935
|
+
/** Yom Kippur Katan, minor day of atonement on the day preceeding each Rosh Chodesh */
|
|
1936
|
+
YOM_KIPPUR_KATAN: 0x800000
|
|
1930
1937
|
};
|
|
1931
1938
|
/** Represents an Event with a title, date, and flags */
|
|
1932
1939
|
|
|
@@ -3347,6 +3354,7 @@ class Location {
|
|
|
3347
3354
|
}
|
|
3348
3355
|
/**
|
|
3349
3356
|
* Builds a city description from geonameid string components
|
|
3357
|
+
* @deprecated
|
|
3350
3358
|
* @param {string} cityName e.g. 'Tel Aviv' or 'Chicago'
|
|
3351
3359
|
* @param {string} admin1 e.g. 'England' or 'Massachusetts'
|
|
3352
3360
|
* @param {string} countryName full country name, e.g. 'Israel' or 'United States'
|
|
@@ -4484,7 +4492,7 @@ const SHAVUOT = 'Shavuot'; // 33
|
|
|
4484
4492
|
* @return {number[]}
|
|
4485
4493
|
*/
|
|
4486
4494
|
|
|
4487
|
-
function range(start, stop) {
|
|
4495
|
+
function range$1(start, stop) {
|
|
4488
4496
|
return Array.from({
|
|
4489
4497
|
length: stop - start + 1
|
|
4490
4498
|
}, (v, k) => k + start);
|
|
@@ -4502,78 +4510,78 @@ const types = {
|
|
|
4502
4510
|
/* Hebrew year that starts on Monday, is `incomplete' (Heshvan and
|
|
4503
4511
|
* Kislev each have 29 days), and has Passover start on Tuesday. */
|
|
4504
4512
|
// e.g. 5753
|
|
4505
|
-
'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)),
|
|
4513
|
+
'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)),
|
|
4506
4514
|
|
|
4507
4515
|
/* Hebrew year that starts on Monday, is `complete' (Heshvan and
|
|
4508
4516
|
* Kislev each have 30 days), and has Passover start on Thursday. */
|
|
4509
4517
|
// e.g. 5756
|
|
4510
|
-
'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)),
|
|
4518
|
+
'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)),
|
|
4511
4519
|
|
|
4512
4520
|
/* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29
|
|
4513
4521
|
* days and Kislev has 30 days), and has Passover start on Saturday. */
|
|
4514
4522
|
// e.g. 5701
|
|
4515
|
-
'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)),
|
|
4523
|
+
'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)),
|
|
4516
4524
|
|
|
4517
4525
|
/* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29
|
|
4518
4526
|
* days and Kislev has 30 days), and has Passover start on Saturday. */
|
|
4519
4527
|
// e.g. 5745
|
|
4520
|
-
'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)),
|
|
4528
|
+
'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)),
|
|
4521
4529
|
|
|
4522
4530
|
/* Hebrew year that starts on Thursday, is `complete' (Heshvan and
|
|
4523
4531
|
* Kislev each have 30 days), and has Passover start on Sunday. */
|
|
4524
4532
|
// e.g. 5754
|
|
4525
|
-
'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)),
|
|
4533
|
+
'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)),
|
|
4526
4534
|
|
|
4527
4535
|
/* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and Kislev
|
|
4528
4536
|
* each have 29 days), and has Passover start on Sunday. */
|
|
4529
4537
|
// e.g. 5761
|
|
4530
|
-
'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)),
|
|
4538
|
+
'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)),
|
|
4531
4539
|
|
|
4532
4540
|
/* Hebrew year that starts on Saturday, is `complete' (Heshvan and
|
|
4533
4541
|
* Kislev each have 30 days), and has Passover start on Tuesday. */
|
|
4534
4542
|
// e.g. 5716
|
|
4535
|
-
'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)),
|
|
4543
|
+
'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)),
|
|
4536
4544
|
|
|
4537
4545
|
/* -- The leap year types (keviot) -- */
|
|
4538
4546
|
|
|
4539
4547
|
/* Hebrew year that starts on Monday, is `incomplete' (Heshvan and
|
|
4540
4548
|
* Kislev each have 29 days), and has Passover start on Thursday. */
|
|
4541
4549
|
// e.g. 5746
|
|
4542
|
-
'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)),
|
|
4550
|
+
'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)),
|
|
4543
4551
|
|
|
4544
4552
|
/* Hebrew year that starts on Monday, is `incomplete' (Heshvan and
|
|
4545
4553
|
* Kislev each have 29 days), and has Passover start on Thursday. */
|
|
4546
4554
|
// e.g. 5746
|
|
4547
|
-
'1201': [51, 52].concat(CHMSUKOT, range(0, 27), CHMPESACH, range(28, 40), D(41), range(43, 49), D(50)),
|
|
4555
|
+
'1201': [51, 52].concat(CHMSUKOT, range$1(0, 27), CHMPESACH, range$1(28, 40), D(41), range$1(43, 49), D(50)),
|
|
4548
4556
|
|
|
4549
4557
|
/* Hebrew year that starts on Monday, is `complete' (Heshvan and
|
|
4550
4558
|
* Kislev each have 30 days), and has Passover start on Saturday. */
|
|
4551
4559
|
// e.g.5752
|
|
4552
|
-
'1220': [51, 52].concat(CHMSUKOT, range(0, 27), PESACH1, PESACH8, range(28, 40), D(41), range(43, 50)),
|
|
4560
|
+
'1220': [51, 52].concat(CHMSUKOT, range$1(0, 27), PESACH1, PESACH8, range$1(28, 40), D(41), range$1(43, 50)),
|
|
4553
4561
|
|
|
4554
4562
|
/* Hebrew year that starts on Monday, is `complete' (Heshvan and
|
|
4555
4563
|
* Kislev each have 30 days), and has Passover start on Saturday. */
|
|
4556
4564
|
// e.g.5752
|
|
4557
|
-
'1221': [51, 52].concat(CHMSUKOT, range(0, 27), PESACH, range(28, 50)),
|
|
4565
|
+
'1221': [51, 52].concat(CHMSUKOT, range$1(0, 27), PESACH, range$1(28, 50)),
|
|
4558
4566
|
|
|
4559
4567
|
/* Hebrew year that starts on Thursday, is `incomplete' (Heshvan and
|
|
4560
4568
|
* Kislev both have 29 days), and has Passover start on Sunday. */
|
|
4561
4569
|
// e.g. 5768
|
|
4562
|
-
'150': [52].concat(YK, CHMSUKOT, range(0, 28), PESACH7, range(29, 50)),
|
|
4570
|
+
'150': [52].concat(YK, CHMSUKOT, range$1(0, 28), PESACH7, range$1(29, 50)),
|
|
4563
4571
|
|
|
4564
4572
|
/* Hebrew year that starts on Thursday, is `complete' (Heshvan and
|
|
4565
4573
|
* Kislev both have 30 days), and has Passover start on Tuesday. */
|
|
4566
4574
|
// eg. 5771
|
|
4567
|
-
'152': [52].concat(YK, CHMSUKOT, range(0, 28), CHMPESACH, range(29, 49), D(50)),
|
|
4575
|
+
'152': [52].concat(YK, CHMSUKOT, range$1(0, 28), CHMPESACH, range$1(29, 49), D(50)),
|
|
4568
4576
|
|
|
4569
4577
|
/* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and
|
|
4570
4578
|
* Kislev each have 29 days), and has Passover start on Tuesday. */
|
|
4571
4579
|
// e.g.5757
|
|
4572
|
-
'170': [].concat(RH, 52, SUKKOT, SHMINI, range(0, 27), CHMPESACH, range(28, 40), D(41), range(43, 49), D(50)),
|
|
4580
|
+
'170': [].concat(RH, 52, SUKKOT, SHMINI, range$1(0, 27), CHMPESACH, range$1(28, 40), D(41), range$1(43, 49), D(50)),
|
|
4573
4581
|
|
|
4574
4582
|
/* Hebrew year that starts on Saturday, is `complete' (Heshvan and
|
|
4575
4583
|
* Kislev each have 30 days), and has Passover start on Thursday. */
|
|
4576
|
-
'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))
|
|
4584
|
+
'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))
|
|
4577
4585
|
};
|
|
4578
4586
|
/* Hebrew year that starts on Monday, is `complete' (Heshvan and
|
|
4579
4587
|
* Kislev each have 30 days), and has Passover start on Thursday. */
|
|
@@ -4675,6 +4683,70 @@ class ParshaEvent extends Event {
|
|
|
4675
4683
|
|
|
4676
4684
|
}
|
|
4677
4685
|
|
|
4686
|
+
const SUN$1 = 0;
|
|
4687
|
+
const TUE$1 = 2;
|
|
4688
|
+
const FRI$2 = 5;
|
|
4689
|
+
const SAT$2 = 6;
|
|
4690
|
+
const NISAN$3 = months.NISAN;
|
|
4691
|
+
const IYYAR$1 = months.IYYAR;
|
|
4692
|
+
/**
|
|
4693
|
+
* Yom HaShoah first observed in 1951.
|
|
4694
|
+
* When the actual date of Yom Hashoah falls on a Friday, the
|
|
4695
|
+
* state of Israel observes Yom Hashoah on the preceding
|
|
4696
|
+
* Thursday. When it falls on a Sunday, Yom Hashoah is observed
|
|
4697
|
+
* on the following Monday.
|
|
4698
|
+
* http://www.ushmm.org/remembrance/dor/calendar/
|
|
4699
|
+
* @private
|
|
4700
|
+
* @param {number} year
|
|
4701
|
+
* @return {HDate|null}
|
|
4702
|
+
*/
|
|
4703
|
+
|
|
4704
|
+
function dateYomHaShoah(year) {
|
|
4705
|
+
if (year < 5711) {
|
|
4706
|
+
return null;
|
|
4707
|
+
}
|
|
4708
|
+
|
|
4709
|
+
let nisan27dt = new HDate(27, NISAN$3, year);
|
|
4710
|
+
|
|
4711
|
+
if (nisan27dt.getDay() === FRI$2) {
|
|
4712
|
+
nisan27dt = new HDate(26, NISAN$3, year);
|
|
4713
|
+
} else if (nisan27dt.getDay() === SUN$1) {
|
|
4714
|
+
nisan27dt = new HDate(28, NISAN$3, year);
|
|
4715
|
+
}
|
|
4716
|
+
|
|
4717
|
+
return nisan27dt;
|
|
4718
|
+
}
|
|
4719
|
+
/**
|
|
4720
|
+
* Yom HaAtzma'ut only celebrated after 1948
|
|
4721
|
+
* @private
|
|
4722
|
+
* @param {number} year
|
|
4723
|
+
* @return {HDate|null}
|
|
4724
|
+
*/
|
|
4725
|
+
|
|
4726
|
+
function dateYomHaZikaron(year) {
|
|
4727
|
+
if (year < 5708) {
|
|
4728
|
+
return null;
|
|
4729
|
+
}
|
|
4730
|
+
|
|
4731
|
+
let day;
|
|
4732
|
+
const pesach = new HDate(15, NISAN$3, year);
|
|
4733
|
+
const pdow = pesach.getDay();
|
|
4734
|
+
|
|
4735
|
+
if (pdow === SUN$1) {
|
|
4736
|
+
day = 2;
|
|
4737
|
+
} else if (pdow === SAT$2) {
|
|
4738
|
+
day = 3;
|
|
4739
|
+
} else if (year < 5764) {
|
|
4740
|
+
day = 4;
|
|
4741
|
+
} else if (pdow === TUE$1) {
|
|
4742
|
+
day = 5;
|
|
4743
|
+
} else {
|
|
4744
|
+
day = 4;
|
|
4745
|
+
}
|
|
4746
|
+
|
|
4747
|
+
return new HDate(day, IYYAR$1, year);
|
|
4748
|
+
}
|
|
4749
|
+
|
|
4678
4750
|
/*
|
|
4679
4751
|
Hebcal - A Jewish Calendar Generator
|
|
4680
4752
|
Copyright (c) 1994-2020 Danny Sadinoff
|
|
@@ -4884,7 +4956,7 @@ class YomKippurKatanEvent extends HolidayEvent {
|
|
|
4884
4956
|
* @param {string} nextMonthName name of the upcoming month
|
|
4885
4957
|
*/
|
|
4886
4958
|
constructor(date, nextMonthName) {
|
|
4887
|
-
super(date, `${ykk} ${nextMonthName}`, flags.MINOR_FAST);
|
|
4959
|
+
super(date, `${ykk} ${nextMonthName}`, flags.MINOR_FAST | flags.YOM_KIPPUR_KATAN);
|
|
4888
4960
|
this.nextMonthName = nextMonthName;
|
|
4889
4961
|
this.memo = `Minor Day of Atonement on the day preceeding Rosh Chodesh ${nextMonthName}`;
|
|
4890
4962
|
}
|
|
@@ -5222,42 +5294,16 @@ function getHolidaysForYear_(year) {
|
|
|
5222
5294
|
}));
|
|
5223
5295
|
}
|
|
5224
5296
|
|
|
5225
|
-
|
|
5226
|
-
// Yom HaShoah first observed in 1951
|
|
5227
|
-
let nisan27dt = new HDate(27, NISAN$2, year);
|
|
5228
|
-
/* When the actual date of Yom Hashoah falls on a Friday, the
|
|
5229
|
-
* state of Israel observes Yom Hashoah on the preceding
|
|
5230
|
-
* Thursday. When it falls on a Sunday, Yom Hashoah is observed
|
|
5231
|
-
* on the following Monday.
|
|
5232
|
-
* http://www.ushmm.org/remembrance/dor/calendar/
|
|
5233
|
-
*/
|
|
5234
|
-
|
|
5235
|
-
if (nisan27dt.getDay() == FRI$1) {
|
|
5236
|
-
nisan27dt = new HDate(26, NISAN$2, year);
|
|
5237
|
-
} else if (nisan27dt.getDay() == SUN) {
|
|
5238
|
-
nisan27dt = new HDate(28, NISAN$2, year);
|
|
5239
|
-
}
|
|
5297
|
+
const nisan27dt = dateYomHaShoah(year);
|
|
5240
5298
|
|
|
5299
|
+
if (nisan27dt) {
|
|
5241
5300
|
add(new HolidayEvent(nisan27dt, 'Yom HaShoah', MODERN_HOLIDAY$1));
|
|
5242
5301
|
}
|
|
5243
5302
|
|
|
5244
|
-
|
|
5245
|
-
// Yom HaAtzma'ut only celebrated after 1948
|
|
5246
|
-
let day;
|
|
5247
|
-
|
|
5248
|
-
if (pesach.getDay() == SUN) {
|
|
5249
|
-
day = 2;
|
|
5250
|
-
} else if (pesach.getDay() == SAT$1) {
|
|
5251
|
-
day = 3;
|
|
5252
|
-
} else if (year < 5764) {
|
|
5253
|
-
day = 4;
|
|
5254
|
-
} else if (pesach.getDay() == TUE) {
|
|
5255
|
-
day = 5;
|
|
5256
|
-
} else {
|
|
5257
|
-
day = 4;
|
|
5258
|
-
}
|
|
5303
|
+
const yomHaZikaronDt = dateYomHaZikaron(year);
|
|
5259
5304
|
|
|
5260
|
-
|
|
5305
|
+
if (yomHaZikaronDt) {
|
|
5306
|
+
add(new HolidayEvent(yomHaZikaronDt, 'Yom HaZikaron', MODERN_HOLIDAY$1, emojiIsraelFlag), new HolidayEvent(yomHaZikaronDt.next(), 'Yom HaAtzma\'ut', MODERN_HOLIDAY$1, emojiIsraelFlag));
|
|
5261
5307
|
}
|
|
5262
5308
|
|
|
5263
5309
|
if (year >= 5727) {
|
|
@@ -5601,9 +5647,9 @@ function getBirthdayOrAnniversary_(hyear, gdate) {
|
|
|
5601
5647
|
return new HDate(day, month, hyear);
|
|
5602
5648
|
}
|
|
5603
5649
|
|
|
5604
|
-
const version="3.
|
|
5650
|
+
const version="3.42.0";
|
|
5605
5651
|
|
|
5606
|
-
const headers$1={"plural-forms":"nplurals=2; plural=(n > 1);",language:"en_CA@ashkenazi"};const 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};
|
|
5652
|
+
const headers$1={"plural-forms":"nplurals=2; plural=(n > 1);",language:"en_CA@ashkenazi"};const 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};
|
|
5607
5653
|
|
|
5608
5654
|
Locale.addLocale('ashkenazi', poAshkenazi);
|
|
5609
5655
|
Locale.addLocale('a', poAshkenazi);
|
|
@@ -5625,6 +5671,186 @@ const poHeNoNikud = {
|
|
|
5625
5671
|
};
|
|
5626
5672
|
Locale.addLocale('he-x-NoNikud', poHeNoNikud);
|
|
5627
5673
|
|
|
5674
|
+
const NONE$1 = 0;
|
|
5675
|
+
const HALF = 1;
|
|
5676
|
+
const WHOLE = 2;
|
|
5677
|
+
/**
|
|
5678
|
+
* @private
|
|
5679
|
+
* @param {Event[]} events
|
|
5680
|
+
* @param {HDate} hdate
|
|
5681
|
+
* @return {number}
|
|
5682
|
+
*/
|
|
5683
|
+
|
|
5684
|
+
function hallel_(events, hdate) {
|
|
5685
|
+
const whole = events.filter(ev => {
|
|
5686
|
+
/** @type {string} */
|
|
5687
|
+
const desc = ev.getDesc();
|
|
5688
|
+
/** @type {HDate} */
|
|
5689
|
+
|
|
5690
|
+
const hd = ev.getDate();
|
|
5691
|
+
const month = hd.getMonth();
|
|
5692
|
+
const mday = hd.getDate();
|
|
5693
|
+
return desc.startsWith('Chanukah') || desc.startsWith('Shavuot') || desc.startsWith('Sukkot') || month === months.NISAN && (mday === 15 || mday === 16) && ev.getFlags() & flags.CHAG || // Pesach
|
|
5694
|
+
desc === 'Yom HaAtzma\'ut' || desc === 'Yom Yerushalayim';
|
|
5695
|
+
}).map(ev => {
|
|
5696
|
+
return ev.getDate().abs();
|
|
5697
|
+
});
|
|
5698
|
+
const abs = hdate.abs();
|
|
5699
|
+
|
|
5700
|
+
if (whole.includes(abs)) {
|
|
5701
|
+
return WHOLE;
|
|
5702
|
+
}
|
|
5703
|
+
|
|
5704
|
+
const half = events.filter(ev => {
|
|
5705
|
+
const desc = ev.getDesc();
|
|
5706
|
+
return ev.getFlags() & flags.ROSH_CHODESH || desc.startsWith('Pesach') && desc !== 'Pesach I' && desc !== 'Pesach II';
|
|
5707
|
+
}).map(ev => {
|
|
5708
|
+
return ev.getDate().abs();
|
|
5709
|
+
});
|
|
5710
|
+
|
|
5711
|
+
if (half.includes(abs)) {
|
|
5712
|
+
return HALF;
|
|
5713
|
+
}
|
|
5714
|
+
|
|
5715
|
+
return NONE$1;
|
|
5716
|
+
}
|
|
5717
|
+
|
|
5718
|
+
/**
|
|
5719
|
+
* @private
|
|
5720
|
+
* @param {number} start
|
|
5721
|
+
* @param {number} end
|
|
5722
|
+
* @return {number[]}
|
|
5723
|
+
*/
|
|
5724
|
+
|
|
5725
|
+
function range(start, end) {
|
|
5726
|
+
const arr = [];
|
|
5727
|
+
|
|
5728
|
+
for (let i = start; i <= end; i++) {
|
|
5729
|
+
arr.push(i);
|
|
5730
|
+
}
|
|
5731
|
+
|
|
5732
|
+
return arr;
|
|
5733
|
+
}
|
|
5734
|
+
|
|
5735
|
+
const cache = Object.create(null);
|
|
5736
|
+
const NONE = {
|
|
5737
|
+
shacharit: false,
|
|
5738
|
+
mincha: false,
|
|
5739
|
+
allCongs: false
|
|
5740
|
+
};
|
|
5741
|
+
/**
|
|
5742
|
+
* @private
|
|
5743
|
+
* @param {HDate} hdate
|
|
5744
|
+
* @param {boolean} il
|
|
5745
|
+
* @return {TachanunResult}
|
|
5746
|
+
*/
|
|
5747
|
+
|
|
5748
|
+
function tachanun_(hdate, il) {
|
|
5749
|
+
return tachanun0(hdate, il, true);
|
|
5750
|
+
}
|
|
5751
|
+
/**
|
|
5752
|
+
* @private
|
|
5753
|
+
* @param {HDate} hdate
|
|
5754
|
+
* @param {boolean} il
|
|
5755
|
+
* @param {boolean} checkNext
|
|
5756
|
+
* @return {TachanunResult}
|
|
5757
|
+
*/
|
|
5758
|
+
|
|
5759
|
+
function tachanun0(hdate, il, checkNext) {
|
|
5760
|
+
const year = hdate.getFullYear();
|
|
5761
|
+
const key = `${year}-${il ? 1 : 0}`;
|
|
5762
|
+
const dates = cache[key] = cache[key] || tachanunYear(year, il);
|
|
5763
|
+
const abs = hdate.abs();
|
|
5764
|
+
|
|
5765
|
+
if (dates.none.indexOf(abs) > -1) {
|
|
5766
|
+
return NONE;
|
|
5767
|
+
}
|
|
5768
|
+
|
|
5769
|
+
const dow = hdate.getDay();
|
|
5770
|
+
const ret = {
|
|
5771
|
+
shacharit: false,
|
|
5772
|
+
mincha: false,
|
|
5773
|
+
allCongs: false
|
|
5774
|
+
};
|
|
5775
|
+
|
|
5776
|
+
if (dates.some.indexOf(abs) === -1) {
|
|
5777
|
+
ret.allCongs = true;
|
|
5778
|
+
}
|
|
5779
|
+
|
|
5780
|
+
if (dow !== 6) {
|
|
5781
|
+
ret.shacharit = true;
|
|
5782
|
+
}
|
|
5783
|
+
|
|
5784
|
+
const tomorrow = abs + 1;
|
|
5785
|
+
|
|
5786
|
+
if (checkNext && dates.yesPrev.indexOf(tomorrow) === -1) {
|
|
5787
|
+
const tmp = tachanun0(new HDate(tomorrow), il, false);
|
|
5788
|
+
ret.mincha = tmp.shacharit;
|
|
5789
|
+
} else {
|
|
5790
|
+
ret.mincha = dow !== 5;
|
|
5791
|
+
}
|
|
5792
|
+
|
|
5793
|
+
if (ret.allCongs && !ret.mincha && !ret.shacharit) {
|
|
5794
|
+
return NONE;
|
|
5795
|
+
}
|
|
5796
|
+
|
|
5797
|
+
return ret;
|
|
5798
|
+
}
|
|
5799
|
+
/**
|
|
5800
|
+
* @private
|
|
5801
|
+
* @param {number} year
|
|
5802
|
+
* @param {boolean} il
|
|
5803
|
+
* @return {*}
|
|
5804
|
+
*/
|
|
5805
|
+
|
|
5806
|
+
|
|
5807
|
+
function tachanunYear(year, il) {
|
|
5808
|
+
const leap = HDate.isLeapYear(year);
|
|
5809
|
+
const monthsInYear = 12 + leap;
|
|
5810
|
+
let av9dt = new HDate(9, months.AV, year);
|
|
5811
|
+
|
|
5812
|
+
if (av9dt.getDay() === 6) {
|
|
5813
|
+
av9dt = av9dt.next();
|
|
5814
|
+
}
|
|
5815
|
+
|
|
5816
|
+
let shushPurim = new HDate(15, months.ADAR_II, year);
|
|
5817
|
+
|
|
5818
|
+
if (shushPurim.getDay() === 6) {
|
|
5819
|
+
shushPurim = shushPurim.next();
|
|
5820
|
+
}
|
|
5821
|
+
|
|
5822
|
+
const none = [].concat( // Rosh Chodesh - 1st of every month. Also includes RH day 1 (1 Tishrei)
|
|
5823
|
+
range(1, monthsInYear).map(month => new HDate(1, month, year)), // Rosh Chodesh - 30th of months that have one
|
|
5824
|
+
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
|
|
5825
|
+
// entire month of Nisan
|
|
5826
|
+
range(1, HDate.daysInMonth(months.NISAN, year)).map(mday => new HDate(mday, months.NISAN, year)), new HDate(18, months.IYYAR, year), // Lag BaOmer
|
|
5827
|
+
// Rosh Chodesh Sivan thru Isru Chag
|
|
5828
|
+
range(1, 8 - (il ? 1 : 0)).map(mday => new HDate(mday, months.SIVAN, year)), av9dt, // Tisha B'Av
|
|
5829
|
+
new HDate(15, months.AV, year), // Tu B'Av
|
|
5830
|
+
new HDate(29, months.ELUL, year), // Erev Rosh Hashanah
|
|
5831
|
+
// Erev Yom Kippur thru Isru Chag
|
|
5832
|
+
range(9, 24 - (il ? 1 : 0)).map(mday => new HDate(mday, months.TISHREI, year)), // Chanukah
|
|
5833
|
+
range(25, 33).map(mday => new HDate(mday, months.KISLEV, year)), new HDate(15, months.SHVAT, year), // Tu BiShvat
|
|
5834
|
+
new HDate(14, months.ADAR_II, year), // Purim
|
|
5835
|
+
shushPurim, leap ? new HDate(14, months.ADAR_I, year) : [] // Purim Katan
|
|
5836
|
+
);
|
|
5837
|
+
const some = [].concat( // Until 14 Sivan
|
|
5838
|
+
range(1, 13).map(mday => new HDate(mday, months.SIVAN, year)), // Until after Rosh Chodesh Cheshvan
|
|
5839
|
+
range(20, 31).map(mday => new HDate(mday, months.TISHREI, year)), new HDate(14, months.IYYAR, year), // Pesach Sheini
|
|
5840
|
+
// Yom HaAtzma'ut, which changes based on day of week
|
|
5841
|
+
year >= 5708 ? dateYomHaZikaron(year).next() : [], // Yom Yerushalayim
|
|
5842
|
+
year >= 5727 ? new HDate(28, months.IYYAR, year) : []);
|
|
5843
|
+
const yesPrev = [].concat(new HDate(29, months.ELUL, year - 1), // Erev Rosh Hashanah
|
|
5844
|
+
new HDate(9, months.TISHREI, year), // Erev Yom Kippur
|
|
5845
|
+
new HDate(14, months.IYYAR, year) // Pesach Sheini
|
|
5846
|
+
);
|
|
5847
|
+
return {
|
|
5848
|
+
none: none.map(hd => hd.abs()).sort(),
|
|
5849
|
+
some: some.map(hd => hd.abs()).sort(),
|
|
5850
|
+
yesPrev: yesPrev.map(hd => hd.abs()).sort()
|
|
5851
|
+
};
|
|
5852
|
+
}
|
|
5853
|
+
|
|
5628
5854
|
/*
|
|
5629
5855
|
Hebcal - A Jewish Calendar Generator
|
|
5630
5856
|
Copyright (c) 1994-2020 Danny Sadinoff
|
|
@@ -5819,6 +6045,13 @@ function checkCandleOptions(options) {
|
|
|
5819
6045
|
* Possible values are `true` and `false`; the default is locale dependent.
|
|
5820
6046
|
*/
|
|
5821
6047
|
|
|
6048
|
+
/**
|
|
6049
|
+
* @typedef {Object} TachanunResult
|
|
6050
|
+
* @property {boolean} shacharit Tachanun is said at Shacharit
|
|
6051
|
+
* @property {boolean} mincha Tachanun is said at Mincha
|
|
6052
|
+
* @property {boolean} allCongs All congregations say Tachanun on the day
|
|
6053
|
+
*/
|
|
6054
|
+
|
|
5822
6055
|
/**
|
|
5823
6056
|
* Gets the R.D. days for a number, Date, or HDate
|
|
5824
6057
|
* @private
|
|
@@ -5929,6 +6162,7 @@ function getMaskFromOptions(options) {
|
|
|
5929
6162
|
if (m & OMER_COUNT) options.omer = true;
|
|
5930
6163
|
if (m & SHABBAT_MEVARCHIM) options.shabbatMevarchim = true;
|
|
5931
6164
|
if (m & flags.MISHNA_YOMI) options.mishnaYomi = true;
|
|
6165
|
+
if (m & flags.YOM_KIPPUR_KATAN) options.yomKippurKatan = true;
|
|
5932
6166
|
options.userMask = true;
|
|
5933
6167
|
return m;
|
|
5934
6168
|
}
|
|
@@ -5989,6 +6223,10 @@ function getMaskFromOptions(options) {
|
|
|
5989
6223
|
mask |= SHABBAT_MEVARCHIM;
|
|
5990
6224
|
}
|
|
5991
6225
|
|
|
6226
|
+
if (options.yomKippurKatan) {
|
|
6227
|
+
mask |= flags.YOM_KIPPUR_KATAN;
|
|
6228
|
+
}
|
|
6229
|
+
|
|
5992
6230
|
return mask;
|
|
5993
6231
|
}
|
|
5994
6232
|
|
|
@@ -6027,6 +6265,8 @@ function observedInIsrael(ev) {
|
|
|
6027
6265
|
function observedInDiaspora(ev) {
|
|
6028
6266
|
return ev.observedInDiaspora();
|
|
6029
6267
|
}
|
|
6268
|
+
|
|
6269
|
+
const yearArrayCache = Object.create(null);
|
|
6030
6270
|
/**
|
|
6031
6271
|
* HebrewCalendar is the main interface to the `@hebcal/core` library.
|
|
6032
6272
|
* This namespace is used to calculate holidays, rosh chodesh, candle lighting & havdalah times,
|
|
@@ -6034,7 +6274,6 @@ function observedInDiaspora(ev) {
|
|
|
6034
6274
|
* Event names can be rendered in several languges using the `locale` option.
|
|
6035
6275
|
*/
|
|
6036
6276
|
|
|
6037
|
-
|
|
6038
6277
|
class HebrewCalendar {
|
|
6039
6278
|
/**
|
|
6040
6279
|
* Calculates holidays and other Hebrew calendar events based on {@link CalOptions}.
|
|
@@ -6071,6 +6310,7 @@ class HebrewCalendar {
|
|
|
6071
6310
|
* * Mishna Yomi (`options.mishnaYomi`)
|
|
6072
6311
|
* * Shabbat Mevarchim HaChodesh on Saturday before Rosh Chodesh (`options.shabbatMevarchim`)
|
|
6073
6312
|
* * Molad announcement on Saturday before Rosh Chodesh (`options.molad`)
|
|
6313
|
+
* * Yom Kippur Katan (`options.yomKippurKatan`)
|
|
6074
6314
|
*
|
|
6075
6315
|
* Candle-lighting and Havdalah times are approximated using latitude and longitude
|
|
6076
6316
|
* specified by the {@link Location} class. The `Location` class contains a small
|
|
@@ -6369,10 +6609,17 @@ class HebrewCalendar {
|
|
|
6369
6609
|
|
|
6370
6610
|
|
|
6371
6611
|
static getHolidaysForYearArray(year, il) {
|
|
6612
|
+
const cacheKey = `${year}-${il ? 1 : 0}`;
|
|
6613
|
+
let events = yearArrayCache[cacheKey];
|
|
6614
|
+
|
|
6615
|
+
if (events) {
|
|
6616
|
+
return events;
|
|
6617
|
+
}
|
|
6618
|
+
|
|
6372
6619
|
const yearMap = getHolidaysForYear_(year);
|
|
6373
6620
|
const startAbs = HDate.hebrew2abs(year, TISHREI, 1);
|
|
6374
6621
|
const endAbs = HDate.hebrew2abs(year + 1, TISHREI, 1) - 1;
|
|
6375
|
-
|
|
6622
|
+
events = [];
|
|
6376
6623
|
const myFilter = il ? observedInIsrael : observedInDiaspora;
|
|
6377
6624
|
|
|
6378
6625
|
for (let absDt = startAbs; absDt <= endAbs; absDt++) {
|
|
@@ -6385,6 +6632,7 @@ class HebrewCalendar {
|
|
|
6385
6632
|
}
|
|
6386
6633
|
}
|
|
6387
6634
|
|
|
6635
|
+
yearArrayCache[cacheKey] = events;
|
|
6388
6636
|
return events;
|
|
6389
6637
|
}
|
|
6390
6638
|
/**
|
|
@@ -6462,6 +6710,54 @@ class HebrewCalendar {
|
|
|
6462
6710
|
static getSedra(hyear, il) {
|
|
6463
6711
|
return getSedra_(hyear, il);
|
|
6464
6712
|
}
|
|
6713
|
+
/**
|
|
6714
|
+
* Return a number containing information on what Hallel is said on that day.
|
|
6715
|
+
*
|
|
6716
|
+
* Whole Hallel is said on Chanukah, the first Yom Tov of Pesach, Shavuot, Sukkot,
|
|
6717
|
+
* Yom Ha'atzmaut, and Yom Yerushalayim.
|
|
6718
|
+
*
|
|
6719
|
+
* Half Hallel is said on Rosh Chodesh (not Rosh Hashanah), and the last 6 days of Pesach.
|
|
6720
|
+
*
|
|
6721
|
+
* The number is one of the following values:
|
|
6722
|
+
*
|
|
6723
|
+
* 0 - No Hallel
|
|
6724
|
+
* 1 - Half Hallel
|
|
6725
|
+
* 2 - Whole Hallel
|
|
6726
|
+
*
|
|
6727
|
+
* @param {HDate} hdate
|
|
6728
|
+
* @param {boolean} il
|
|
6729
|
+
* @return {number}
|
|
6730
|
+
*/
|
|
6731
|
+
|
|
6732
|
+
|
|
6733
|
+
static hallel(hdate, il) {
|
|
6734
|
+
const events = HebrewCalendar.getHolidaysForYearArray(hdate.getFullYear(), il);
|
|
6735
|
+
return hallel_(events, hdate);
|
|
6736
|
+
}
|
|
6737
|
+
/**
|
|
6738
|
+
* Return details on what Tachanun (or Tzidchatcha on Shabbat) is said on `hdate`.
|
|
6739
|
+
*
|
|
6740
|
+
* Tachanun is not said on Rosh Chodesh, the month of Nisan, Lag Baomer,
|
|
6741
|
+
* Rosh Chodesh Sivan until Isru Chag, Tisha B'av, 15 Av, Erev Rosh Hashanah,
|
|
6742
|
+
* Rosh Hashanah, Erev Yom Kippur until after Simchat Torah, Chanukah,
|
|
6743
|
+
* Tu B'shvat, Purim and Shushan Purim, and Purim and Shushan Purim Katan.
|
|
6744
|
+
*
|
|
6745
|
+
* In some congregations Tachanun is not said until from Rosh Chodesh Sivan
|
|
6746
|
+
* until 14th Sivan, Sukkot until after Rosh Chodesh Cheshvan, Pesach Sheini,
|
|
6747
|
+
* Yom Ha'atzmaut, and Yom Yerushalayim.
|
|
6748
|
+
*
|
|
6749
|
+
* Tachanun is not said at Mincha on days before it is not said at Shacharit.
|
|
6750
|
+
*
|
|
6751
|
+
* Tachanun is not said at Shacharit on Shabbat, but is at Mincha, usually.
|
|
6752
|
+
* @param {HDate} hdate
|
|
6753
|
+
* @param {boolean} il
|
|
6754
|
+
* @return {TachanunResult}
|
|
6755
|
+
*/
|
|
6756
|
+
|
|
6757
|
+
|
|
6758
|
+
static tachanun(hdate, il) {
|
|
6759
|
+
return tachanun_(hdate, il);
|
|
6760
|
+
}
|
|
6465
6761
|
|
|
6466
6762
|
}
|
|
6467
6763
|
/**
|
|
@@ -6483,11 +6779,12 @@ function appendHolidayAndRelated(events, ev, options, candlesEv, dow) {
|
|
|
6483
6779
|
return candlesEv; // holiday isn't observed here; bail out early
|
|
6484
6780
|
}
|
|
6485
6781
|
|
|
6486
|
-
|
|
6782
|
+
const eFlags = ev.getFlags();
|
|
6783
|
+
|
|
6784
|
+
if (!options.yomKippurKatan && eFlags & flags.YOM_KIPPUR_KATAN) {
|
|
6487
6785
|
return candlesEv; // bail out early
|
|
6488
6786
|
}
|
|
6489
6787
|
|
|
6490
|
-
const eFlags = ev.getFlags();
|
|
6491
6788
|
const location = options.location;
|
|
6492
6789
|
const isMajorFast = Boolean(eFlags & MAJOR_FAST);
|
|
6493
6790
|
const isMinorFast = Boolean(eFlags & MINOR_FAST);
|
|
@@ -6521,7 +6818,9 @@ function appendHolidayAndRelated(events, ev, options, candlesEv, dow) {
|
|
|
6521
6818
|
}
|
|
6522
6819
|
}
|
|
6523
6820
|
|
|
6524
|
-
if (
|
|
6821
|
+
if (options.yomKippurKatan && eFlags & flags.YOM_KIPPUR_KATAN) {
|
|
6822
|
+
events.push(ev);
|
|
6823
|
+
} else if (!options.noHolidays) {
|
|
6525
6824
|
events.push(ev); // the original event itself
|
|
6526
6825
|
}
|
|
6527
6826
|
}
|