@hebcal/rest-api 5.1.4 → 6.0.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/bundle.js +4581 -284
- package/dist/bundle.min.js +46 -2
- package/dist/common.d.ts +1 -1
- package/dist/fullcalendar.js +4308 -46
- package/dist/fullcalendar.min.js +46 -2
- package/dist/index.mjs +130 -507
- package/package.json +18 -16
- package/dist/index.cjs +0 -1502
- package/dist/module.d.ts +0 -117
package/dist/fullcalendar.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
/*! @hebcal/rest-api
|
|
2
|
-
var hebcalFullCalendar = (function (exports, core
|
|
1
|
+
/*! @hebcal/rest-api v6.0.0 */
|
|
2
|
+
var hebcalFullCalendar = (function (exports, core) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
|
+
/*! @hebcal/hdate v0.12.0 */
|
|
5
6
|
/* eslint-disable @typescript-eslint/no-namespace, no-inner-declarations */
|
|
6
7
|
/** @private */
|
|
7
8
|
const lengths = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
@@ -11,7 +12,7 @@ monthLengths[1][2] = 29;
|
|
|
11
12
|
/**
|
|
12
13
|
* @private
|
|
13
14
|
*/
|
|
14
|
-
function mod(x, y) {
|
|
15
|
+
function mod$1(x, y) {
|
|
15
16
|
return x - y * Math.floor(x / y);
|
|
16
17
|
}
|
|
17
18
|
/**
|
|
@@ -27,11 +28,11 @@ function quotient(x, y) {
|
|
|
27
28
|
function yearFromFixed(abs) {
|
|
28
29
|
const l0 = abs - 1;
|
|
29
30
|
const n400 = quotient(l0, 146097);
|
|
30
|
-
const d1 = mod(l0, 146097);
|
|
31
|
+
const d1 = mod$1(l0, 146097);
|
|
31
32
|
const n100 = quotient(d1, 36524);
|
|
32
|
-
const d2 = mod(d1, 36524);
|
|
33
|
+
const d2 = mod$1(d1, 36524);
|
|
33
34
|
const n4 = quotient(d2, 1461);
|
|
34
|
-
const d3 = mod(d2, 1461);
|
|
35
|
+
const d3 = mod$1(d2, 1461);
|
|
35
36
|
const n1 = quotient(d3, 365);
|
|
36
37
|
const year = 400 * n400 + 100 * n100 + 4 * n4 + n1;
|
|
37
38
|
return n100 !== 4 && n1 !== 4 ? year + 1 : year;
|
|
@@ -104,7 +105,18 @@ function greg2abs(date) {
|
|
|
104
105
|
* Three Historical Calendars'' by E. M. Reingold, N. Dershowitz, and S. M.
|
|
105
106
|
* Clamen, Software--Practice and Experience, Volume 23, Number 4
|
|
106
107
|
* (April, 1993), pages 383-404 for an explanation.
|
|
108
|
+
*
|
|
109
|
+
* Note that this function returns the daytime portion of the date.
|
|
110
|
+
* For example, the 15th of Cheshvan 5769 began at sundown on
|
|
111
|
+
* 12 November 2008 and continues through 13 November 2008. This
|
|
112
|
+
* function would return only the date 13 November 2008.
|
|
107
113
|
* @param abs - R.D. number of days
|
|
114
|
+
* @example
|
|
115
|
+
* const abs = hebrew2abs(5769, months.CHESHVAN, 15);
|
|
116
|
+
* const date = abs2greg(abs); // 13 November 2008
|
|
117
|
+
* const year = date.getFullYear(); // 2008
|
|
118
|
+
* const monthNum = date.getMonth() + 1; // 11
|
|
119
|
+
* const day = date.getDate(); // 13
|
|
108
120
|
*/
|
|
109
121
|
function abs2greg(abs) {
|
|
110
122
|
if (typeof abs !== 'number') {
|
|
@@ -128,6 +140,8 @@ function abs2greg(abs) {
|
|
|
128
140
|
return dt;
|
|
129
141
|
}
|
|
130
142
|
|
|
143
|
+
/*! @hebcal/hdate v0.12.0 */
|
|
144
|
+
|
|
131
145
|
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-namespace */
|
|
132
146
|
/**
|
|
133
147
|
* Gregorian date helper functions
|
|
@@ -141,6 +155,392 @@ greg.greg2abs = greg2abs;
|
|
|
141
155
|
greg.isDate = isDate;
|
|
142
156
|
greg.isLeapYear = isGregLeapYear;
|
|
143
157
|
|
|
158
|
+
/*! @hebcal/hdate v0.12.0 */
|
|
159
|
+
/*
|
|
160
|
+
* More minimal HDate
|
|
161
|
+
*/
|
|
162
|
+
const NISAN$2 = 1;
|
|
163
|
+
const IYYAR$1 = 2;
|
|
164
|
+
const SIVAN = 3;
|
|
165
|
+
const TAMUZ$1 = 4;
|
|
166
|
+
const AV$1 = 5;
|
|
167
|
+
const ELUL = 6;
|
|
168
|
+
const TISHREI$1 = 7;
|
|
169
|
+
const CHESHVAN = 8;
|
|
170
|
+
const KISLEV$1 = 9;
|
|
171
|
+
const TEVET$1 = 10;
|
|
172
|
+
const SHVAT = 11;
|
|
173
|
+
const ADAR_I$1 = 12;
|
|
174
|
+
const ADAR_II$1 = 13;
|
|
175
|
+
/**
|
|
176
|
+
* Hebrew months of the year (NISAN=1, TISHREI=7)
|
|
177
|
+
* @readonly
|
|
178
|
+
* @enum {number}
|
|
179
|
+
*/
|
|
180
|
+
const months = {
|
|
181
|
+
/** Nissan / ניסן */
|
|
182
|
+
NISAN: NISAN$2,
|
|
183
|
+
/** Iyyar / אייר */
|
|
184
|
+
IYYAR: IYYAR$1,
|
|
185
|
+
/** Sivan / סיון */
|
|
186
|
+
SIVAN,
|
|
187
|
+
/** Tamuz (sometimes Tammuz) / תמוז */
|
|
188
|
+
TAMUZ: TAMUZ$1,
|
|
189
|
+
/** Av / אב */
|
|
190
|
+
AV: AV$1,
|
|
191
|
+
/** Elul / אלול */
|
|
192
|
+
ELUL,
|
|
193
|
+
/** Tishrei / תִּשְׁרֵי */
|
|
194
|
+
TISHREI: TISHREI$1,
|
|
195
|
+
/** Cheshvan / חשון */
|
|
196
|
+
CHESHVAN,
|
|
197
|
+
/** Kislev / כסלו */
|
|
198
|
+
KISLEV: KISLEV$1,
|
|
199
|
+
/** Tevet / טבת */
|
|
200
|
+
TEVET: TEVET$1,
|
|
201
|
+
/** Sh'vat / שבט */
|
|
202
|
+
SHVAT,
|
|
203
|
+
/** Adar or Adar Rishon / אדר */
|
|
204
|
+
ADAR_I: ADAR_I$1,
|
|
205
|
+
/** Adar Sheini (only on leap years) / אדר ב׳ */
|
|
206
|
+
ADAR_II: ADAR_II$1,
|
|
207
|
+
};
|
|
208
|
+
const monthNames0 = [
|
|
209
|
+
'',
|
|
210
|
+
'Nisan',
|
|
211
|
+
'Iyyar',
|
|
212
|
+
'Sivan',
|
|
213
|
+
'Tamuz',
|
|
214
|
+
'Av',
|
|
215
|
+
'Elul',
|
|
216
|
+
'Tishrei',
|
|
217
|
+
'Cheshvan',
|
|
218
|
+
'Kislev',
|
|
219
|
+
'Tevet',
|
|
220
|
+
"Sh'vat",
|
|
221
|
+
];
|
|
222
|
+
/**
|
|
223
|
+
* Transliterations of Hebrew month names.
|
|
224
|
+
* Regular years are index 0 and leap years are index 1.
|
|
225
|
+
* @private
|
|
226
|
+
*/
|
|
227
|
+
const monthNames = [
|
|
228
|
+
monthNames0.concat(['Adar', 'Nisan']),
|
|
229
|
+
monthNames0.concat(['Adar I', 'Adar II', 'Nisan']),
|
|
230
|
+
];
|
|
231
|
+
const edCache = new Map();
|
|
232
|
+
const EPOCH = -1373428;
|
|
233
|
+
// Avg year length in the cycle (19 solar years with 235 lunar months)
|
|
234
|
+
const AVG_HEBYEAR_DAYS = 365.24682220597794;
|
|
235
|
+
/**
|
|
236
|
+
* @private
|
|
237
|
+
*/
|
|
238
|
+
function assertNumber(n, name) {
|
|
239
|
+
if (typeof n !== 'number' || isNaN(n)) {
|
|
240
|
+
throw new TypeError(`invalid parameter '${name}' not a number: ${n}`);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Converts Hebrew date to R.D. (Rata Die) fixed days.
|
|
245
|
+
* R.D. 1 is the imaginary date Monday, January 1, 1 on the Gregorian
|
|
246
|
+
* Calendar.
|
|
247
|
+
* @param year Hebrew year
|
|
248
|
+
* @param month Hebrew month
|
|
249
|
+
* @param day Hebrew date (1-30)
|
|
250
|
+
* @example
|
|
251
|
+
* const abs = hebrew2abs(5769, months.CHESHVAN, 15);
|
|
252
|
+
*/
|
|
253
|
+
function hebrew2abs(year, month, day) {
|
|
254
|
+
assertNumber(year, 'year');
|
|
255
|
+
assertNumber(month, 'month');
|
|
256
|
+
assertNumber(day, 'day');
|
|
257
|
+
if (year < 1) {
|
|
258
|
+
throw new RangeError(`hebrew2abs: invalid year ${year}`);
|
|
259
|
+
}
|
|
260
|
+
let tempabs = day;
|
|
261
|
+
if (month < TISHREI$1) {
|
|
262
|
+
for (let m = TISHREI$1; m <= monthsInYear(year); m++) {
|
|
263
|
+
tempabs += daysInMonth(m, year);
|
|
264
|
+
}
|
|
265
|
+
for (let m = NISAN$2; m < month; m++) {
|
|
266
|
+
tempabs += daysInMonth(m, year);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
for (let m = TISHREI$1; m < month; m++) {
|
|
271
|
+
tempabs += daysInMonth(m, year);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
return EPOCH + elapsedDays(year) + tempabs - 1;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* @private
|
|
278
|
+
*/
|
|
279
|
+
function newYear(year) {
|
|
280
|
+
return EPOCH + elapsedDays(year);
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Converts absolute R.D. days to Hebrew date
|
|
284
|
+
* @param abs absolute R.D. days
|
|
285
|
+
*/
|
|
286
|
+
function abs2hebrew(abs) {
|
|
287
|
+
assertNumber(abs, 'abs');
|
|
288
|
+
abs = Math.trunc(abs);
|
|
289
|
+
if (abs <= EPOCH) {
|
|
290
|
+
throw new RangeError(`abs2hebrew: ${abs} is before epoch`);
|
|
291
|
+
}
|
|
292
|
+
// first, quickly approximate year
|
|
293
|
+
let year = Math.floor((abs - EPOCH) / AVG_HEBYEAR_DAYS);
|
|
294
|
+
while (newYear(year) <= abs) {
|
|
295
|
+
++year;
|
|
296
|
+
}
|
|
297
|
+
--year;
|
|
298
|
+
let month = abs < hebrew2abs(year, 1, 1) ? 7 : 1;
|
|
299
|
+
while (abs > hebrew2abs(year, month, daysInMonth(month, year))) {
|
|
300
|
+
++month;
|
|
301
|
+
}
|
|
302
|
+
const day = 1 + abs - hebrew2abs(year, month, 1);
|
|
303
|
+
return { yy: year, mm: month, dd: day };
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Returns true if Hebrew year is a leap year
|
|
307
|
+
* @param year Hebrew year
|
|
308
|
+
*/
|
|
309
|
+
function isLeapYear(year) {
|
|
310
|
+
return (1 + year * 7) % 19 < 7;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Number of months in this Hebrew year (either 12 or 13 depending on leap year)
|
|
314
|
+
* @param year Hebrew year
|
|
315
|
+
*/
|
|
316
|
+
function monthsInYear(year) {
|
|
317
|
+
return 12 + +isLeapYear(year); // boolean is cast to 1 or 0
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Number of days in Hebrew month in a given year (29 or 30)
|
|
321
|
+
* @param month Hebrew month (e.g. months.TISHREI)
|
|
322
|
+
* @param year Hebrew year
|
|
323
|
+
*/
|
|
324
|
+
function daysInMonth(month, year) {
|
|
325
|
+
switch (month) {
|
|
326
|
+
case IYYAR$1:
|
|
327
|
+
case TAMUZ$1:
|
|
328
|
+
case ELUL:
|
|
329
|
+
case TEVET$1:
|
|
330
|
+
case ADAR_II$1:
|
|
331
|
+
return 29;
|
|
332
|
+
}
|
|
333
|
+
if ((month === ADAR_I$1 && !isLeapYear(year)) ||
|
|
334
|
+
(month === CHESHVAN && !longCheshvan(year)) ||
|
|
335
|
+
(month === KISLEV$1 && shortKislev(year))) {
|
|
336
|
+
return 29;
|
|
337
|
+
}
|
|
338
|
+
else {
|
|
339
|
+
return 30;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Returns a transliterated string name of Hebrew month in year,
|
|
344
|
+
* for example 'Elul' or 'Cheshvan'.
|
|
345
|
+
* @param month Hebrew month (e.g. months.TISHREI)
|
|
346
|
+
* @param year Hebrew year
|
|
347
|
+
*/
|
|
348
|
+
function getMonthName(month, year) {
|
|
349
|
+
assertNumber(month, 'month');
|
|
350
|
+
assertNumber(year, 'year');
|
|
351
|
+
if (month < 1 || month > 14) {
|
|
352
|
+
throw new TypeError(`bad month argument ${month}`);
|
|
353
|
+
}
|
|
354
|
+
return monthNames[+isLeapYear(year)][month];
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Days from sunday prior to start of Hebrew calendar to mean
|
|
358
|
+
* conjunction of Tishrei in Hebrew YEAR
|
|
359
|
+
* @param year Hebrew year
|
|
360
|
+
*/
|
|
361
|
+
function elapsedDays(year) {
|
|
362
|
+
const n = edCache.get(year);
|
|
363
|
+
if (typeof n === 'number') {
|
|
364
|
+
return n;
|
|
365
|
+
}
|
|
366
|
+
const elapsed = elapsedDays0(year);
|
|
367
|
+
edCache.set(year, elapsed);
|
|
368
|
+
return elapsed;
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Days from sunday prior to start of Hebrew calendar to mean
|
|
372
|
+
* conjunction of Tishrei in Hebrew YEAR
|
|
373
|
+
* @private
|
|
374
|
+
* @param year Hebrew year
|
|
375
|
+
*/
|
|
376
|
+
function elapsedDays0(year) {
|
|
377
|
+
const prevYear = year - 1;
|
|
378
|
+
const mElapsed = 235 * Math.floor(prevYear / 19) + // Months in complete 19 year lunar (Metonic) cycles so far
|
|
379
|
+
12 * (prevYear % 19) + // Regular months in this cycle
|
|
380
|
+
Math.floor(((prevYear % 19) * 7 + 1) / 19); // Leap months this cycle
|
|
381
|
+
const pElapsed = 204 + 793 * (mElapsed % 1080);
|
|
382
|
+
const hElapsed = 5 +
|
|
383
|
+
12 * mElapsed +
|
|
384
|
+
793 * Math.floor(mElapsed / 1080) +
|
|
385
|
+
Math.floor(pElapsed / 1080);
|
|
386
|
+
const parts = (pElapsed % 1080) + 1080 * (hElapsed % 24);
|
|
387
|
+
const day = 1 + 29 * mElapsed + Math.floor(hElapsed / 24);
|
|
388
|
+
let altDay = day;
|
|
389
|
+
if (parts >= 19440 ||
|
|
390
|
+
(2 === day % 7 && parts >= 9924 && !isLeapYear(year)) ||
|
|
391
|
+
(1 === day % 7 && parts >= 16789 && isLeapYear(prevYear))) {
|
|
392
|
+
altDay++;
|
|
393
|
+
}
|
|
394
|
+
if (altDay % 7 === 0 || altDay % 7 === 3 || altDay % 7 === 5) {
|
|
395
|
+
return altDay + 1;
|
|
396
|
+
}
|
|
397
|
+
else {
|
|
398
|
+
return altDay;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* Number of days in the hebrew YEAR.
|
|
403
|
+
* A common Hebrew calendar year can have a length of 353, 354 or 355 days
|
|
404
|
+
* A leap Hebrew calendar year can have a length of 383, 384 or 385 days
|
|
405
|
+
* @param year Hebrew year
|
|
406
|
+
*/
|
|
407
|
+
function daysInYear(year) {
|
|
408
|
+
return elapsedDays(year + 1) - elapsedDays(year);
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* true if Cheshvan is long in Hebrew year
|
|
412
|
+
* @param year Hebrew year
|
|
413
|
+
*/
|
|
414
|
+
function longCheshvan(year) {
|
|
415
|
+
return daysInYear(year) % 10 === 5;
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* true if Kislev is short in Hebrew year
|
|
419
|
+
* @param year Hebrew year
|
|
420
|
+
*/
|
|
421
|
+
function shortKislev(year) {
|
|
422
|
+
return daysInYear(year) % 10 === 3;
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Converts Hebrew month string name to numeric
|
|
426
|
+
* @param monthName monthName
|
|
427
|
+
*/
|
|
428
|
+
function monthFromName(monthName) {
|
|
429
|
+
if (typeof monthName === 'number') {
|
|
430
|
+
if (isNaN(monthName) || monthName < 1 || monthName > 14) {
|
|
431
|
+
throw new RangeError(`Invalid month name: ${monthName}`);
|
|
432
|
+
}
|
|
433
|
+
return monthName;
|
|
434
|
+
}
|
|
435
|
+
let c = monthName.trim().toLowerCase();
|
|
436
|
+
// If Hebrew month starts with a bet (for example `בתמוז`) then ignore it
|
|
437
|
+
if (c[0] === 'ב') {
|
|
438
|
+
c = c.substring(1);
|
|
439
|
+
}
|
|
440
|
+
/*
|
|
441
|
+
the Hebrew months are unique to their second letter
|
|
442
|
+
N Nisan (November?)
|
|
443
|
+
I Iyyar
|
|
444
|
+
E Elul
|
|
445
|
+
C Cheshvan
|
|
446
|
+
K Kislev
|
|
447
|
+
1 1Adar
|
|
448
|
+
2 2Adar
|
|
449
|
+
Si Sh Sivan, Shvat
|
|
450
|
+
Ta Ti Te Tamuz, Tishrei, Tevet
|
|
451
|
+
Av Ad Av, Adar
|
|
452
|
+
|
|
453
|
+
אב אד אי אל אב אדר אייר אלול
|
|
454
|
+
ח חשון
|
|
455
|
+
ט טבת
|
|
456
|
+
כ כסלו
|
|
457
|
+
נ ניסן
|
|
458
|
+
ס סיון
|
|
459
|
+
ש שבט
|
|
460
|
+
תמ תש תמוז תשרי
|
|
461
|
+
*/
|
|
462
|
+
switch (c[0]) {
|
|
463
|
+
case 'n':
|
|
464
|
+
case 'נ':
|
|
465
|
+
if (c[1] === 'o') {
|
|
466
|
+
break; /* this catches "november" */
|
|
467
|
+
}
|
|
468
|
+
return NISAN$2;
|
|
469
|
+
case 'i':
|
|
470
|
+
return IYYAR$1;
|
|
471
|
+
case 'e':
|
|
472
|
+
return ELUL;
|
|
473
|
+
case 'c':
|
|
474
|
+
case 'ח':
|
|
475
|
+
return CHESHVAN;
|
|
476
|
+
case 'k':
|
|
477
|
+
case 'כ':
|
|
478
|
+
return KISLEV$1;
|
|
479
|
+
case 's':
|
|
480
|
+
switch (c[1]) {
|
|
481
|
+
case 'i':
|
|
482
|
+
return SIVAN;
|
|
483
|
+
case 'h':
|
|
484
|
+
return SHVAT;
|
|
485
|
+
}
|
|
486
|
+
break;
|
|
487
|
+
case 't':
|
|
488
|
+
switch (c[1]) {
|
|
489
|
+
case 'a':
|
|
490
|
+
return TAMUZ$1;
|
|
491
|
+
case 'i':
|
|
492
|
+
return TISHREI$1;
|
|
493
|
+
case 'e':
|
|
494
|
+
return TEVET$1;
|
|
495
|
+
}
|
|
496
|
+
break;
|
|
497
|
+
case 'a':
|
|
498
|
+
switch (c[1]) {
|
|
499
|
+
case 'v':
|
|
500
|
+
return AV$1;
|
|
501
|
+
case 'd':
|
|
502
|
+
if (/(1|[^i]i|a|א)$/i.test(monthName)) {
|
|
503
|
+
return ADAR_I$1;
|
|
504
|
+
}
|
|
505
|
+
return ADAR_II$1; // else assume sheini
|
|
506
|
+
}
|
|
507
|
+
break;
|
|
508
|
+
case 'ס':
|
|
509
|
+
return SIVAN;
|
|
510
|
+
case 'ט':
|
|
511
|
+
return TEVET$1;
|
|
512
|
+
case 'ש':
|
|
513
|
+
return SHVAT;
|
|
514
|
+
case 'א':
|
|
515
|
+
switch (c[1]) {
|
|
516
|
+
case 'ב':
|
|
517
|
+
return AV$1;
|
|
518
|
+
case 'ד':
|
|
519
|
+
if (/(1|[^i]i|a|א)$/i.test(monthName)) {
|
|
520
|
+
return ADAR_I$1;
|
|
521
|
+
}
|
|
522
|
+
return ADAR_II$1; // else assume sheini
|
|
523
|
+
case 'י':
|
|
524
|
+
return IYYAR$1;
|
|
525
|
+
case 'ל':
|
|
526
|
+
return ELUL;
|
|
527
|
+
}
|
|
528
|
+
break;
|
|
529
|
+
case 'ת':
|
|
530
|
+
switch (c[1]) {
|
|
531
|
+
case 'מ':
|
|
532
|
+
return TAMUZ$1;
|
|
533
|
+
case 'ש':
|
|
534
|
+
return TISHREI$1;
|
|
535
|
+
}
|
|
536
|
+
break;
|
|
537
|
+
}
|
|
538
|
+
throw new RangeError(`Unable to parse month name: ${monthName}`);
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
/*! @hebcal/hdate v0.12.0 */
|
|
542
|
+
const GERESH = '׳';
|
|
543
|
+
const GERSHAYIM = '״';
|
|
144
544
|
const alefbet = {
|
|
145
545
|
א: 1,
|
|
146
546
|
ב: 2,
|
|
@@ -171,7 +571,90 @@ for (const [key, val] of Object.entries(alefbet)) {
|
|
|
171
571
|
heb2num.set(key, val);
|
|
172
572
|
num2heb.set(val, key);
|
|
173
573
|
}
|
|
574
|
+
function num2digits(num) {
|
|
575
|
+
const digits = [];
|
|
576
|
+
while (num > 0) {
|
|
577
|
+
if (num === 15 || num === 16) {
|
|
578
|
+
digits.push(9);
|
|
579
|
+
digits.push(num - 9);
|
|
580
|
+
break;
|
|
581
|
+
}
|
|
582
|
+
let incr = 100;
|
|
583
|
+
let i;
|
|
584
|
+
for (i = 400; i > num; i -= incr) {
|
|
585
|
+
if (i === incr) {
|
|
586
|
+
incr = incr / 10;
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
digits.push(i);
|
|
590
|
+
num -= i;
|
|
591
|
+
}
|
|
592
|
+
return digits;
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Converts a numerical value to a string of Hebrew letters.
|
|
596
|
+
*
|
|
597
|
+
* When specifying years of the Hebrew calendar in the present millennium,
|
|
598
|
+
* we omit the thousands (which is presently 5 [ה]).
|
|
599
|
+
* @example
|
|
600
|
+
* gematriya(5774) // 'תשע״ד' - cropped to 774
|
|
601
|
+
* gematriya(25) // 'כ״ה'
|
|
602
|
+
* gematriya(60) // 'ס׳'
|
|
603
|
+
* gematriya(3761) // 'ג׳תשס״א'
|
|
604
|
+
* gematriya(1123) // 'א׳קכ״ג'
|
|
605
|
+
*/
|
|
606
|
+
function gematriya(num) {
|
|
607
|
+
const num0 = num;
|
|
608
|
+
const num1 = parseInt(num0, 10);
|
|
609
|
+
if (!num1 || num1 < 0) {
|
|
610
|
+
throw new TypeError(`invalid gematriya number: ${num}`);
|
|
611
|
+
}
|
|
612
|
+
let str = '';
|
|
613
|
+
const thousands = Math.floor(num1 / 1000);
|
|
614
|
+
if (thousands > 0 && thousands !== 5) {
|
|
615
|
+
const tdigits = num2digits(thousands);
|
|
616
|
+
for (const tdig of tdigits) {
|
|
617
|
+
str += num2heb.get(tdig);
|
|
618
|
+
}
|
|
619
|
+
str += GERESH;
|
|
620
|
+
}
|
|
621
|
+
const digits = num2digits(num1 % 1000);
|
|
622
|
+
if (digits.length === 1) {
|
|
623
|
+
return str + num2heb.get(digits[0]) + GERESH;
|
|
624
|
+
}
|
|
625
|
+
for (let i = 0; i < digits.length; i++) {
|
|
626
|
+
if (i + 1 === digits.length) {
|
|
627
|
+
str += GERSHAYIM;
|
|
628
|
+
}
|
|
629
|
+
str += num2heb.get(digits[i]);
|
|
630
|
+
}
|
|
631
|
+
return str;
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* Converts a string of Hebrew letters to a numerical value.
|
|
635
|
+
*
|
|
636
|
+
* Only considers the value of Hebrew letters `א` through `ת`.
|
|
637
|
+
* Ignores final Hebrew letters such as `ך` (kaf sofit) or `ם` (mem sofit)
|
|
638
|
+
* and vowels (nekudot).
|
|
639
|
+
*/
|
|
640
|
+
function gematriyaStrToNum(str) {
|
|
641
|
+
let num = 0;
|
|
642
|
+
const gereshIdx = str.indexOf(GERESH);
|
|
643
|
+
if (gereshIdx !== -1 && gereshIdx !== str.length - 1) {
|
|
644
|
+
const thousands = str.substring(0, gereshIdx);
|
|
645
|
+
num += gematriyaStrToNum(thousands) * 1000;
|
|
646
|
+
str = str.substring(gereshIdx);
|
|
647
|
+
}
|
|
648
|
+
for (const ch of str) {
|
|
649
|
+
const n = heb2num.get(ch);
|
|
650
|
+
if (typeof n === 'number') {
|
|
651
|
+
num += n;
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
return num;
|
|
655
|
+
}
|
|
174
656
|
|
|
657
|
+
/*! @hebcal/hdate v0.12.0 */
|
|
175
658
|
/**
|
|
176
659
|
* Formats a number with leading zeros so the resulting string is 4 digits long.
|
|
177
660
|
* Similar to `string.padStart(4, '0')` but will also format
|
|
@@ -204,6 +687,7 @@ function pad2(num) {
|
|
|
204
687
|
return String(num);
|
|
205
688
|
}
|
|
206
689
|
|
|
690
|
+
/*! @hebcal/hdate v0.12.0 */
|
|
207
691
|
/**
|
|
208
692
|
* Returns YYYY-MM-DD in the local timezone
|
|
209
693
|
*/
|
|
@@ -215,9 +699,13 @@ function isoDateString(dt) {
|
|
|
215
699
|
pad2(dt.getDate()));
|
|
216
700
|
}
|
|
217
701
|
|
|
218
|
-
|
|
702
|
+
/*! @hebcal/hdate v0.12.0 */
|
|
703
|
+
var poAshkenazi$1 = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);" }, "contexts": { "": { "Tevet": ["Teves"] } } };
|
|
704
|
+
|
|
705
|
+
/*! @hebcal/hdate v0.12.0 */
|
|
706
|
+
var poHe$2 = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);" }, "contexts": { "": { "Adar": ["אַדָר"], "Adar I": ["אַדָר א׳"], "Adar II": ["אַדָר ב׳"], "Av": ["אָב"], "Cheshvan": ["חֶשְׁוָן"], "Elul": ["אֱלוּל"], "Iyyar": ["אִיָיר"], "Kislev": ["כִּסְלֵו"], "Nisan": ["נִיסָן"], "Sh'vat": ["שְׁבָט"], "Sivan": ["סִיוָן"], "Tamuz": ["תַּמּוּז"], "Tevet": ["טֵבֵת"], "Tishrei": ["תִּשְׁרֵי"] } } };
|
|
219
707
|
|
|
220
|
-
|
|
708
|
+
/*! @hebcal/hdate v0.12.0 */
|
|
221
709
|
|
|
222
710
|
const noopLocale = {
|
|
223
711
|
headers: { 'plural-forms': 'nplurals=2; plural=(n!=1);' },
|
|
@@ -408,22 +896,3783 @@ Locale.addLocale('s', noopLocale);
|
|
|
408
896
|
Locale.addLocale('', noopLocale);
|
|
409
897
|
Locale.useLocale('en');
|
|
410
898
|
/* Ashkenazic transliterations */
|
|
411
|
-
Locale.addLocale('ashkenazi', poAshkenazi);
|
|
412
|
-
Locale.addLocale('a', poAshkenazi);
|
|
899
|
+
Locale.addLocale('ashkenazi', poAshkenazi$1);
|
|
900
|
+
Locale.addLocale('a', poAshkenazi$1);
|
|
413
901
|
/* Hebrew with nikkud */
|
|
414
|
-
Locale.addLocale('he', poHe);
|
|
415
|
-
Locale.addLocale('h', poHe);
|
|
902
|
+
Locale.addLocale('he', poHe$2);
|
|
903
|
+
Locale.addLocale('h', poHe$2);
|
|
416
904
|
/* Hebrew without nikkud */
|
|
417
|
-
const heStrs = poHe.contexts[''];
|
|
418
|
-
const heNoNikud = {};
|
|
419
|
-
for (const [key, val] of Object.entries(heStrs)) {
|
|
420
|
-
heNoNikud[key] = [Locale.hebrewStripNikkud(val[0])];
|
|
905
|
+
const heStrs$2 = poHe$2.contexts[''];
|
|
906
|
+
const heNoNikud$2 = {};
|
|
907
|
+
for (const [key, val] of Object.entries(heStrs$2)) {
|
|
908
|
+
heNoNikud$2[key] = [Locale.hebrewStripNikkud(val[0])];
|
|
421
909
|
}
|
|
422
|
-
const poHeNoNikud = {
|
|
423
|
-
headers: poHe.headers,
|
|
424
|
-
contexts: { '': heNoNikud },
|
|
910
|
+
const poHeNoNikud$2 = {
|
|
911
|
+
headers: poHe$2.headers,
|
|
912
|
+
contexts: { '': heNoNikud$2 },
|
|
425
913
|
};
|
|
426
|
-
Locale.addLocale('he-x-NoNikud', poHeNoNikud);
|
|
914
|
+
Locale.addLocale('he-x-NoNikud', poHeNoNikud$2);
|
|
915
|
+
|
|
916
|
+
/*! @hebcal/hdate v0.12.0 */
|
|
917
|
+
|
|
918
|
+
/*
|
|
919
|
+
Hebcal - A Jewish Calendar Generator
|
|
920
|
+
Copyright (c) 1994-2020 Danny Sadinoff
|
|
921
|
+
Portions copyright Eyal Schachter and Michael J. Radwin
|
|
922
|
+
|
|
923
|
+
https://github.com/hebcal/hebcal-es6
|
|
924
|
+
|
|
925
|
+
This program is free software; you can redistribute it and/or
|
|
926
|
+
modify it under the terms of the GNU General Public License
|
|
927
|
+
as published by the Free Software Foundation; either version 2
|
|
928
|
+
of the License, or (at your option) any later version.
|
|
929
|
+
|
|
930
|
+
This program is distributed in the hope that it will be useful,
|
|
931
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
932
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
933
|
+
GNU General Public License for more details.
|
|
934
|
+
|
|
935
|
+
You should have received a copy of the GNU General Public License
|
|
936
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
937
|
+
*/
|
|
938
|
+
function mod(x, y) {
|
|
939
|
+
return x - y * Math.floor(x / y);
|
|
940
|
+
}
|
|
941
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
942
|
+
function isSimpleHebrewDate(obj) {
|
|
943
|
+
return obj.yy !== undefined;
|
|
944
|
+
}
|
|
945
|
+
const UNITS_DAY = 'day';
|
|
946
|
+
const UNITS_WEEK = 'week';
|
|
947
|
+
const UNITS_MONTH = 'month';
|
|
948
|
+
const UNITS_YEAR = 'year';
|
|
949
|
+
/**
|
|
950
|
+
* A `HDate` represents a Hebrew calendar date.
|
|
951
|
+
*
|
|
952
|
+
* An instance of this class encapsulates a date in the Hebrew calendar system.
|
|
953
|
+
* It consists of a year, month, and day, without any associated time or location data.
|
|
954
|
+
* The Hebrew calendar is a lunisolar calendar, meaning it is based on both lunar and solar cycles.
|
|
955
|
+
*
|
|
956
|
+
* A Hebrew date internally stores three numbers:
|
|
957
|
+
* - year: The Hebrew year (1-9999). Counted from the traditional Hebrew date of creation (3761 BCE in the Gregorian calendar)
|
|
958
|
+
* - 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.
|
|
959
|
+
* - day: The day of the month (1-30)
|
|
960
|
+
*
|
|
961
|
+
* This class uses Rata Die to convert between the Hebrew and Gregorian calendars.
|
|
962
|
+
*
|
|
963
|
+
* To calculate times of day, use `Zmanim` class from `@hebcal/core`
|
|
964
|
+
* @see {@link https://en.wikipedia.org/wiki/Rata_Die | Rata Die}
|
|
965
|
+
* @see {@link https://hebcal.github.io/api/core/classes/Zmanim.html | Zmanim}
|
|
966
|
+
*/
|
|
967
|
+
class HDate {
|
|
968
|
+
/**
|
|
969
|
+
* Create a Hebrew date. There are 3 basic forms for the `HDate()` constructor.
|
|
970
|
+
*
|
|
971
|
+
* 1. No parameters - represents the current Hebrew date at time of instantiation
|
|
972
|
+
* 2. One parameter
|
|
973
|
+
* * `Date` - represents the Hebrew date corresponding to the Gregorian date using
|
|
974
|
+
* local time. Hours, minutes, seconds and milliseconds are ignored.
|
|
975
|
+
* * `HDate` - clones a copy of the given Hebrew date
|
|
976
|
+
* * `number` - Converts absolute R.D. days to Hebrew date.
|
|
977
|
+
* R.D. 1 == the imaginary date January 1, 1 (Gregorian)
|
|
978
|
+
* 3. Three parameters: Hebrew day, Hebrew month, Hebrew year. Hebrew day should
|
|
979
|
+
* be a number between 1-30, Hebrew month can be a number or string, and
|
|
980
|
+
* Hebrew year is always a number.
|
|
981
|
+
* @example
|
|
982
|
+
* import {HDate, months} from '@hebcal/hdate';
|
|
983
|
+
*
|
|
984
|
+
* const hd1 = new HDate();
|
|
985
|
+
* const hd2 = new HDate(new Date(2008, 10, 13));
|
|
986
|
+
* const hd3 = new HDate(15, 'Cheshvan', 5769);
|
|
987
|
+
* const hd4 = new HDate(15, months.CHESHVAN, 5769);
|
|
988
|
+
* const hd5 = new HDate(733359); // ==> 15 Cheshvan 5769
|
|
989
|
+
* const monthName = 'אייר';
|
|
990
|
+
* const hd6 = new HDate(5, monthName, 5773);
|
|
991
|
+
* @param [day] - Day of month (1-30) if a `number`.
|
|
992
|
+
* If a `Date` is specified, represents the Hebrew date corresponding to the
|
|
993
|
+
* Gregorian date using local time.
|
|
994
|
+
* If an `HDate` is specified, clones a copy of the given Hebrew date.
|
|
995
|
+
* @param [month] - Hebrew month of year (1=NISAN, 7=TISHREI)
|
|
996
|
+
* @param [year] - Hebrew year
|
|
997
|
+
*/
|
|
998
|
+
constructor(day, month, year) {
|
|
999
|
+
if (arguments.length === 2 || arguments.length > 3) {
|
|
1000
|
+
throw new TypeError('HDate constructor requires 0, 1 or 3 arguments');
|
|
1001
|
+
}
|
|
1002
|
+
if (arguments.length === 3) {
|
|
1003
|
+
// Hebrew day, Hebrew month, Hebrew year
|
|
1004
|
+
this.dd = this.mm = 1;
|
|
1005
|
+
const yy = typeof year === 'string' ? parseInt(year, 10) : year;
|
|
1006
|
+
if (isNaN(yy)) {
|
|
1007
|
+
throw new TypeError(`HDate called with bad year argument: ${year}`);
|
|
1008
|
+
}
|
|
1009
|
+
this.yy = yy;
|
|
1010
|
+
setMonth(this, month); // will throw if we can't parse
|
|
1011
|
+
const dd = typeof day === 'string' ? parseInt(day, 10) : day;
|
|
1012
|
+
if (isNaN(dd)) {
|
|
1013
|
+
throw new TypeError(`HDate called with bad day argument: ${day}`);
|
|
1014
|
+
}
|
|
1015
|
+
setDate(this, dd);
|
|
1016
|
+
}
|
|
1017
|
+
else {
|
|
1018
|
+
// 0 arguments
|
|
1019
|
+
if (typeof day === 'undefined' || day === null) {
|
|
1020
|
+
day = new Date();
|
|
1021
|
+
}
|
|
1022
|
+
// 1 argument
|
|
1023
|
+
const abs0 = typeof day === 'number' && !isNaN(day)
|
|
1024
|
+
? day
|
|
1025
|
+
: isDate(day)
|
|
1026
|
+
? greg2abs(day)
|
|
1027
|
+
: isSimpleHebrewDate(day)
|
|
1028
|
+
? day
|
|
1029
|
+
: null;
|
|
1030
|
+
if (abs0 === null) {
|
|
1031
|
+
throw new TypeError(`HDate called with bad argument: ${day}`);
|
|
1032
|
+
}
|
|
1033
|
+
const isNumber = typeof abs0 === 'number';
|
|
1034
|
+
const d = isNumber ? abs2hebrew(abs0) : abs0;
|
|
1035
|
+
this.yy = d.yy;
|
|
1036
|
+
this.mm = d.mm;
|
|
1037
|
+
this.dd = d.dd;
|
|
1038
|
+
if (isNumber) {
|
|
1039
|
+
this.rd = abs0;
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
/**
|
|
1044
|
+
* Returns the Hebrew year of this Hebrew date
|
|
1045
|
+
* @returns an integer >= 1
|
|
1046
|
+
* @example
|
|
1047
|
+
* const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769
|
|
1048
|
+
* hd.getFullYear(); // 5769
|
|
1049
|
+
*/
|
|
1050
|
+
getFullYear() {
|
|
1051
|
+
return this.yy;
|
|
1052
|
+
}
|
|
1053
|
+
/**
|
|
1054
|
+
* Returns `true` if this Hebrew date occurs during a Hebrew leap year
|
|
1055
|
+
* @example
|
|
1056
|
+
* const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769
|
|
1057
|
+
* hd.isLeapYear(); // false
|
|
1058
|
+
*/
|
|
1059
|
+
isLeapYear() {
|
|
1060
|
+
return isLeapYear(this.yy);
|
|
1061
|
+
}
|
|
1062
|
+
/**
|
|
1063
|
+
* Returns the Hebrew month (1=NISAN, 7=TISHREI) of this Hebrew date
|
|
1064
|
+
* @returns an integer 1-13
|
|
1065
|
+
* @example
|
|
1066
|
+
* const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769
|
|
1067
|
+
* hd.getMonth(); // 8
|
|
1068
|
+
*/
|
|
1069
|
+
getMonth() {
|
|
1070
|
+
return this.mm;
|
|
1071
|
+
}
|
|
1072
|
+
/**
|
|
1073
|
+
* The Tishrei-based month of this Hebrew date. 1 is Tishrei, 7 is Nisan, 13 is Elul in a leap year
|
|
1074
|
+
* @returns an integer 1-13
|
|
1075
|
+
* @example
|
|
1076
|
+
* const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769
|
|
1077
|
+
* hd.getTishreiMonth(); // 2
|
|
1078
|
+
*/
|
|
1079
|
+
getTishreiMonth() {
|
|
1080
|
+
const nummonths = monthsInYear(this.getFullYear());
|
|
1081
|
+
return (this.getMonth() + nummonths - 6) % nummonths || nummonths;
|
|
1082
|
+
}
|
|
1083
|
+
/**
|
|
1084
|
+
* Number of days in the month of this Hebrew date (29 or 30)
|
|
1085
|
+
* @returns an integer 29-30
|
|
1086
|
+
* @example
|
|
1087
|
+
* const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769
|
|
1088
|
+
* hd.daysInMonth(); // 29
|
|
1089
|
+
*/
|
|
1090
|
+
daysInMonth() {
|
|
1091
|
+
return daysInMonth(this.getMonth(), this.getFullYear());
|
|
1092
|
+
}
|
|
1093
|
+
/**
|
|
1094
|
+
* Gets the day within the month (1-30)
|
|
1095
|
+
* @returns an integer 1-30
|
|
1096
|
+
* @example
|
|
1097
|
+
* const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769
|
|
1098
|
+
* hd.getDate(); // 15
|
|
1099
|
+
*/
|
|
1100
|
+
getDate() {
|
|
1101
|
+
return this.dd;
|
|
1102
|
+
}
|
|
1103
|
+
/**
|
|
1104
|
+
* Returns the day of the week for this Hebrew date,
|
|
1105
|
+
* where 0 represents Sunday, 1 represents Monday, 6 represents Saturday.
|
|
1106
|
+
*
|
|
1107
|
+
* For the day of the month, see `getDate()`
|
|
1108
|
+
* @returns an integer 0-6
|
|
1109
|
+
* @example
|
|
1110
|
+
* const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769
|
|
1111
|
+
* hd.getDate(); // 4
|
|
1112
|
+
*/
|
|
1113
|
+
getDay() {
|
|
1114
|
+
return mod(this.abs(), 7);
|
|
1115
|
+
}
|
|
1116
|
+
/**
|
|
1117
|
+
* Converts this Hebrew date to the corresponding Gregorian date.
|
|
1118
|
+
*
|
|
1119
|
+
* The returned `Date` object will be in the local (i.e. host system) time zone.
|
|
1120
|
+
* Hours, minutes, seconds and milliseconds will all be zero.
|
|
1121
|
+
*
|
|
1122
|
+
* Note that this function returns the daytime portion of the date.
|
|
1123
|
+
* For example, the 15th of Cheshvan 5769 began at sundown on
|
|
1124
|
+
* 12 November 2008 and continues through 13 November 2008. This
|
|
1125
|
+
* function would return only the date 13 November 2008.
|
|
1126
|
+
* @example
|
|
1127
|
+
* const hd = new HDate(15, 'Cheshvan', 5769);
|
|
1128
|
+
* const date = hd.greg(); // 13 November 2008
|
|
1129
|
+
* const year = date.getFullYear(); // 2008
|
|
1130
|
+
* const monthNum = date.getMonth() + 1; // 11
|
|
1131
|
+
* const day = date.getDate(); // 13
|
|
1132
|
+
*/
|
|
1133
|
+
greg() {
|
|
1134
|
+
return abs2greg(this.abs());
|
|
1135
|
+
}
|
|
1136
|
+
/**
|
|
1137
|
+
* Converts from Hebrew date representation to R.D. (Rata Die) fixed days.
|
|
1138
|
+
* R.D. 1 is the imaginary date Monday, January 1, 1 (Gregorian).
|
|
1139
|
+
* Note also that R.D. = Julian Date − 1,721,424.5
|
|
1140
|
+
* @see {@link https://en.wikipedia.org/wiki/Rata_Die | Rata Die}
|
|
1141
|
+
* @example
|
|
1142
|
+
* const hd = new HDate(15, 'Cheshvan', 5769);
|
|
1143
|
+
* hd.abs(); // 733359
|
|
1144
|
+
*/
|
|
1145
|
+
abs() {
|
|
1146
|
+
if (typeof this.rd !== 'number') {
|
|
1147
|
+
this.rd = hebrew2abs(this.yy, this.mm, this.dd);
|
|
1148
|
+
}
|
|
1149
|
+
return this.rd;
|
|
1150
|
+
}
|
|
1151
|
+
/**
|
|
1152
|
+
* Converts Hebrew date to R.D. (Rata Die) fixed days.
|
|
1153
|
+
* R.D. 1 is the imaginary date Monday, January 1, 1 on the Gregorian
|
|
1154
|
+
* Calendar.
|
|
1155
|
+
* @param year Hebrew year
|
|
1156
|
+
* @param month Hebrew month (1=NISAN, 7=TISHREI)
|
|
1157
|
+
* @param day Hebrew date (1-30)
|
|
1158
|
+
* @example
|
|
1159
|
+
* import {HDate, months} from '@hebcal/hdate';
|
|
1160
|
+
* HDate.hebrew2abs(5769, months.CHESHVAN, 15); // 733359
|
|
1161
|
+
*/
|
|
1162
|
+
static hebrew2abs(year, month, day) {
|
|
1163
|
+
return hebrew2abs(year, month, day);
|
|
1164
|
+
}
|
|
1165
|
+
/**
|
|
1166
|
+
* Returns a transliterated Hebrew month name, e.g. `'Elul'` or `'Cheshvan'`.
|
|
1167
|
+
* @example
|
|
1168
|
+
* const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769
|
|
1169
|
+
* hd.getMonthName(); // 'Cheshvan'
|
|
1170
|
+
*/
|
|
1171
|
+
getMonthName() {
|
|
1172
|
+
return getMonthName(this.getMonth(), this.getFullYear());
|
|
1173
|
+
}
|
|
1174
|
+
/**
|
|
1175
|
+
* Renders this Hebrew date as a translated or transliterated string,
|
|
1176
|
+
* including ordinal e.g. `'15th of Cheshvan, 5769'`.
|
|
1177
|
+
* @example
|
|
1178
|
+
* import {HDate, months} from '@hebcal/hdate';
|
|
1179
|
+
*
|
|
1180
|
+
* const hd = new HDate(15, months.CHESHVAN, 5769);
|
|
1181
|
+
* console.log(hd.render('en')); // '15th of Cheshvan, 5769'
|
|
1182
|
+
* console.log(hd.render('he')); // '15 חֶשְׁוָן, 5769'
|
|
1183
|
+
* console.log(hd.render('en', false)); // '15th of Cheshvan'
|
|
1184
|
+
* console.log(hd.render('he', false)); // '15 חֶשְׁוָן'
|
|
1185
|
+
* @param [locale] Optional locale name (defaults to active locale).
|
|
1186
|
+
* @param [showYear=true] Display year (defaults to true).
|
|
1187
|
+
* @see {@link Locale}
|
|
1188
|
+
*/
|
|
1189
|
+
render(locale, showYear = true) {
|
|
1190
|
+
const locale0 = locale || Locale.getLocaleName();
|
|
1191
|
+
const day = this.getDate();
|
|
1192
|
+
const monthName0 = Locale.gettext(this.getMonthName(), locale0);
|
|
1193
|
+
const monthName = monthName0.replace(/'/g, '’');
|
|
1194
|
+
const nth = Locale.ordinal(day, locale0);
|
|
1195
|
+
const dayOf = getDayOfTranslation(locale0);
|
|
1196
|
+
const dateStr = `${nth}${dayOf} ${monthName}`;
|
|
1197
|
+
if (showYear) {
|
|
1198
|
+
const fullYear = this.getFullYear();
|
|
1199
|
+
return `${dateStr}, ${fullYear}`;
|
|
1200
|
+
}
|
|
1201
|
+
else {
|
|
1202
|
+
return dateStr;
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
/**
|
|
1206
|
+
* Renders this Hebrew date in Hebrew gematriya, regardless of locale.
|
|
1207
|
+
* @example
|
|
1208
|
+
* import {HDate, months} from '@hebcal/hdate';
|
|
1209
|
+
* const hd = new HDate(15, months.CHESHVAN, 5769);
|
|
1210
|
+
* hd.renderGematriya(); // 'ט״ו חֶשְׁוָן תשס״ט'
|
|
1211
|
+
* hd.renderGematriya(true); // 'ט״ו חשון תשס״ט'
|
|
1212
|
+
*/
|
|
1213
|
+
renderGematriya(suppressNikud = false) {
|
|
1214
|
+
const d = this.getDate();
|
|
1215
|
+
const locale = suppressNikud ? 'he-x-NoNikud' : 'he';
|
|
1216
|
+
const m = Locale.gettext(this.getMonthName(), locale);
|
|
1217
|
+
const y = this.getFullYear();
|
|
1218
|
+
return gematriya(d) + ' ' + m + ' ' + gematriya(y);
|
|
1219
|
+
}
|
|
1220
|
+
/**
|
|
1221
|
+
* Returns an `HDate` corresponding to the specified day of week
|
|
1222
|
+
* **before** this Hebrew date
|
|
1223
|
+
* @example
|
|
1224
|
+
* new HDate(new Date('Wednesday February 19, 2014')).before(6).greg() // Sat Feb 15 2014
|
|
1225
|
+
* @param dayOfWeek day of week: Sunday=0, Saturday=6
|
|
1226
|
+
*/
|
|
1227
|
+
before(dayOfWeek) {
|
|
1228
|
+
return onOrBefore(dayOfWeek, this, -1);
|
|
1229
|
+
}
|
|
1230
|
+
/**
|
|
1231
|
+
* Returns an `HDate` corresponding to the specified day of week
|
|
1232
|
+
* **on or before** this Hebrew date
|
|
1233
|
+
* @example
|
|
1234
|
+
* new HDate(new Date('Wednesday February 19, 2014')).onOrBefore(6).greg() // Sat Feb 15 2014
|
|
1235
|
+
* new HDate(new Date('Saturday February 22, 2014')).onOrBefore(6).greg() // Sat Feb 22 2014
|
|
1236
|
+
* new HDate(new Date('Sunday February 23, 2014')).onOrBefore(6).greg() // Sat Feb 22 2014
|
|
1237
|
+
* @param dayOfWeek day of week: Sunday=0, Saturday=6
|
|
1238
|
+
*/
|
|
1239
|
+
onOrBefore(dayOfWeek) {
|
|
1240
|
+
return onOrBefore(dayOfWeek, this, 0);
|
|
1241
|
+
}
|
|
1242
|
+
/**
|
|
1243
|
+
* Returns an `HDate` corresponding to the specified day of week
|
|
1244
|
+
* **nearest** to this Hebrew date
|
|
1245
|
+
* @example
|
|
1246
|
+
* new HDate(new Date('Wednesday February 19, 2014')).nearest(6).greg() // Sat Feb 22 2014
|
|
1247
|
+
* new HDate(new Date('Tuesday February 18, 2014')).nearest(6).greg() // Sat Feb 15 2014
|
|
1248
|
+
* @param dayOfWeek day of week: Sunday=0, Saturday=6
|
|
1249
|
+
*/
|
|
1250
|
+
nearest(dayOfWeek) {
|
|
1251
|
+
return onOrBefore(dayOfWeek, this, 3);
|
|
1252
|
+
}
|
|
1253
|
+
/**
|
|
1254
|
+
* Returns an `HDate` corresponding to the specified day of week
|
|
1255
|
+
* **on or after** this Hebrew date
|
|
1256
|
+
* @example
|
|
1257
|
+
* new HDate(new Date('Wednesday February 19, 2014')).onOrAfter(6).greg() // Sat Feb 22 2014
|
|
1258
|
+
* new HDate(new Date('Saturday February 22, 2014')).onOrAfter(6).greg() // Sat Feb 22 2014
|
|
1259
|
+
* new HDate(new Date('Sunday February 23, 2014')).onOrAfter(6).greg() // Sat Mar 01 2014
|
|
1260
|
+
* @param dayOfWeek day of week: Sunday=0, Saturday=6
|
|
1261
|
+
*/
|
|
1262
|
+
onOrAfter(dayOfWeek) {
|
|
1263
|
+
return onOrBefore(dayOfWeek, this, 6);
|
|
1264
|
+
}
|
|
1265
|
+
/**
|
|
1266
|
+
* Returns an `HDate` corresponding to the specified day of week
|
|
1267
|
+
* **after** this Hebrew date
|
|
1268
|
+
* @example
|
|
1269
|
+
* new HDate(new Date('Wednesday February 19, 2014')).after(6).greg() // Sat Feb 22 2014
|
|
1270
|
+
* new HDate(new Date('Saturday February 22, 2014')).after(6).greg() // Sat Mar 01 2014
|
|
1271
|
+
* new HDate(new Date('Sunday February 23, 2014')).after(6).greg() // Sat Mar 01 2014
|
|
1272
|
+
* @param dayOfWeek day of week: Sunday=0, Saturday=6
|
|
1273
|
+
*/
|
|
1274
|
+
after(dayOfWeek) {
|
|
1275
|
+
return onOrBefore(dayOfWeek, this, 7);
|
|
1276
|
+
}
|
|
1277
|
+
/**
|
|
1278
|
+
* Returns the next Hebrew date
|
|
1279
|
+
* @example
|
|
1280
|
+
* const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769
|
|
1281
|
+
* hd.next(); // '16 Cheshvan 5769'
|
|
1282
|
+
*/
|
|
1283
|
+
next() {
|
|
1284
|
+
return new HDate(this.abs() + 1);
|
|
1285
|
+
}
|
|
1286
|
+
/**
|
|
1287
|
+
* Returns the previous Hebrew date
|
|
1288
|
+
* @example
|
|
1289
|
+
* const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769
|
|
1290
|
+
* hd.prev(); // '14 Cheshvan 5769'
|
|
1291
|
+
*/
|
|
1292
|
+
prev() {
|
|
1293
|
+
return new HDate(this.abs() - 1);
|
|
1294
|
+
}
|
|
1295
|
+
/**
|
|
1296
|
+
* Returns a cloned `HDate` object with a specified amount of time added
|
|
1297
|
+
*
|
|
1298
|
+
* Units are case insensitive, and support plural and short forms.
|
|
1299
|
+
* Note, short forms are case sensitive.
|
|
1300
|
+
*
|
|
1301
|
+
* | Unit | Shorthand | Description
|
|
1302
|
+
* | --- | --- | --- |
|
|
1303
|
+
* | `day` | `d` | days |
|
|
1304
|
+
* | `week` | `w` | weeks |
|
|
1305
|
+
* | `month` | `M` | months |
|
|
1306
|
+
* | `year` | `y` | years |
|
|
1307
|
+
*/
|
|
1308
|
+
add(amount, units = 'd') {
|
|
1309
|
+
amount =
|
|
1310
|
+
typeof amount === 'string' ? parseInt(amount, 10) : amount;
|
|
1311
|
+
if (!amount) {
|
|
1312
|
+
return new HDate(this);
|
|
1313
|
+
}
|
|
1314
|
+
units = standardizeUnits(units);
|
|
1315
|
+
if (units === UNITS_DAY) {
|
|
1316
|
+
return new HDate(this.abs() + amount);
|
|
1317
|
+
}
|
|
1318
|
+
else if (units === UNITS_WEEK) {
|
|
1319
|
+
return new HDate(this.abs() + 7 * amount);
|
|
1320
|
+
}
|
|
1321
|
+
else if (units === UNITS_YEAR) {
|
|
1322
|
+
return new HDate(this.getDate(), this.getMonth(), this.getFullYear() + amount);
|
|
1323
|
+
}
|
|
1324
|
+
else {
|
|
1325
|
+
// units === UNITS_MONTH
|
|
1326
|
+
let hd = new HDate(this);
|
|
1327
|
+
const sign = amount > 0 ? 1 : -1;
|
|
1328
|
+
amount = Math.abs(amount);
|
|
1329
|
+
for (let i = 0; i < amount; i++) {
|
|
1330
|
+
hd = new HDate(hd.abs() + sign * hd.daysInMonth());
|
|
1331
|
+
}
|
|
1332
|
+
return hd;
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
/**
|
|
1336
|
+
* Returns a cloned `HDate` object with a specified amount of time subracted
|
|
1337
|
+
*
|
|
1338
|
+
* Units are case insensitive, and support plural and short forms.
|
|
1339
|
+
* Note, short forms are case sensitive.
|
|
1340
|
+
*
|
|
1341
|
+
* | Unit | Shorthand | Description
|
|
1342
|
+
* | --- | --- | --- |
|
|
1343
|
+
* | `day` | `d` | days |
|
|
1344
|
+
* | `week` | `w` | weeks |
|
|
1345
|
+
* | `month` | `M` | months |
|
|
1346
|
+
* | `year` | `y` | years |
|
|
1347
|
+
* @example
|
|
1348
|
+
* import {HDate, months} from '@hebcal/hdate';
|
|
1349
|
+
*
|
|
1350
|
+
* const hd1 = new HDate(15, months.CHESHVAN, 5769);
|
|
1351
|
+
* const hd2 = hd1.add(1, 'weeks'); // 7 Kislev 5769
|
|
1352
|
+
* const hd3 = hd1.add(-3, 'M'); // 30 Av 5768
|
|
1353
|
+
*/
|
|
1354
|
+
subtract(amount, units = 'd') {
|
|
1355
|
+
return this.add(amount * -1, units);
|
|
1356
|
+
}
|
|
1357
|
+
/**
|
|
1358
|
+
* Returns the difference in days between the two given HDates.
|
|
1359
|
+
*
|
|
1360
|
+
* The result is positive if `this` date is comes chronologically
|
|
1361
|
+
* after the `other` date, and negative
|
|
1362
|
+
* if the order of the two dates is reversed.
|
|
1363
|
+
*
|
|
1364
|
+
* The result is zero if the two dates are identical.
|
|
1365
|
+
* @example
|
|
1366
|
+
* import {HDate, months} from '@hebcal/hdate';
|
|
1367
|
+
*
|
|
1368
|
+
* const hd1 = new HDate(25, months.KISLEV, 5770);
|
|
1369
|
+
* const hd2 = new HDate(15, months.CHESHVAN, 5769);
|
|
1370
|
+
* const days = hd1.deltaDays(hd2); // 394
|
|
1371
|
+
* @param other Hebrew date to compare
|
|
1372
|
+
*/
|
|
1373
|
+
deltaDays(other) {
|
|
1374
|
+
return this.abs() - other.abs();
|
|
1375
|
+
}
|
|
1376
|
+
/**
|
|
1377
|
+
* Compares this Hebrew date to another date, returning `true` if the dates match.
|
|
1378
|
+
* @param other Hebrew date to compare
|
|
1379
|
+
* @example
|
|
1380
|
+
* const hd1 = new HDate(new Date(2008, 10, 13));
|
|
1381
|
+
* const hd2 = new HDate(15, 'Cheshvan', 5769);
|
|
1382
|
+
* hd1.isSameDate(hd2); // true
|
|
1383
|
+
*/
|
|
1384
|
+
isSameDate(other) {
|
|
1385
|
+
return this.yy === other.yy && this.mm === other.mm && this.dd === other.dd;
|
|
1386
|
+
}
|
|
1387
|
+
/**
|
|
1388
|
+
* Returns a string representation of this Hebrew date using English transliterations
|
|
1389
|
+
* @example
|
|
1390
|
+
* const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769
|
|
1391
|
+
* hd.toString(); // '15 Cheshvan 5769'
|
|
1392
|
+
*/
|
|
1393
|
+
toString() {
|
|
1394
|
+
const day = this.getDate();
|
|
1395
|
+
const fullYear = this.getFullYear();
|
|
1396
|
+
const monthName = this.getMonthName();
|
|
1397
|
+
return `${day} ${monthName} ${fullYear}`;
|
|
1398
|
+
}
|
|
1399
|
+
/**
|
|
1400
|
+
* Returns true if Hebrew year is a leap year
|
|
1401
|
+
* @param year Hebrew year
|
|
1402
|
+
* @example
|
|
1403
|
+
* HDate.isLeapYear(5783); // false
|
|
1404
|
+
* HDate.isLeapYear(5784); // true
|
|
1405
|
+
*/
|
|
1406
|
+
static isLeapYear(year) {
|
|
1407
|
+
return isLeapYear(year);
|
|
1408
|
+
}
|
|
1409
|
+
/**
|
|
1410
|
+
* Number of months in this Hebrew year (either 12 or 13 depending on leap year)
|
|
1411
|
+
* @param year Hebrew year
|
|
1412
|
+
* @example
|
|
1413
|
+
* HDate.monthsInYear(5783); // 12
|
|
1414
|
+
* HDate.monthsInYear(5784); // 13
|
|
1415
|
+
*/
|
|
1416
|
+
static monthsInYear(year) {
|
|
1417
|
+
return monthsInYear(year);
|
|
1418
|
+
}
|
|
1419
|
+
/**
|
|
1420
|
+
* Number of days in Hebrew month in a given year (29 or 30)
|
|
1421
|
+
* @param month Hebrew month (e.g. months.TISHREI)
|
|
1422
|
+
* @param year Hebrew year
|
|
1423
|
+
* @example
|
|
1424
|
+
* import {HDate, months} from '@hebcal/hdate';
|
|
1425
|
+
* HDate.daysInMonth(months.CHESHVAN, 5769); // 29
|
|
1426
|
+
*/
|
|
1427
|
+
static daysInMonth(month, year) {
|
|
1428
|
+
return daysInMonth(month, year);
|
|
1429
|
+
}
|
|
1430
|
+
/**
|
|
1431
|
+
* Returns a transliterated string name of Hebrew month in year,
|
|
1432
|
+
* for example 'Elul' or 'Cheshvan'.
|
|
1433
|
+
* @param month Hebrew month (e.g. months.TISHREI)
|
|
1434
|
+
* @param year Hebrew year
|
|
1435
|
+
* @example
|
|
1436
|
+
* import {HDate, months} from '@hebcal/hdate';
|
|
1437
|
+
* HDate.getMonthName(months.CHESHVAN, 5769); // 'Cheshvan'
|
|
1438
|
+
*/
|
|
1439
|
+
static getMonthName(month, year) {
|
|
1440
|
+
return getMonthName(month, year);
|
|
1441
|
+
}
|
|
1442
|
+
/**
|
|
1443
|
+
* Returns the Hebrew month number (NISAN=1, TISHREI=7)
|
|
1444
|
+
* @param month A number, or Hebrew month name string
|
|
1445
|
+
* @example
|
|
1446
|
+
* import {HDate, months} from '@hebcal/hdate';
|
|
1447
|
+
* HDate.monthNum(months.CHESHVAN); // 8
|
|
1448
|
+
* HDate.monthNum('Cheshvan'); // 8
|
|
1449
|
+
* HDate.monthNum('חשון'); // 8
|
|
1450
|
+
*/
|
|
1451
|
+
static monthNum(month) {
|
|
1452
|
+
if (typeof month === 'number') {
|
|
1453
|
+
if (isNaN(month) || month > 14) {
|
|
1454
|
+
throw new RangeError(`Invalid month number: ${month}`);
|
|
1455
|
+
}
|
|
1456
|
+
return month;
|
|
1457
|
+
}
|
|
1458
|
+
return month.charCodeAt(0) >= 48 && month.charCodeAt(0) <= 57 /* number */
|
|
1459
|
+
? parseInt(month, 10)
|
|
1460
|
+
: HDate.monthFromName(month);
|
|
1461
|
+
}
|
|
1462
|
+
/**
|
|
1463
|
+
* Number of days in the Hebrew year.
|
|
1464
|
+
* Regular years can have 353, 354, or 355 days.
|
|
1465
|
+
* Leap years can have 383, 384, or 385 days.
|
|
1466
|
+
* @param year Hebrew year
|
|
1467
|
+
* @example
|
|
1468
|
+
* HDate.daysInYear(5783); // 355
|
|
1469
|
+
* HDate.daysInYear(5784); // 383
|
|
1470
|
+
*/
|
|
1471
|
+
static daysInYear(year) {
|
|
1472
|
+
return daysInYear(year);
|
|
1473
|
+
}
|
|
1474
|
+
/**
|
|
1475
|
+
* true if Cheshvan is long in Hebrew year
|
|
1476
|
+
* @param year Hebrew year
|
|
1477
|
+
* @example
|
|
1478
|
+
* HDate.longCheshvan(5783); // true
|
|
1479
|
+
* HDate.longCheshvan(5784); // false
|
|
1480
|
+
*/
|
|
1481
|
+
static longCheshvan(year) {
|
|
1482
|
+
return longCheshvan(year);
|
|
1483
|
+
}
|
|
1484
|
+
/**
|
|
1485
|
+
* true if Kislev is short in Hebrew year
|
|
1486
|
+
* @param year Hebrew year
|
|
1487
|
+
* @example
|
|
1488
|
+
* HDate.shortKislev(5783); // false
|
|
1489
|
+
* HDate.shortKislev(5784); // true
|
|
1490
|
+
*/
|
|
1491
|
+
static shortKislev(year) {
|
|
1492
|
+
return shortKislev(year);
|
|
1493
|
+
}
|
|
1494
|
+
/**
|
|
1495
|
+
* Converts Hebrew month string name to numeric
|
|
1496
|
+
* @example
|
|
1497
|
+
* import {HDate, months} from '@hebcal/hdate';
|
|
1498
|
+
* HDate.monthFromName(months.CHESHVAN); // 8
|
|
1499
|
+
* HDate.monthFromName('Cheshvan'); // 8
|
|
1500
|
+
* HDate.monthFromName('חשון'); // 8
|
|
1501
|
+
*/
|
|
1502
|
+
static monthFromName(monthName) {
|
|
1503
|
+
if (typeof monthName === 'number') {
|
|
1504
|
+
if (isNaN(monthName) || monthName < 1 || monthName > 14) {
|
|
1505
|
+
throw new RangeError(`Invalid month name: ${monthName}`);
|
|
1506
|
+
}
|
|
1507
|
+
return monthName;
|
|
1508
|
+
}
|
|
1509
|
+
const name = Locale.hebrewStripNikkud(monthName);
|
|
1510
|
+
return monthFromName(name);
|
|
1511
|
+
}
|
|
1512
|
+
/**
|
|
1513
|
+
* Convenience function for determining the R.D. date
|
|
1514
|
+
* near a specified R.D. date, corresponding to the specified day of week.
|
|
1515
|
+
*
|
|
1516
|
+
* Note: Applying this function to d+6 gives us the `dayOfWeek` on or after an
|
|
1517
|
+
* absolute day d. Similarly, applying it to d+3 gives the `dayOfWeek` nearest to
|
|
1518
|
+
* absolute date d, applying it to d-1 gives the `dayOfWeek` previous to absolute
|
|
1519
|
+
* date d, and applying it to d+7 gives the `dayOfWeek` following absolute date d.
|
|
1520
|
+
* @param dayOfWeek day of week: Sunday=0, Saturday=6
|
|
1521
|
+
*/
|
|
1522
|
+
static dayOnOrBefore(dayOfWeek, absdate) {
|
|
1523
|
+
return absdate - ((absdate - dayOfWeek) % 7);
|
|
1524
|
+
}
|
|
1525
|
+
/**
|
|
1526
|
+
* Tests if the object is an instance of `HDate`
|
|
1527
|
+
* @example
|
|
1528
|
+
* HDate.isHDate(new HDate()); // true
|
|
1529
|
+
* HDate.isHDate(new Date()); // false
|
|
1530
|
+
* HDate.isHDate(null); // false
|
|
1531
|
+
* HDate.isHDate(12345); // false
|
|
1532
|
+
* HDate.isHDate('15 Cheshvan 5769'); // false
|
|
1533
|
+
*/
|
|
1534
|
+
static isHDate(obj) {
|
|
1535
|
+
return (obj !== null &&
|
|
1536
|
+
typeof obj === 'object' &&
|
|
1537
|
+
typeof obj.yy === 'number' &&
|
|
1538
|
+
typeof obj.mm === 'number' &&
|
|
1539
|
+
typeof obj.dd === 'number' &&
|
|
1540
|
+
typeof obj.greg === 'function' &&
|
|
1541
|
+
typeof obj.abs === 'function');
|
|
1542
|
+
}
|
|
1543
|
+
/**
|
|
1544
|
+
* Construct a new instance of `HDate` from a Gematriya-formatted string
|
|
1545
|
+
* @example
|
|
1546
|
+
* HDate.fromGematriyaString('כ״ז בְּתַמּוּז תשפ״ג') // 27 Tamuz 5783
|
|
1547
|
+
* HDate.fromGematriyaString('כ׳ סיון תש״ד') // 20 Sivan 5704
|
|
1548
|
+
* HDate.fromGematriyaString('ה׳ אִיָיר תש״ח') // 5 Iyyar 5708
|
|
1549
|
+
*/
|
|
1550
|
+
static fromGematriyaString(str, currentThousands = 5000) {
|
|
1551
|
+
const parts = str.split(' ').filter(x => x.length !== 0);
|
|
1552
|
+
const numParts = parts.length;
|
|
1553
|
+
if (numParts !== 3 && numParts !== 4) {
|
|
1554
|
+
throw new RangeError(`Unable to parse gematriya string: "${str}"`);
|
|
1555
|
+
}
|
|
1556
|
+
const day = gematriyaStrToNum(parts[0]);
|
|
1557
|
+
const monthStr = numParts === 3 ? parts[1] : parts[1] + ' ' + parts[2];
|
|
1558
|
+
const month = HDate.monthFromName(monthStr);
|
|
1559
|
+
const yearStr = numParts === 3 ? parts[2] : parts[3];
|
|
1560
|
+
let year = gematriyaStrToNum(yearStr);
|
|
1561
|
+
if (year < 1000) {
|
|
1562
|
+
year += currentThousands;
|
|
1563
|
+
}
|
|
1564
|
+
return new HDate(day, month, year);
|
|
1565
|
+
}
|
|
1566
|
+
}
|
|
1567
|
+
function standardizeUnits(units) {
|
|
1568
|
+
switch (units) {
|
|
1569
|
+
case 'd':
|
|
1570
|
+
return UNITS_DAY;
|
|
1571
|
+
case 'w':
|
|
1572
|
+
return UNITS_WEEK;
|
|
1573
|
+
case 'M':
|
|
1574
|
+
return UNITS_MONTH;
|
|
1575
|
+
case 'y':
|
|
1576
|
+
return UNITS_YEAR;
|
|
1577
|
+
}
|
|
1578
|
+
const str = String(units || '')
|
|
1579
|
+
.toLowerCase()
|
|
1580
|
+
.replace(/s$/, '');
|
|
1581
|
+
switch (str) {
|
|
1582
|
+
case UNITS_DAY:
|
|
1583
|
+
case UNITS_WEEK:
|
|
1584
|
+
case UNITS_MONTH:
|
|
1585
|
+
case UNITS_YEAR:
|
|
1586
|
+
return str;
|
|
1587
|
+
}
|
|
1588
|
+
throw new TypeError(`Invalid units '${units}'`);
|
|
1589
|
+
}
|
|
1590
|
+
function getDayOfTranslation(locale) {
|
|
1591
|
+
switch (locale) {
|
|
1592
|
+
case 'en':
|
|
1593
|
+
case 's':
|
|
1594
|
+
case 'a':
|
|
1595
|
+
case 'ashkenazi':
|
|
1596
|
+
return ' of';
|
|
1597
|
+
}
|
|
1598
|
+
const ofStr = Locale.lookupTranslation('of', locale);
|
|
1599
|
+
if (ofStr) {
|
|
1600
|
+
return ' ' + ofStr;
|
|
1601
|
+
}
|
|
1602
|
+
if (locale.startsWith('ashkenazi')) {
|
|
1603
|
+
return ' of';
|
|
1604
|
+
}
|
|
1605
|
+
return '';
|
|
1606
|
+
}
|
|
1607
|
+
/**
|
|
1608
|
+
* Sets the day of the month of the date. Returns the object it was called upon
|
|
1609
|
+
* @private
|
|
1610
|
+
* @param month A number, or Hebrew month name string
|
|
1611
|
+
*/
|
|
1612
|
+
function setMonth(hd, month) {
|
|
1613
|
+
hd.mm = HDate.monthNum(month);
|
|
1614
|
+
fix(hd);
|
|
1615
|
+
return hd;
|
|
1616
|
+
}
|
|
1617
|
+
function setDate(hd, date) {
|
|
1618
|
+
hd.dd = date;
|
|
1619
|
+
fix(hd);
|
|
1620
|
+
return hd;
|
|
1621
|
+
}
|
|
1622
|
+
function fix(hd) {
|
|
1623
|
+
fixMonth(hd);
|
|
1624
|
+
fixDate(hd);
|
|
1625
|
+
}
|
|
1626
|
+
function fixDate(hd) {
|
|
1627
|
+
if (hd.dd < 1) {
|
|
1628
|
+
if (hd.mm === months.TISHREI) {
|
|
1629
|
+
hd.yy -= 1;
|
|
1630
|
+
}
|
|
1631
|
+
hd.dd += daysInMonth(hd.mm, hd.yy);
|
|
1632
|
+
hd.mm -= 1;
|
|
1633
|
+
fix(hd);
|
|
1634
|
+
}
|
|
1635
|
+
if (hd.dd > daysInMonth(hd.mm, hd.yy)) {
|
|
1636
|
+
if (hd.mm === months.ELUL) {
|
|
1637
|
+
hd.yy += 1;
|
|
1638
|
+
}
|
|
1639
|
+
hd.dd -= daysInMonth(hd.mm, hd.yy);
|
|
1640
|
+
if (hd.mm === monthsInYear(hd.yy)) {
|
|
1641
|
+
hd.mm = 1; // rollover to NISAN
|
|
1642
|
+
}
|
|
1643
|
+
else {
|
|
1644
|
+
hd.mm += 1;
|
|
1645
|
+
}
|
|
1646
|
+
fix(hd);
|
|
1647
|
+
}
|
|
1648
|
+
fixMonth(hd);
|
|
1649
|
+
}
|
|
1650
|
+
function fixMonth(hd) {
|
|
1651
|
+
if (hd.mm === months.ADAR_II && !hd.isLeapYear()) {
|
|
1652
|
+
hd.mm -= 1; // to Adar I
|
|
1653
|
+
fix(hd);
|
|
1654
|
+
}
|
|
1655
|
+
else if (hd.mm < 1) {
|
|
1656
|
+
hd.mm += monthsInYear(hd.yy);
|
|
1657
|
+
hd.yy -= 1;
|
|
1658
|
+
fix(hd);
|
|
1659
|
+
}
|
|
1660
|
+
else if (hd.mm > monthsInYear(hd.yy)) {
|
|
1661
|
+
hd.mm -= monthsInYear(hd.yy);
|
|
1662
|
+
hd.yy += 1;
|
|
1663
|
+
fix(hd);
|
|
1664
|
+
}
|
|
1665
|
+
delete hd.rd;
|
|
1666
|
+
}
|
|
1667
|
+
function onOrBefore(day, t, offset) {
|
|
1668
|
+
return new HDate(HDate.dayOnOrBefore(day, t.abs() + offset));
|
|
1669
|
+
}
|
|
1670
|
+
|
|
1671
|
+
/*! @hebcal/core v5.7.7 */
|
|
1672
|
+
var poAshkenazi = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);" }, "contexts": { "": { "Shabbat": ["Shabbos"], "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"], "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"], "Asara B'Tevet": ["Asara B’Teves"], "Alot HaShachar": ["Alos HaShachar"], "Kriat Shema, sof zeman": ["Krias Shema, sof zman"], "Tefilah, sof zeman": ["Tefilah, sof zman"], "Kriat Shema, sof zeman (MGA)": ["Krias Shema, sof zman (MGA)"], "Tefilah, sof zeman (MGA)": ["Tefilah, sof zman (MGA)"], "Chatzot HaLailah": ["Chatzos HaLailah"], "Chatzot hayom": ["Chatzos"], "Tzeit HaKochavim": ["Tzeis HaKochavim"], "Birkat Hachamah": ["Birkas Hachamah"], "Shushan Purim Katan": ["Shushan Purim Koton"] } } };
|
|
1673
|
+
|
|
1674
|
+
/*! @hebcal/core v5.7.7 */
|
|
1675
|
+
var poHe$1 = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);" }, "contexts": { "": { "Shabbat": ["שַׁבָּת"], "Daf Yomi": ["דַף יוֹמִי"], "Parashat": ["פָּרָשַׁת"], "Achrei Mot": ["אַחֲרֵי מוֹת"], "Balak": ["בָּלָק"], "Bamidbar": ["בְּמִדְבַּר"], "Bechukotai": ["בְּחֻקֹּתַי"], "Beha'alotcha": ["בְּהַעֲלֹתְךָ"], "Behar": ["בְּהַר"], "Bereshit": ["בְּרֵאשִׁית"], "Beshalach": ["בְּשַׁלַּח"], "Bo": ["בֹּא"], "Chayei Sara": ["חַיֵּי שָֹרָה"], "Chukat": ["חֻקַּת"], "Devarim": ["דְּבָרִים"], "Eikev": ["עֵקֶב"], "Emor": ["אֱמוֹר"], "Ha'azinu": ["הַאֲזִינוּ"], "Kedoshim": ["קְדשִׁים"], "Ki Tavo": ["כִּי־תָבוֹא"], "Ki Teitzei": ["כִּי־תֵצֵא"], "Ki Tisa": ["כִּי תִשָּׂא"], "Korach": ["קוֹרַח"], "Lech-Lecha": ["לֶךְ־לְךָ"], "Masei": ["מַסְעֵי"], "Matot": ["מַּטּוֹת"], "Metzora": ["מְּצֹרָע"], "Miketz": ["מִקֵּץ"], "Mishpatim": ["מִּשְׁפָּטִים"], "Nasso": ["נָשׂא"], "Nitzavim": ["נִצָּבִים"], "Noach": ["נֹחַ"], "Pekudei": ["פְקוּדֵי"], "Pinchas": ["פִּינְחָס"], "Re'eh": ["רְאֵה"], "Sh'lach": ["שְׁלַח־לְךָ"], "Shemot": ["שְׁמוֹת"], "Shmini": ["שְּׁמִינִי"], "Shoftim": ["שׁוֹפְטִים"], "Tazria": ["תַזְרִיעַ"], "Terumah": ["תְּרוּמָה"], "Tetzaveh": ["תְּצַוֶּה"], "Toldot": ["תּוֹלְדוֹת"], "Tzav": ["צַו"], "Vaera": ["וָאֵרָא"], "Vaetchanan": ["וָאֶתְחַנַּן"], "Vayakhel": ["וַיַּקְהֵל"], "Vayechi": ["וַיְחִי"], "Vayeilech": ["וַיֵּלֶךְ"], "Vayera": ["וַיֵּרָא"], "Vayeshev": ["וַיֵּשֶׁב"], "Vayetzei": ["וַיֵּצֵא"], "Vayigash": ["וַיִּגַּשׁ"], "Vayikra": ["וַיִּקְרָא"], "Vayishlach": ["וַיִּשְׁלַח"], "Vezot Haberakhah": ["וְזֹאת הַבְּרָכָה"], "Yitro": ["יִתְרוֹ"], "Asara B'Tevet": ["עֲשָׂרָה בְּטֵבֵת"], "Candle lighting": ["הַדְלָקַת נֵרוֹת"], "Chanukah": ["חֲנוּכָּה"], "Chanukah: 1 Candle": ["חֲנוּכָּה: א׳ נֵר"], "Chanukah: 2 Candles": ["חֲנוּכָּה: ב׳ נֵרוֹת"], "Chanukah: 3 Candles": ["חֲנוּכָּה: ג׳ נֵרוֹת"], "Chanukah: 4 Candles": ["חֲנוּכָּה: ד׳ נֵרוֹת"], "Chanukah: 5 Candles": ["חֲנוּכָּה: ה׳ נֵרוֹת"], "Chanukah: 6 Candles": ["חֲנוּכָּה: ו׳ נֵרוֹת"], "Chanukah: 7 Candles": ["חֲנוּכָּה: ז׳ נֵרוֹת"], "Chanukah: 8 Candles": ["חֲנוּכָּה: ח׳ נֵרוֹת"], "Chanukah: 8th Day": ["חֲנוּכָּה: יוֹם ח׳"], "Days of the Omer": ["סְפִירַת הָעוֹמֶר"], "Omer": ["עוֹמֶר"], "day of the Omer": ["בָּעוֹמֶר"], "Erev Pesach": ["עֶרֶב פֶּסַח"], "Erev Purim": ["עֶרֶב פּוּרִים"], "Erev Rosh Hashana": ["עֶרֶב רֹאשׁ הַשָּׁנָה"], "Erev Shavuot": ["עֶרֶב שָׁבוּעוֹת"], "Erev Simchat Torah": ["עֶרֶב שִׂמְחַת תּוֹרָה"], "Erev Sukkot": ["עֶרֶב סוּכּוֹת"], "Erev Tish'a B'Av": ["עֶרֶב תִּשְׁעָה בְּאָב"], "Erev Yom Kippur": ["עֶרֶב יוֹם כִּפּוּר"], "Havdalah": ["הַבְדָּלָה"], "Lag BaOmer": ["ל״ג בָּעוֹמֶר"], "Leil Selichot": ["סליחות"], "Pesach": ["פֶּסַח"], "Pesach I": ["פֶּסַח א׳"], "Pesach II": ["פֶּסַח ב׳"], "Pesach II (CH''M)": ["פֶּסַח ב׳ (חוה״מ)"], "Pesach III (CH''M)": ["פֶּסַח ג׳ (חוה״מ)"], "Pesach IV (CH''M)": ["פֶּסַח ד׳ (חוה״מ)"], "Pesach Sheni": ["פֶּסַח שני"], "Pesach V (CH''M)": ["פֶּסַח ה׳ (חוה״מ)"], "Pesach VI (CH''M)": ["פֶּסַח ו׳ (חוה״מ)"], "Pesach VII": ["פֶּסַח ז׳"], "Pesach VIII": ["פֶּסַח ח׳"], "Purim": ["פּוּרִים"], "Purim Katan": ["פּוּרִים קָטָן"], "Rosh Chodesh %s": ["רֹאשׁ חוֹדֶשׁ %s"], "Rosh Chodesh": ["רֹאשׁ חוֹדֶשׁ"], "Rosh Hashana": ["רֹאשׁ הַשָּׁנָה"], "Rosh Hashana I": ["רֹאשׁ הַשָּׁנָה א׳"], "Rosh Hashana II": ["רֹאשׁ הַשָּׁנָה ב׳"], "Shabbat Chazon": ["שַׁבָּת חֲזוֹן"], "Shabbat HaChodesh": ["שַׁבָּת הַחֹדֶשׁ"], "Shabbat HaGadol": ["שַׁבָּת הַגָּדוֹל"], "Shabbat Nachamu": ["שַׁבָּת נַחֲמוּ"], "Shabbat Parah": ["שַׁבָּת פּרה"], "Shabbat Shekalim": ["שַׁבָּת שְׁקָלִים"], "Shabbat Shuva": ["שַׁבָּת שׁוּבָה"], "Shabbat Zachor": ["שַׁבָּת זָכוֹר"], "Shavuot": ["שָׁבוּעוֹת"], "Shavuot I": ["שָׁבוּעוֹת א׳"], "Shavuot II": ["שָׁבוּעוֹת ב׳"], "Shmini Atzeret": ["שְׁמִינִי עֲצֶרֶת"], "Shushan Purim": ["שׁוּשָׁן פּוּרִים"], "Sigd": ["סיגד"], "Simchat Torah": ["שִׂמְחַת תּוֹרָה"], "Sukkot": ["סוּכּוֹת"], "Sukkot I": ["סוּכּוֹת א׳"], "Sukkot II": ["סוּכּוֹת ב׳"], "Sukkot II (CH''M)": ["סוּכּוֹת ב׳ (חוה״מ)"], "Sukkot III (CH''M)": ["סוּכּוֹת ג׳ (חוה״מ)"], "Sukkot IV (CH''M)": ["סוּכּוֹת ד׳ (חוה״מ)"], "Sukkot V (CH''M)": ["סוּכּוֹת ה׳ (חוה״מ)"], "Sukkot VI (CH''M)": ["סוּכּוֹת ו׳ (חוה״מ)"], "Sukkot VII (Hoshana Raba)": ["סוּכּוֹת ז׳ (הוֹשַׁעְנָא רַבָּה)"], "Ta'anit Bechorot": ["תַּעֲנִית בְּכוֹרוֹת"], "Ta'anit Esther": ["תַּעֲנִית אֶסְתֵּר"], "Tish'a B'Av": ["תִּשְׁעָה בְּאָב"], "Tu B'Av": ["טוּ בְּאָב"], "Tu BiShvat": ["טוּ בִּשְׁבָט"], "Tu B'Shvat": ["טוּ בִּשְׁבָט"], "Tzom Gedaliah": ["צוֹם גְּדַלְיָה"], "Tzom Tammuz": ["צוֹם תָּמוּז"], "Yom HaAtzma'ut": ["יוֹם הָעַצְמָאוּת"], "Yom HaShoah": ["יוֹם הַשּׁוֹאָה"], "Yom HaZikaron": ["יוֹם הַזִּכָּרוֹן"], "Yom Kippur": ["יוֹם כִּפּוּר"], "Yom Yerushalayim": ["יוֹם יְרוּשָׁלַיִם"], "Yom HaAliyah": ["יוֹם הַעֲלִיָּה"], "Yom HaAliyah School Observance": ["שְׁמִירָת בֵּית הַסֵפֶר לְיוֹם הַעֲלִיָּה"], "Rosh Chodesh Adar": ["רֹאשׁ חוֹדֶשׁ אַדָר"], "Rosh Chodesh Adar I": ["רֹאשׁ חוֹדֶשׁ אַדָר א׳"], "Rosh Chodesh Adar II": ["רֹאשׁ חוֹדֶשׁ אַדָר ב׳"], "Rosh Chodesh Av": ["רֹאשׁ חוֹדֶשׁ אָב"], "Rosh Chodesh Cheshvan": ["רֹאשׁ חוֹדֶשׁ חֶשְׁוָן"], "Rosh Chodesh Elul": ["רֹאשׁ חוֹדֶשׁ אֱלוּל"], "Rosh Chodesh Iyyar": ["רֹאשׁ חוֹדֶשׁ אִיָיר"], "Rosh Chodesh Kislev": ["רֹאשׁ חוֹדֶשׁ כִּסְלֵו"], "Rosh Chodesh Nisan": ["רֹאשׁ חוֹדֶשׁ נִיסָן"], "Rosh Chodesh Sh'vat": ["רֹאשׁ חוֹדֶשׁ שְׁבָט"], "Rosh Chodesh Sivan": ["רֹאשׁ חוֹדֶשׁ סִיוָן"], "Rosh Chodesh Tamuz": ["רֹאשׁ חוֹדֶשׁ תָּמוּז"], "Rosh Chodesh Tevet": ["רֹאשׁ חוֹדֶשׁ טֵבֵת"], "min": ["דַּקּוֹת"], "Fast begins": ["תחילת הַצוֹם"], "Fast ends": ["סִיּוּם הַצוֹם"], "Rosh Hashana LaBehemot": ["רֹאשׁ הַשָּׁנָה לְמַעְשַׂר בְּהֵמָה"], "Tish'a B'Av (observed)": ["תִּשְׁעָה בְּאָב נִדחֶה"], "Shabbat Mevarchim Chodesh": ["שַׁבָּת מְבָרְכִים חוֹדֶשׁ"], "Shabbat Shirah": ["שַׁבָּת שִׁירָה"], "Chatzot HaLailah": ["חֲצוֹת הַלַיְלָה"], "Alot haShachar": ["עֲלוֹת הַשַּׁחַר"], "Misheyakir": ["מִשֶּׁיַּכִּיר"], "Misheyakir Machmir": ["מִשֶּׁיַּכִּיר מַחמִיר"], "Dawn": ["דִּימְדּוּמֵי בּוֹקֵר"], "Sunrise": ["הַנֵץ הַחַמָּה"], "Kriat Shema, sof zeman": ["סוֹף זְמַן קְרִיאַת שְׁמַע גר״א"], "Tefilah, sof zeman": ["סוֹף זְמַן תְּפִלָּה גר״א"], "Kriat Shema, sof zeman (MGA)": ["סוֹף זְמַן קְרִיאַת שְׁמַע מג״א"], "Tefilah, sof zeman (MGA)": ["סוֹף זְמַן תְּפִלָּה מג״א"], "Chatzot hayom": ["חֲצוֹת הַיּוֹם"], "Mincha Gedolah": ["מִנְחָה גְּדוֹלָה"], "Mincha Ketanah": ["מִנְחָה קְטַנָּה"], "Plag HaMincha": ["פְּלַג הַמִּנְחָה"], "Dusk": ["דִּימְדּוּמֵי עֶרֶב"], "Sunset": ["שְׁקִיעָה"], "Nightfall - End of ordained fasts": ["לַיְלָה - גמר תעניות דרבנן"], "Tzeit HaKochavim": ["צֵאת הַכּוֹכָבִים"], "Lovingkindness": ["חֶֽסֶד"], "Might": ["גְבוּרָה"], "Beauty": ["תִּפאֶרֶת"], "Eternity": ["נֶּֽצַח"], "Splendor": ["הוֹד"], "Foundation": ["יְּסוֹד"], "Majesty": ["מַּלְכוּת"], "day": ["יוֹם"], "Yom Kippur Katan": ["יוֹם כִּפּוּר קָטָן"], "Family Day": ["יוֹם הַמִּשׁפָּחָה"], "Yitzhak Rabin Memorial Day": ["יוֹם הַזִּכָּרוֹן ליצחק רבין"], "Jabotinsky Day": ["יוֹם ז׳בוטינסקי"], "Herzl Day": ["יוֹם הרצל"], "Ben-Gurion Day": ["יוֹם בן־גוריון"], "Hebrew Language Day": ["יוֹם הַשָׂפָה הַעִברִית"], "Birkat Hachamah": ["בִרְכַּת הַחַמָּה"], "Shushan Purim Katan": ["שׁוּשָׁן פּוּרִים קָטָן"], "Purim Meshulash": ["פּוּרִים מְשׁוּלָּשׁ"], "after sunset": ["לְאַחַר הַשְׁקִיעָה"], "Yerushalmi": ["יְרוּשַׁלְמִי"], "Chag HaBanot": ["חַג הַבָּנוֹת"], "Joshua": ["יְהוֹשׁוּעַ"], "Judges": ["שׁוֹפְטִים"], "I Samuel": ["שְׁמוּאֵל רִאשׁוֹן"], "II Samuel": ["שְׁמוּאֵל שֵׁנִי"], "I Kings": ["מְלָכִים רִאשׁוֹן"], "II Kings": ["מְלָכִים שֵׁנִי"], "Isaiah": ["יְשַׁעְיָהוּ"], "Jeremiah": ["יִרְמְיָהוּ"], "Ezekiel": ["יְחֶזְקֵאל"], "Hosea": ["הוֹשֵׁעַ"], "Joel": ["יוֹאֵל"], "Amos": ["עָמוּס"], "Obadiah": ["עוֹבַדְיָה"], "Jonah": ["יוֹנָה"], "Micah": ["מִיכָה"], "Nachum": ["נַחוּם"], "Habakkuk": ["חֲבַקּוּק"], "Zephaniah": ["צְפַנְיָה"], "Haggai": ["חַגַּי"], "Zechariah": ["זְכַרְיָה"], "Malachi": ["מַלְאָכִי"], "Psalms": ["תְּהִלִּים"], "Proverbs": ["מִשְׁלֵי"], "Job": ["אִיּוֹב"], "Song of Songs": ["שִׁיר הַשִּׁירִים"], "Ruth": ["רוּת"], "Lamentations": ["אֵיכָה"], "Ecclesiastes": ["קֹהֶלֶת"], "Esther": ["אֶסְתֵּר"], "Daniel": ["דָּנִיֵּאל"], "Ezra": ["עֶזְרָא"], "Nehemiah": ["נְחֶמְיָה"], "I Chronicles": ["דִברֵי הַיָמִים רִאשׁוֹן"], "II Chronicles": ["דִברֵי הַיָמִים שֵׁנִי"], "Molad": ["מוֹלָד הָלְּבָנָה"], "chalakim": ["חֲלָקִים"], "Pirkei Avot": ["פִּרְקֵי אָבוֹת"] } } };
|
|
1676
|
+
|
|
1677
|
+
/*! @hebcal/core v5.7.7 */
|
|
1678
|
+
|
|
1679
|
+
Locale.addTranslations('he', poHe$1);
|
|
1680
|
+
Locale.addTranslations('h', poHe$1);
|
|
1681
|
+
Locale.addTranslations('ashkenazi', poAshkenazi);
|
|
1682
|
+
Locale.addTranslations('a', poAshkenazi);
|
|
1683
|
+
/* Hebrew without nikkud */
|
|
1684
|
+
const heStrs$1 = poHe$1.contexts[''];
|
|
1685
|
+
const heNoNikud$1 = {};
|
|
1686
|
+
for (const [key, val] of Object.entries(heStrs$1)) {
|
|
1687
|
+
heNoNikud$1[key] = [Locale.hebrewStripNikkud(val[0])];
|
|
1688
|
+
}
|
|
1689
|
+
const poHeNoNikud$1 = {
|
|
1690
|
+
headers: poHe$1.headers,
|
|
1691
|
+
contexts: { '': heNoNikud$1 },
|
|
1692
|
+
};
|
|
1693
|
+
Locale.addTranslations('he-x-NoNikud', poHeNoNikud$1);
|
|
1694
|
+
|
|
1695
|
+
/*! @hebcal/core v5.7.7 */
|
|
1696
|
+
|
|
1697
|
+
/**
|
|
1698
|
+
* Holiday flags for Event. These flags are typically
|
|
1699
|
+
* combined using bitwise arithmetic to form a mask.
|
|
1700
|
+
* @readonly
|
|
1701
|
+
* @enum {number}
|
|
1702
|
+
*/
|
|
1703
|
+
const flags = {
|
|
1704
|
+
/** Chag, yontiff, yom tov */
|
|
1705
|
+
CHAG: 0x000001,
|
|
1706
|
+
/** Light candles 18 minutes before sundown */
|
|
1707
|
+
LIGHT_CANDLES: 0x000002,
|
|
1708
|
+
/** End of holiday (end of Yom Tov) */
|
|
1709
|
+
YOM_TOV_ENDS: 0x000004,
|
|
1710
|
+
/** Observed only in the Diaspora (chutz l'aretz) */
|
|
1711
|
+
CHUL_ONLY: 0x000008,
|
|
1712
|
+
/** Observed only in Israel */
|
|
1713
|
+
IL_ONLY: 0x000010,
|
|
1714
|
+
/** Light candles in the evening at Tzeit time (3 small stars) */
|
|
1715
|
+
LIGHT_CANDLES_TZEIS: 0x000020,
|
|
1716
|
+
/** Candle-lighting for Chanukah */
|
|
1717
|
+
CHANUKAH_CANDLES: 0x000040,
|
|
1718
|
+
/** Rosh Chodesh, beginning of a new Hebrew month */
|
|
1719
|
+
ROSH_CHODESH: 0x000080,
|
|
1720
|
+
/** Minor fasts like Tzom Tammuz, Ta'anit Esther, ... */
|
|
1721
|
+
MINOR_FAST: 0x000100,
|
|
1722
|
+
/** Shabbat Shekalim, Zachor, ... */
|
|
1723
|
+
SPECIAL_SHABBAT: 0x000200,
|
|
1724
|
+
/** Weekly sedrot on Saturdays */
|
|
1725
|
+
PARSHA_HASHAVUA: 0x000400,
|
|
1726
|
+
/** Daily page of Talmud (Bavli) */
|
|
1727
|
+
DAF_YOMI: 0x000800,
|
|
1728
|
+
/** Days of the Omer */
|
|
1729
|
+
OMER_COUNT: 0x001000,
|
|
1730
|
+
/** Yom HaShoah, Yom HaAtzma'ut, ... */
|
|
1731
|
+
MODERN_HOLIDAY: 0x002000,
|
|
1732
|
+
/** Yom Kippur and Tish'a B'Av */
|
|
1733
|
+
MAJOR_FAST: 0x004000,
|
|
1734
|
+
/** On the Saturday before Rosh Chodesh */
|
|
1735
|
+
SHABBAT_MEVARCHIM: 0x008000,
|
|
1736
|
+
/** Molad */
|
|
1737
|
+
MOLAD: 0x010000,
|
|
1738
|
+
/** Yahrzeit or Hebrew Anniversary */
|
|
1739
|
+
USER_EVENT: 0x020000,
|
|
1740
|
+
/** Daily Hebrew date ("11th of Sivan, 5780") */
|
|
1741
|
+
HEBREW_DATE: 0x040000,
|
|
1742
|
+
/** A holiday that's not major, modern, rosh chodesh, or a fast day */
|
|
1743
|
+
MINOR_HOLIDAY: 0x080000,
|
|
1744
|
+
/** Evening before a major or minor holiday */
|
|
1745
|
+
EREV: 0x100000,
|
|
1746
|
+
/** Chol haMoed, intermediate days of Pesach or Sukkot */
|
|
1747
|
+
CHOL_HAMOED: 0x200000,
|
|
1748
|
+
/** Mishna Yomi */
|
|
1749
|
+
MISHNA_YOMI: 0x400000,
|
|
1750
|
+
/** Yom Kippur Katan, minor day of atonement on the day preceeding each Rosh Chodesh */
|
|
1751
|
+
YOM_KIPPUR_KATAN: 0x800000,
|
|
1752
|
+
/** Daily page of Jerusalem Talmud (Yerushalmi) */
|
|
1753
|
+
YERUSHALMI_YOMI: 0x1000000,
|
|
1754
|
+
/** Nach Yomi */
|
|
1755
|
+
NACH_YOMI: 0x2000000,
|
|
1756
|
+
/** Daily Learning */
|
|
1757
|
+
DAILY_LEARNING: 0x4000000,
|
|
1758
|
+
};
|
|
1759
|
+
const flagToCategory = [
|
|
1760
|
+
[flags.MAJOR_FAST, 'holiday', 'major', 'fast'],
|
|
1761
|
+
[flags.CHANUKAH_CANDLES, 'holiday', 'major'],
|
|
1762
|
+
[flags.HEBREW_DATE, 'hebdate'],
|
|
1763
|
+
[flags.MINOR_FAST, 'holiday', 'fast'],
|
|
1764
|
+
[flags.MINOR_HOLIDAY, 'holiday', 'minor'],
|
|
1765
|
+
[flags.MODERN_HOLIDAY, 'holiday', 'modern'],
|
|
1766
|
+
[flags.MOLAD, 'molad'],
|
|
1767
|
+
[flags.OMER_COUNT, 'omer'],
|
|
1768
|
+
[flags.PARSHA_HASHAVUA, 'parashat'], // backwards-compat
|
|
1769
|
+
[flags.ROSH_CHODESH, 'roshchodesh'],
|
|
1770
|
+
[flags.SHABBAT_MEVARCHIM, 'mevarchim'],
|
|
1771
|
+
[flags.SPECIAL_SHABBAT, 'holiday', 'shabbat'],
|
|
1772
|
+
[flags.USER_EVENT, 'user'],
|
|
1773
|
+
];
|
|
1774
|
+
/**
|
|
1775
|
+
* Represents an Event with a title, date, and flags.
|
|
1776
|
+
*
|
|
1777
|
+
* Events are used to represent holidays, candle-lighting times,
|
|
1778
|
+
* Torah readings, and more.
|
|
1779
|
+
*
|
|
1780
|
+
* To get the title of the event a language other than English
|
|
1781
|
+
* with Sephardic transliterations, use the `render()` method.
|
|
1782
|
+
*/
|
|
1783
|
+
class Event {
|
|
1784
|
+
/**
|
|
1785
|
+
* Constructs Event
|
|
1786
|
+
* @param date Hebrew date event occurs
|
|
1787
|
+
* @param desc Description (not translated)
|
|
1788
|
+
* @param [mask=0] optional bitmask of holiday flags (see {@link flags})
|
|
1789
|
+
* @param [attrs={}] optional additional attributes (e.g. `eventTimeStr`, `cholHaMoedDay`)
|
|
1790
|
+
*/
|
|
1791
|
+
constructor(date, desc, mask = 0, attrs) {
|
|
1792
|
+
if (!HDate.isHDate(date)) {
|
|
1793
|
+
throw new TypeError(`Invalid Event date: ${date}`);
|
|
1794
|
+
}
|
|
1795
|
+
else if (typeof desc !== 'string') {
|
|
1796
|
+
throw new TypeError(`Invalid Event description: ${desc}`);
|
|
1797
|
+
}
|
|
1798
|
+
this.date = date;
|
|
1799
|
+
this.desc = desc;
|
|
1800
|
+
this.mask = +mask;
|
|
1801
|
+
if (typeof attrs === 'object' && attrs !== null) {
|
|
1802
|
+
Object.assign(this, attrs);
|
|
1803
|
+
}
|
|
1804
|
+
}
|
|
1805
|
+
/**
|
|
1806
|
+
* Hebrew date of this event
|
|
1807
|
+
*/
|
|
1808
|
+
getDate() {
|
|
1809
|
+
return this.date;
|
|
1810
|
+
}
|
|
1811
|
+
/**
|
|
1812
|
+
* Untranslated title of this event. Note that these description
|
|
1813
|
+
* strings are always in English and will remain stable across releases.
|
|
1814
|
+
* To get the title of the event in another language, use the
|
|
1815
|
+
* `render()` method.
|
|
1816
|
+
*/
|
|
1817
|
+
getDesc() {
|
|
1818
|
+
return this.desc;
|
|
1819
|
+
}
|
|
1820
|
+
/**
|
|
1821
|
+
* Bitmask of optional event flags. See {@link flags}
|
|
1822
|
+
*/
|
|
1823
|
+
getFlags() {
|
|
1824
|
+
return this.mask;
|
|
1825
|
+
}
|
|
1826
|
+
/**
|
|
1827
|
+
* Returns (translated) description of this event
|
|
1828
|
+
* @example
|
|
1829
|
+
* const ev = new Event(new HDate(6, 'Sivan', 5749), 'Shavuot', flags.CHAG);
|
|
1830
|
+
* ev.render('en'); // 'Shavuot'
|
|
1831
|
+
* ev.render('he'); // 'שָׁבוּעוֹת'
|
|
1832
|
+
* ev.render('ashkenazi'); // 'Shavuos'
|
|
1833
|
+
* @param [locale] Optional locale name (defaults to active locale).
|
|
1834
|
+
*/
|
|
1835
|
+
render(locale) {
|
|
1836
|
+
return Locale.gettext(this.desc, locale);
|
|
1837
|
+
}
|
|
1838
|
+
/**
|
|
1839
|
+
* Returns a brief (translated) description of this event.
|
|
1840
|
+
* For most events, this is the same as render(). For some events, it procudes
|
|
1841
|
+
* a shorter text (e.g. without a time or added description).
|
|
1842
|
+
* @param [locale] Optional locale name (defaults to active locale).
|
|
1843
|
+
*/
|
|
1844
|
+
renderBrief(locale) {
|
|
1845
|
+
return this.render(locale);
|
|
1846
|
+
}
|
|
1847
|
+
/**
|
|
1848
|
+
* Optional holiday-specific Emoji or `null`.
|
|
1849
|
+
*/
|
|
1850
|
+
getEmoji() {
|
|
1851
|
+
return this.emoji || null;
|
|
1852
|
+
}
|
|
1853
|
+
/**
|
|
1854
|
+
* Returns a simplified (untranslated) description for this event. For example,
|
|
1855
|
+
* the `HolidayEvent` class supports
|
|
1856
|
+
* "Erev Pesach" => "Pesach", and "Sukkot III (CH''M)" => "Sukkot".
|
|
1857
|
+
* For many holidays the basename and the event description are the same.
|
|
1858
|
+
*/
|
|
1859
|
+
basename() {
|
|
1860
|
+
return this.getDesc();
|
|
1861
|
+
}
|
|
1862
|
+
/**
|
|
1863
|
+
* Returns a URL to hebcal.com or sefaria.org for more detail on the event.
|
|
1864
|
+
* Returns `undefined` for events with no detail page.
|
|
1865
|
+
*/
|
|
1866
|
+
url() {
|
|
1867
|
+
return undefined;
|
|
1868
|
+
}
|
|
1869
|
+
/**
|
|
1870
|
+
* Is this event observed in Israel?
|
|
1871
|
+
* @example
|
|
1872
|
+
* const ev1 = new Event(new HDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY);
|
|
1873
|
+
* ev1.observedInIsrael(); // false
|
|
1874
|
+
* const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);
|
|
1875
|
+
* ev2.observedInIsrael(); // true
|
|
1876
|
+
*/
|
|
1877
|
+
observedInIsrael() {
|
|
1878
|
+
return !(this.mask & flags.CHUL_ONLY);
|
|
1879
|
+
}
|
|
1880
|
+
/**
|
|
1881
|
+
* Is this event observed in the Diaspora?
|
|
1882
|
+
* @example
|
|
1883
|
+
* const ev1 = new Event(new HDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY);
|
|
1884
|
+
* ev1.observedInDiaspora(); // true
|
|
1885
|
+
* const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);
|
|
1886
|
+
* ev2.observedInDiaspora(); // true
|
|
1887
|
+
*/
|
|
1888
|
+
observedInDiaspora() {
|
|
1889
|
+
return !(this.mask & flags.IL_ONLY);
|
|
1890
|
+
}
|
|
1891
|
+
/**
|
|
1892
|
+
* Is this event observed in Israel/Diaspora?
|
|
1893
|
+
* @example
|
|
1894
|
+
* const ev1 = new Event(new HDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY);
|
|
1895
|
+
* ev1.observedIn(false); // true
|
|
1896
|
+
* ev1.observedIn(true); // false
|
|
1897
|
+
* const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);
|
|
1898
|
+
* ev2.observedIn(false); // true
|
|
1899
|
+
* ev2.observedIn(true); // true
|
|
1900
|
+
* @param il
|
|
1901
|
+
*/
|
|
1902
|
+
observedIn(il) {
|
|
1903
|
+
return il ? this.observedInIsrael() : this.observedInDiaspora();
|
|
1904
|
+
}
|
|
1905
|
+
/**
|
|
1906
|
+
* Makes a clone of this Event object
|
|
1907
|
+
* @deprecated
|
|
1908
|
+
*/
|
|
1909
|
+
clone() {
|
|
1910
|
+
const ev = new Event(this.date, this.desc, this.mask);
|
|
1911
|
+
for (const property in this) {
|
|
1912
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
1913
|
+
if (this.hasOwnProperty(property)) {
|
|
1914
|
+
Object.defineProperty(ev, property, { value: this[property] });
|
|
1915
|
+
}
|
|
1916
|
+
}
|
|
1917
|
+
return ev;
|
|
1918
|
+
}
|
|
1919
|
+
/**
|
|
1920
|
+
* Returns a list of event categories
|
|
1921
|
+
*/
|
|
1922
|
+
getCategories() {
|
|
1923
|
+
const mask = this.getFlags();
|
|
1924
|
+
for (const attrs of flagToCategory) {
|
|
1925
|
+
const attr0 = attrs[0];
|
|
1926
|
+
if (mask & attr0) {
|
|
1927
|
+
return attrs.slice(1);
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
return ['unknown'];
|
|
1931
|
+
}
|
|
1932
|
+
}
|
|
1933
|
+
|
|
1934
|
+
/*! @hebcal/leyning v9.0.1 */
|
|
1935
|
+
var poHe = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);" }, "contexts": { "": { "Shabbat Machar Chodesh": ["שַׁבָּת מָחָר חוֹדֶשׁ"], "Shabbat Rosh Chodesh": ["שַׁבָּת רֹאשׁ חוֹדֶשׁ"], "Pesach I (on Shabbat)": ["פֶּסַח יוֹם א׳ (בְּשַׁבָּת)"], "Pesach Chol ha-Moed Day 1": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם א׳"], "Pesach Chol ha-Moed Day 2": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם ב׳"], "Pesach Chol ha-Moed Day 2 on Sunday": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם ב׳ (בְּיוֹם רִאשׁוֹן)"], "Pesach Chol ha-Moed Day 3": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם ג׳"], "Pesach Chol ha-Moed Day 3 on Monday": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם ג׳ (בְּיוֹם שָׁנִי)"], "Pesach Chol ha-Moed Day 4": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם ד׳"], "Pesach Chol ha-Moed Day 5": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם ה׳"], "Pesach Shabbat Chol ha-Moed": ["פֶּסַח שַׁבָּת חוֹל הַמּוֹעֵד"], "Pesach VII (on Shabbat)": ["פֶּסַח ז׳ (בְּשַׁבָּת)"], "Pesach VIII (on Shabbat)": ["פֶּסַח ח׳ (בְּשַׁבָּת)"], "Shavuot II (on Shabbat)": ["שָׁבוּעוֹת יוֹם ב׳ (בְּשַׁבָּת)"], "Rosh Hashana I (on Shabbat)": ["רֹאשׁ הַשָּׁנָה יוֹם א׳ (בְּשַׁבָּת)"], "Yom Kippur (on Shabbat)": ["יוֹם כִּפּוּר (בְּשַׁבָּת)"], "Yom Kippur (Mincha, Traditional)": ["יוֹם כִּפּוּר מִנחָה"], "Yom Kippur (Mincha, Alternate)": ["יוֹם כִּפּוּר מִנחָה"], "Sukkot I (on Shabbat)": ["סוּכּוֹת יוֹם א׳ (בְּשַׁבָּת)"], "Sukkot Chol ha-Moed Day 1": ["סוּכּוֹת חוֹל הַמּוֹעֵד יוֹם א׳"], "Sukkot Chol ha-Moed Day 2": ["סוּכּוֹת חוֹל הַמּוֹעֵד יוֹם ב׳"], "Sukkot Chol ha-Moed Day 3": ["סוּכּוֹת חוֹל הַמּוֹעֵד יוֹם ג׳"], "Sukkot Chol ha-Moed Day 4": ["סוּכּוֹת חוֹל הַמּוֹעֵד יוֹם ד׳"], "Sukkot Chol ha-Moed Day 5": ["סוּכּוֹת חוֹל הַמּוֹעֵד יוֹם ה׳"], "Sukkot Shabbat Chol ha-Moed": ["סוּכּוֹת שַׁבָּת חוֹל הַמּוֹעֵד"], "Sukkot Final Day (Hoshana Raba)": ["סוּכּוֹת ז׳ (הוֹשַׁעְנָא רַבָּה)"], "Shmini Atzeret (on Shabbat)": ["שְׁמִינִי עֲצֶרֶת (בְּשַׁבָּת)"], "Chanukah Day 1": ["חֲנוּכָּה יוֹם א׳"], "Chanukah Day 2": ["חֲנוּכָּה יוֹם ב׳"], "Chanukah Day 3": ["חֲנוּכָּה יוֹם ג׳"], "Chanukah Day 4": ["חֲנוּכָּה יוֹם ד׳"], "Chanukah Day 5": ["חֲנוּכָּה יוֹם ה׳"], "Chanukah Day 6": ["חֲנוּכָּה יוֹם ו׳"], "Chanukah Day 7": ["חֲנוּכָּה יוֹם ז׳"], "Chanukah Day 7 (on Rosh Chodesh)": ["חֲנוּכָּה יוֹם ז׳ (רֹאשׁ חוֹדֶשׁ)"], "Chanukah Day 8": ["חֲנוּכָּה יוֹם ח׳"], "Chanukah Day 1 (on Shabbat)": ["חֲנוּכָּה יוֹם א׳ (בְּשַׁבָּת)"], "Chanukah Day 2 (on Shabbat)": ["חֲנוּכָּה יוֹם ב׳ (בְּשַׁבָּת)"], "Chanukah Day 3 (on Shabbat)": ["חֲנוּכָּה יוֹם ג׳ (בְּשַׁבָּת)"], "Chanukah Day 4 (on Shabbat)": ["חֲנוּכָּה יוֹם ד׳ (בְּשַׁבָּת)"], "Chanukah Day 5 (on Shabbat)": ["חֲנוּכָּה יוֹם ה׳ (בְּשַׁבָּת)"], "Chanukah Day 7 (on Shabbat)": ["חֲנוּכָּה יוֹם ז׳ (בְּשַׁבָּת)"], "Chanukah Day 8 (on Shabbat)": ["חֲנוּכָּה יוֹם ח׳ (בְּשַׁבָּת)"], "Shabbat Rosh Chodesh Chanukah": ["שַׁבָּת רֹאשׁ חוֹדֶשׁ חֲנוּכָּה"], "Yom Kippur (Mincha)": ["יוֹם כִּפּוּר מִנחָה"], "Tish'a B'Av (Mincha)": ["תִּשְׁעָה בְּאָב מִנחָה"], "Asara B'Tevet (Mincha)": ["עֲשָׂרָה בְּטֵבֵת מִנחָה"], "Ta'anit Bechorot (Mincha)": ["תַּעֲנִית בְּכוֹרוֹת מִנחָה"], "Ta'anit Esther (Mincha)": ["תַּעֲנִית אֶסְתֵּר מִנחָה"], "Tzom Gedaliah (Mincha)": ["צוֹם גְּדַלְיָה מִנחָה"], "Tzom Tammuz (Mincha)": ["צוֹם תָּמוּז מִנחָה"] } } };
|
|
1936
|
+
|
|
1937
|
+
/*! @hebcal/leyning v9.0.1 */
|
|
1938
|
+
|
|
1939
|
+
Locale.addTranslations('he', poHe);
|
|
1940
|
+
Locale.addTranslations('h', poHe);
|
|
1941
|
+
const heStrs = poHe.contexts[''];
|
|
1942
|
+
const heNoNikud = {};
|
|
1943
|
+
for (const [key, val] of Object.entries(heStrs)) {
|
|
1944
|
+
heNoNikud[key] = [Locale.hebrewStripNikkud(val[0])];
|
|
1945
|
+
}
|
|
1946
|
+
const poHeNoNikud = {
|
|
1947
|
+
headers: poHe.headers,
|
|
1948
|
+
contexts: { '': heNoNikud },
|
|
1949
|
+
};
|
|
1950
|
+
Locale.addTranslations('he-x-NoNikud', poHeNoNikud);
|
|
1951
|
+
|
|
1952
|
+
/*! @hebcal/leyning v9.0.1 */
|
|
1953
|
+
const Bereshit={num:1,hebrew:"בְּרֵאשִׁית",book:1,haft:{k:"Isaiah",b:"42:5",e:"43:10"},seph:{k:"Isaiah",b:"42:5",e:"42:21"},fullkriyah:{"1":["1:1","2:3"],"2":["2:4","2:19"],"3":["2:20","3:21"],"4":["3:22","4:18"],"5":["4:19","4:22"],"6":["4:23","5:24"],"7":["5:25","6:8"],M:["6:5","6:8"]},weekday:{"1":["1:1","1:5"],"2":["1:6","1:8"],"3":["1:9","1:13"]}};const Noach={num:2,hebrew:"נֹחַ",book:1,haft:{k:"Isaiah",b:"54:1",e:"55:5"},seph:{k:"Isaiah",b:"54:1",e:"54:10"},fullkriyah:{"1":["6:9","6:22"],"2":["7:1","7:16"],"3":["7:17","8:14"],"4":["8:15","9:7"],"5":["9:8","9:17"],"6":["9:18","10:32"],"7":["11:1","11:32"],M:["11:29","11:32"]},weekday:{"1":["6:9","6:16"],"2":["6:17","6:19"],"3":["6:20","6:22"]}};const Vayera={num:4,hebrew:"וַיֵּרָא",book:1,haft:{k:"II Kings",b:"4:1",e:"4:37"},seph:{k:"II Kings",b:"4:1",e:"4:23"},fullkriyah:{"1":["18:1","18:14"],"2":["18:15","18:33"],"3":["19:1","19:20"],"4":["19:21","21:4"],"5":["21:5","21:21"],"6":["21:22","21:34"],"7":["22:1","22:24"],M:["22:20","22:24"]},weekday:{"1":["18:1","18:5"],"2":["18:6","18:8"],"3":["18:9","18:14"]}};const Toldot={num:6,hebrew:"תּוֹלְדוֹת",book:1,haft:{k:"Malachi",b:"1:1",e:"2:7"},fullkriyah:{"1":["25:19","26:5"],"2":["26:6","26:12"],"3":["26:13","26:22"],"4":["26:23","26:29"],"5":["26:30","27:27"],"6":["27:28","28:4"],"7":["28:5","28:9"],M:["28:7","28:9"]},weekday:{"1":["25:19","25:22"],"2":["25:23","25:26"],"3":["25:27","26:5"]}};const Vayetzei={num:7,hebrew:"וַיֵּצֵא",book:1,haft:{k:"Hosea",b:"12:13",e:"14:10"},seph:{k:"Hosea",b:"11:7",e:"12:12"},fullkriyah:{"1":["28:10","28:22"],"2":["29:1","29:17"],"3":["29:18","30:13"],"4":["30:14","30:27"],"5":["30:28","31:16"],"6":["31:17","31:42"],"7":["31:43","32:3"],M:["32:1","32:3"]},weekday:{"1":["28:10","28:12"],"2":["28:13","28:17"],"3":["28:18","28:22"]}};const Vayishlach={num:8,hebrew:"וַיִּשְׁלַח",book:1,haft:{k:"Obadiah",b:"1:1",e:"1:21"},fullkriyah:{"1":["32:4","32:13"],"2":["32:14","32:30"],"3":["32:31","33:5"],"4":["33:6","33:20"],"5":["34:1","35:11"],"6":["35:12","36:19"],"7":["36:20","36:43"],M:["36:40","36:43"]},weekday:{"1":["32:4","32:6"],"2":["32:7","32:9"],"3":["32:10","32:13"]}};const Vayeshev={num:9,hebrew:"וַיֵּשֶׁב",book:1,haft:{k:"Amos",b:"2:6",e:"3:8"},fullkriyah:{"1":["37:1","37:11"],"2":["37:12","37:22"],"3":["37:23","37:36"],"4":["38:1","38:30"],"5":["39:1","39:6"],"6":["39:7","39:23"],"7":["40:1","40:23"],M:["40:20","40:23"]},weekday:{"1":["37:1","37:3"],"2":["37:4","37:7"],"3":["37:8","37:11"]}};const Miketz={num:10,hebrew:"מִקֵּץ",book:1,haft:{k:"I Kings",b:"3:15",e:"4:1"},fullkriyah:{"1":["41:1","41:14"],"2":["41:15","41:38"],"3":["41:39","41:52"],"4":["41:53","42:18"],"5":["42:19","43:15"],"6":["43:16","43:29"],"7":["43:30","44:17"],M:["44:14","44:17"]},weekday:{"1":["41:1","41:4"],"2":["41:5","41:7"],"3":["41:8","41:14"]}};const Vayigash={num:11,hebrew:"וַיִּגַּשׁ",book:1,haft:{k:"Ezekiel",b:"37:15",e:"37:28"},fullkriyah:{"1":["44:18","44:30"],"2":["44:31","45:7"],"3":["45:8","45:18"],"4":["45:19","45:27"],"5":["45:28","46:27"],"6":["46:28","47:10"],"7":["47:11","47:27"],M:["47:25","47:27"]},weekday:{"1":["44:18","44:20"],"2":["44:21","44:24"],"3":["44:25","44:30"]}};const Vayechi={num:12,hebrew:"וַיְחִי",book:1,haft:{k:"I Kings",b:"2:1",e:"2:12"},fullkriyah:{"1":["47:28","48:9"],"2":["48:10","48:16"],"3":["48:17","48:22"],"4":["49:1","49:18"],"5":["49:19","49:26"],"6":["49:27","50:20"],"7":["50:21","50:26"],M:["50:23","50:26"]},weekday:{"1":["47:28","47:31"],"2":["48:1","48:3"],"3":["48:4","48:9"]}};const Shemot={num:13,hebrew:"שְׁמוֹת",book:2,haft:[{k:"Isaiah",b:"27:6",e:"28:13"},{k:"Isaiah",b:"29:22",e:"29:23"}],seph:{k:"Jeremiah",b:"1:1",e:"2:3"},fullkriyah:{"1":["1:1","1:17"],"2":["1:18","2:10"],"3":["2:11","2:25"],"4":["3:1","3:15"],"5":["3:16","4:17"],"6":["4:18","4:31"],"7":["5:1","6:1"],M:["5:22","6:1"]},weekday:{"1":["1:1","1:7"],"2":["1:8","1:12"],"3":["1:13","1:17"]}};const Vaera={num:14,hebrew:"וָאֵרָא",book:2,haft:{k:"Ezekiel",b:"28:25",e:"29:21"},fullkriyah:{"1":["6:2","6:13"],"2":["6:14","6:28"],"3":["6:29","7:7"],"4":["7:8","8:6"],"5":["8:7","8:18"],"6":["8:19","9:16"],"7":["9:17","9:35"],M:["9:33","9:35"]},weekday:{"1":["6:2","6:5"],"2":["6:6","6:9"],"3":["6:10","6:13"]}};const Bo={num:15,hebrew:"בֹּא",book:2,haft:{k:"Jeremiah",b:"46:13",e:"46:28"},fullkriyah:{"1":["10:1","10:11"],"2":["10:12","10:23"],"3":["10:24","11:3"],"4":["11:4","12:20"],"5":["12:21","12:28"],"6":["12:29","12:51"],"7":["13:1","13:16"],M:["13:14","13:16"]},weekday:{"1":["10:1","10:3"],"2":["10:4","10:6"],"3":["10:7","10:11"]}};const Beshalach={num:16,hebrew:"בְּשַׁלַּח",book:2,haft:{k:"Judges",b:"4:4",e:"5:31"},seph:{k:"Judges",b:"5:1",e:"5:31"},fullkriyah:{"1":["13:17","14:8"],"2":["14:9","14:14"],"3":["14:15","14:25"],"4":["14:26","15:26"],"5":["15:27","16:10"],"6":["16:11","16:36"],"7":["17:1","17:16"],M:["17:14","17:16"]},weekday:{"1":["13:17","13:22"],"2":["14:1","14:4"],"3":["14:5","14:8"]}};const Yitro={num:17,hebrew:"יִתְרוֹ",book:2,haft:[{k:"Isaiah",b:"6:1",e:"7:6"},{k:"Isaiah",b:"9:5",e:"9:6"}],seph:{k:"Isaiah",b:"6:1",e:"6:13"},fullkriyah:{"1":["18:1","18:12"],"2":["18:13","18:23"],"3":["18:24","18:27"],"4":["19:1","19:6"],"5":["19:7","19:19"],"6":["19:20","20:14"],"7":["20:15","20:23"],M:["20:19","20:23"]},weekday:{"1":["18:1","18:4"],"2":["18:5","18:8"],"3":["18:9","18:12"]}};const Mishpatim={num:18,hebrew:"מִּשְׁפָּטִים",book:2,haft:[{k:"Jeremiah",b:"34:8",e:"34:22"},{k:"Jeremiah",b:"33:25",e:"33:26"}],fullkriyah:{"1":["21:1","21:19"],"2":["21:20","22:3"],"3":["22:4","22:26"],"4":["22:27","23:5"],"5":["23:6","23:19"],"6":["23:20","23:25"],"7":["23:26","24:18"],M:["24:15","24:18"]},weekday:{"1":["21:1","21:6"],"2":["21:7","21:11"],"3":["21:12","21:19"]}};const Terumah={num:19,hebrew:"תְּרוּמָה",book:2,haft:{k:"I Kings",b:"5:26",e:"6:13"},fullkriyah:{"1":["25:1","25:16"],"2":["25:17","25:30"],"3":["25:31","26:14"],"4":["26:15","26:30"],"5":["26:31","26:37"],"6":["27:1","27:8"],"7":["27:9","27:19"],M:["27:17","27:19"]},weekday:{"1":["25:1","25:5"],"2":["25:6","25:9"],"3":["25:10","25:16"]}};const Tetzaveh={num:20,hebrew:"תְּצַוֶּה",book:2,haft:{k:"Ezekiel",b:"43:10",e:"43:27"},fullkriyah:{"1":["27:20","28:12"],"2":["28:13","28:30"],"3":["28:31","28:43"],"4":["29:1","29:18"],"5":["29:19","29:37"],"6":["29:38","29:46"],"7":["30:1","30:10"],M:["30:8","30:10"]},weekday:{"1":["27:20","28:5"],"2":["28:6","28:9"],"3":["28:10","28:12"]}};const Vayakhel={num:22,hebrew:"וַיַּקְהֵל",book:2,haft:{k:"I Kings",b:"7:40",e:"7:50"},seph:{k:"I Kings",b:"7:13",e:"7:26"},fullkriyah:{"1":["35:1","35:20"],"2":["35:21","35:29"],"3":["35:30","36:7"],"4":["36:8","36:19"],"5":["36:20","37:16"],"6":["37:17","37:29"],"7":["38:1","38:20"],M:["38:18","38:20"]},weekday:{"1":["35:1","35:3"],"2":["35:4","35:10"],"3":["35:11","35:20"]}};const Pekudei={num:23,hebrew:"פְקוּדֵי",book:2,haft:{k:"I Kings",b:"7:51",e:"8:21"},seph:{k:"I Kings",b:"7:40",e:"7:50"},fullkriyah:{"1":["38:21","39:1"],"2":["39:2","39:21"],"3":["39:22","39:32"],"4":["39:33","39:43"],"5":["40:1","40:16"],"6":["40:17","40:27"],"7":["40:28","40:38"],M:["40:34","40:38"]},weekday:{"1":["38:21","38:23"],"2":["38:24","38:27"],"3":["38:28","39:1"]}};const Vayikra={num:24,hebrew:"וַיִּקְרָא",book:3,haft:{k:"Isaiah",b:"43:21",e:"44:23"},fullkriyah:{"1":["1:1","1:13"],"2":["1:14","2:6"],"3":["2:7","2:16"],"4":["3:1","3:17"],"5":["4:1","4:26"],"6":["4:27","5:10"],"7":["5:11","5:26"],M:["5:24","5:26"]},weekday:{"1":["1:1","1:4"],"2":["1:5","1:9"],"3":["1:10","1:13"]}};const Tzav={num:25,hebrew:"צַו",book:3,haft:[{k:"Jeremiah",b:"7:21",e:"8:3"},{k:"Jeremiah",b:"9:22",e:"9:23"}],fullkriyah:{"1":["6:1","6:11"],"2":["6:12","7:10"],"3":["7:11","7:38"],"4":["8:1","8:13"],"5":["8:14","8:21"],"6":["8:22","8:29"],"7":["8:30","8:36"],M:["8:33","8:36"]},weekday:{"1":["6:1","6:3"],"2":["6:4","6:6"],"3":["6:7","6:11"]}};const Shmini={num:26,hebrew:"שְּׁמִינִי",book:3,haft:{k:"II Samuel",b:"6:1",e:"7:17"},seph:{k:"II Samuel",b:"6:1",e:"6:19"},fullkriyah:{"1":["9:1","9:16"],"2":["9:17","9:23"],"3":["9:24","10:11"],"4":["10:12","10:15"],"5":["10:16","10:20"],"6":["11:1","11:32"],"7":["11:33","11:47"],M:["11:45","11:47"]},weekday:{"1":["9:1","9:6"],"2":["9:7","9:10"],"3":["9:11","9:16"]}};const Tazria={num:27,hebrew:"תַזְרִיעַ",book:3,haft:{k:"II Kings",b:"4:42",e:"5:19"},fullkriyah:{"1":["12:1","13:5"],"2":["13:6","13:17"],"3":["13:18","13:23"],"4":["13:24","13:28"],"5":["13:29","13:39"],"6":["13:40","13:54"],"7":["13:55","13:59"],M:["13:57","13:59"]},weekday:{"1":["12:1","12:4"],"2":["12:5","12:8"],"3":["13:1","13:5"]}};const Metzora={num:28,hebrew:"מְּצֹרָע",book:3,haft:{k:"II Kings",b:"7:3",e:"7:20"},fullkriyah:{"1":["14:1","14:12"],"2":["14:13","14:20"],"3":["14:21","14:32"],"4":["14:33","14:53"],"5":["14:54","15:15"],"6":["15:16","15:28"],"7":["15:29","15:33"],M:["15:31","15:33"]},weekday:{"1":["14:1","14:5"],"2":["14:6","14:9"],"3":["14:10","14:12"]}};const Kedoshim={num:30,hebrew:"קְדשִׁים",book:3,haft:{k:"Ezekiel",b:"22:1",e:"22:19"},seph:{k:"Ezekiel",b:"20:2",e:"20:20"},fullkriyah:{"1":["19:1","19:14"],"2":["19:15","19:22"],"3":["19:23","19:32"],"4":["19:33","19:37"],"5":["20:1","20:7"],"6":["20:8","20:22"],"7":["20:23","20:27"],M:["20:25","20:27"]},weekday:{"1":["19:1","19:4"],"2":["19:5","19:10"],"3":["19:11","19:14"]}};const Emor={num:31,hebrew:"אֱמוֹר",book:3,haft:{k:"Ezekiel",b:"44:15",e:"44:31"},fullkriyah:{"1":["21:1","21:15"],"2":["21:16","22:16"],"3":["22:17","22:33"],"4":["23:1","23:22"],"5":["23:23","23:32"],"6":["23:33","23:44"],"7":["24:1","24:23"],M:["24:21","24:23"]},weekday:{"1":["21:1","21:6"],"2":["21:7","21:12"],"3":["21:13","21:15"]}};const Behar={num:32,hebrew:"בְּהַר",book:3,haft:{k:"Jeremiah",b:"32:6",e:"32:27"},fullkriyah:{"1":["25:1","25:13"],"2":["25:14","25:18"],"3":["25:19","25:24"],"4":["25:25","25:28"],"5":["25:29","25:38"],"6":["25:39","25:46"],"7":["25:47","26:2"],M:["25:55","26:2"]},weekday:{"1":["25:1","25:3"],"2":["25:4","25:7"],"3":["25:8","25:13"]}};const Bechukotai={num:33,hebrew:"בְּחֻקֹּתַי",book:3,haft:{k:"Jeremiah",b:"16:19",e:"17:14"},fullkriyah:{"1":["26:3","26:5"],"2":["26:6","26:9"],"3":["26:10","26:46"],"4":["27:1","27:15"],"5":["27:16","27:21"],"6":["27:22","27:28"],"7":["27:29","27:34"],M:["27:32","27:34"]},weekday:{"1":["26:3","26:5"],"2":["26:6","26:9"],"3":["26:10","26:13"]}};const Bamidbar={num:34,hebrew:"בְּמִדְבַּר",book:4,haft:{k:"Hosea",b:"2:1",e:"2:22"},fullkriyah:{"1":["1:1","1:19"],"2":["1:20","1:54"],"3":["2:1","2:34"],"4":["3:1","3:13"],"5":["3:14","3:39"],"6":["3:40","3:51"],"7":["4:1","4:20"],M:["4:17","4:20"]},weekday:{"1":["1:1","1:4"],"2":["1:5","1:16"],"3":["1:17","1:19"]}};const Nasso={num:35,hebrew:"נָשׂא",book:4,haft:{k:"Judges",b:"13:2",e:"13:25"},fullkriyah:{"1":["4:21","4:37"],"2":["4:38","4:49"],"3":["5:1","5:10"],"4":["5:11","6:27"],"5":["7:1","7:41"],"6":["7:42","7:71"],"7":["7:72","7:89"],M:["7:87","7:89"]},weekday:{"1":["4:21","4:24"],"2":["4:25","4:28"],"3":["4:29","4:33"]}};const Korach={num:38,hebrew:"קוֹרַח",book:4,haft:{k:"I Samuel",b:"11:14",e:"12:22"},fullkriyah:{"1":["16:1","16:13"],"2":["16:14","16:19"],"3":["16:20","17:8"],"4":["17:9","17:15"],"5":["17:16","17:24"],"6":["17:25","18:20"],"7":["18:21","18:32"],M:["18:30","18:32"]},weekday:{"1":["16:1","16:3"],"2":["16:4","16:7"],"3":["16:8","16:13"]}};const Chukat={num:39,hebrew:"חֻקַּת",book:4,haft:{k:"Judges",b:"11:1",e:"11:33"},fullkriyah:{"1":["19:1","19:17"],"2":["19:18","20:6"],"3":["20:7","20:13"],"4":["20:14","20:21"],"5":["20:22","21:9"],"6":["21:10","21:20"],"7":["21:21","22:1"],M:["21:34","22:1"]},weekday:{"1":["19:1","19:6"],"2":["19:7","19:9"],"3":["19:10","19:17"]}};const Balak={num:40,hebrew:"בָּלָק",book:4,haft:{k:"Micah",b:"5:6",e:"6:8"},fullkriyah:{"1":["22:2","22:12"],"2":["22:13","22:20"],"3":["22:21","22:38"],"4":["22:39","23:12"],"5":["23:13","23:26"],"6":["23:27","24:13"],"7":["24:14","25:9"],M:["25:7","25:9"]},weekday:{"1":["22:2","22:4"],"2":["22:5","22:7"],"3":["22:8","22:12"]}};const Pinchas={num:41,hebrew:"פִּינְחָס",book:4,haft:{k:"I Kings",b:"18:46",e:"19:21"},fullkriyah:{"1":["25:10","26:4"],"2":["26:5","26:51"],"3":["26:52","27:5"],"4":["27:6","27:23"],"5":["28:1","28:15"],"6":["28:16","29:11"],"7":["29:12","30:1"],M:["29:35","30:1"]},weekday:{"1":["25:10","25:12"],"2":["25:13","25:15"],"3":["25:16","26:4"]}};const Matot={num:42,hebrew:"מַּטּוֹת",book:4,haft:{k:"Jeremiah",b:"1:1",e:"2:3"},fullkriyah:{"1":["30:2","30:17"],"2":["31:1","31:12"],"3":["31:13","31:24"],"4":["31:25","31:41"],"5":["31:42","31:54"],"6":["32:1","32:19"],"7":["32:20","32:42"],M:["32:39","32:42"]},weekday:{"1":["30:2","30:9"],"2":["30:10","30:13"],"3":["30:14","30:17"]}};const Masei={num:43,hebrew:"מַסְעֵי",book:4,haft:[{k:"Jeremiah",b:"2:4",e:"2:28"},{k:"Jeremiah",b:"3:4",e:"3:4"}],seph:[{k:"Jeremiah",b:"2:4",e:"2:28"},{k:"Jeremiah",b:"4:1",e:"4:2"}],fullkriyah:{"1":["33:1","33:10"],"2":["33:11","33:49"],"3":["33:50","34:15"],"4":["34:16","34:29"],"5":["35:1","35:8"],"6":["35:9","35:34"],"7":["36:1","36:13"],M:["36:11","36:13"]},weekday:{"1":["33:1","33:3"],"2":["33:4","33:6"],"3":["33:7","33:10"]}};const Devarim={num:44,hebrew:"דְּבָרִים",book:5,haft:{k:"Isaiah",b:"1:1",e:"1:27"},fullkriyah:{"1":["1:1","1:10"],"2":["1:11","1:21"],"3":["1:22","1:38"],"4":["1:39","2:1"],"5":["2:2","2:30"],"6":["2:31","3:14"],"7":["3:15","3:22"],M:["3:20","3:22"]},weekday:{"1":["1:1","1:3"],"2":["1:4","1:7"],"3":["1:8","1:11"]}};const Vaetchanan={num:45,hebrew:"וָאֶתְחַנַּן",book:5,haft:{k:"Isaiah",b:"40:1",e:"40:26"},fullkriyah:{"1":["3:23","4:4"],"2":["4:5","4:40"],"3":["4:41","4:49"],"4":["5:1","5:18"],"5":["5:19","6:3"],"6":["6:4","6:25"],"7":["7:1","7:11"],M:["7:9","7:11"]},weekday:{"1":["3:23","3:25"],"2":["3:26","4:4"],"3":["4:5","4:8"]}};const Eikev={num:46,hebrew:"עֵקֶב",book:5,haft:{k:"Isaiah",b:"49:14",e:"51:3"},fullkriyah:{"1":["7:12","8:10"],"2":["8:11","9:3"],"3":["9:4","9:29"],"4":["10:1","10:11"],"5":["10:12","11:9"],"6":["11:10","11:21"],"7":["11:22","11:25"],M:["11:22","11:25"]},weekday:{"1":["7:12","7:21"],"2":["7:22","8:3"],"3":["8:4","8:10"]}};const Shoftim={num:48,hebrew:"שׁוֹפְטִים",book:5,haft:{k:"Isaiah",b:"51:12",e:"52:12"},fullkriyah:{"1":["16:18","17:13"],"2":["17:14","17:20"],"3":["18:1","18:5"],"4":["18:6","18:13"],"5":["18:14","19:13"],"6":["19:14","20:9"],"7":["20:10","21:9"],M:["21:7","21:9"]},weekday:{"1":["16:18","16:20"],"2":["16:21","17:10"],"3":["17:11","17:13"]}};const Nitzavim={num:51,hebrew:"נִצָּבִים",book:5,haft:{k:"Isaiah",b:"61:10",e:"63:9"},fullkriyah:{"1":["29:9","29:11"],"2":["29:12","29:14"],"3":["29:15","29:28"],"4":["30:1","30:6"],"5":["30:7","30:10"],"6":["30:11","30:14"],"7":["30:15","30:20"],M:["30:15","30:20"]},weekday:{"1":["29:9","29:11"],"2":["29:12","29:14"],"3":["29:15","29:28"]}};const Vayeilech={num:52,hebrew:"וַיֵּלֶךְ",book:5,haft:{k:"Isaiah",b:"55:6",e:"56:8"},fullkriyah:{"1":["31:1","31:3"],"2":["31:4","31:6"],"3":["31:7","31:9"],"4":["31:10","31:13"],"5":["31:14","31:19"],"6":["31:20","31:24"],"7":["31:25","31:30"],M:["31:28","31:30"]},weekday:{"1":["31:1","31:3"],"2":["31:4","31:6"],"3":["31:7","31:13"]}};var parshiyotObj0 = {Bereshit:Bereshit,Noach:Noach,"Lech-Lecha":{num:3,hebrew:"לֶךְ־לְךָ",book:1,haft:{k:"Isaiah",b:"40:27",e:"41:16"},fullkriyah:{"1":["12:1","12:13"],"2":["12:14","13:4"],"3":["13:5","13:18"],"4":["14:1","14:20"],"5":["14:21","15:6"],"6":["15:7","17:6"],"7":["17:7","17:27"],M:["17:24","17:27"]},weekday:{"1":["12:1","12:3"],"2":["12:4","12:9"],"3":["12:10","12:13"]}},Vayera:Vayera,"Chayei Sara":{num:5,hebrew:"חַיֵּי שָֹרָה",book:1,haft:{k:"I Kings",b:"1:1",e:"1:31"},fullkriyah:{"1":["23:1","23:16"],"2":["23:17","24:9"],"3":["24:10","24:26"],"4":["24:27","24:52"],"5":["24:53","24:67"],"6":["25:1","25:11"],"7":["25:12","25:18"],M:["25:16","25:18"]},weekday:{"1":["23:1","23:7"],"2":["23:8","23:12"],"3":["23:13","23:16"]}},Toldot:Toldot,Vayetzei:Vayetzei,Vayishlach:Vayishlach,Vayeshev:Vayeshev,Miketz:Miketz,Vayigash:Vayigash,Vayechi:Vayechi,Shemot:Shemot,Vaera:Vaera,Bo:Bo,Beshalach:Beshalach,Yitro:Yitro,Mishpatim:Mishpatim,Terumah:Terumah,Tetzaveh:Tetzaveh,"Ki Tisa":{num:21,hebrew:"כִּי תִשָּׂא",book:2,haft:{k:"I Kings",b:"18:1",e:"18:39"},seph:{k:"I Kings",b:"18:20",e:"18:39"},fullkriyah:{"1":["30:11","31:17"],"2":["31:18","33:11"],"3":["33:12","33:16"],"4":["33:17","33:23"],"5":["34:1","34:9"],"6":["34:10","34:26"],"7":["34:27","34:35"],M:["34:33","34:35"]},weekday:{"1":["30:11","30:13"],"2":["30:14","30:16"],"3":["30:17","30:21"]}},Vayakhel:Vayakhel,Pekudei:Pekudei,Vayikra:Vayikra,Tzav:Tzav,Shmini:Shmini,Tazria:Tazria,Metzora:Metzora,"Achrei Mot":{num:29,hebrew:"אַחֲרֵי מוֹת",book:3,haft:{k:"Amos",b:"9:7",e:"9:15"},seph:{k:"Ezekiel",b:"22:1",e:"22:16"},fullkriyah:{"1":["16:1","16:17"],"2":["16:18","16:24"],"3":["16:25","16:34"],"4":["17:1","17:7"],"5":["17:8","18:5"],"6":["18:6","18:21"],"7":["18:22","18:30"],M:["18:28","18:30"]},weekday:{"1":["16:1","16:6"],"2":["16:7","16:11"],"3":["16:12","16:17"]}},Kedoshim:Kedoshim,Emor:Emor,Behar:Behar,Bechukotai:Bechukotai,Bamidbar:Bamidbar,Nasso:Nasso,"Beha'alotcha":{num:36,hebrew:"בְּהַעֲלֹתְךָ",book:4,haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{"1":["8:1","8:14"],"2":["8:15","8:26"],"3":["9:1","9:14"],"4":["9:15","10:10"],"5":["10:11","10:34"],"6":["10:35","11:29"],"7":["11:30","12:16"],M:["12:14","12:16"]},weekday:{"1":["8:1","8:4"],"2":["8:5","8:9"],"3":["8:10","8:14"]}},"Sh'lach":{num:37,hebrew:"שְׁלַח־לְךָ",book:4,haft:{k:"Joshua",b:"2:1",e:"2:24"},fullkriyah:{"1":["13:1","13:20"],"2":["13:21","14:7"],"3":["14:8","14:25"],"4":["14:26","15:7"],"5":["15:8","15:16"],"6":["15:17","15:26"],"7":["15:27","15:41"],M:["15:37","15:41"]},weekday:{"1":["13:1","13:3"],"2":["13:4","13:16"],"3":["13:17","13:20"]}},Korach:Korach,Chukat:Chukat,Balak:Balak,Pinchas:Pinchas,Matot:Matot,Masei:Masei,Devarim:Devarim,Vaetchanan:Vaetchanan,Eikev:Eikev,"Re'eh":{num:47,hebrew:"רְאֵה",book:5,haft:{k:"Isaiah",b:"54:11",e:"55:5"},fullkriyah:{"1":["11:26","12:10"],"2":["12:11","12:28"],"3":["12:29","13:19"],"4":["14:1","14:21"],"5":["14:22","14:29"],"6":["15:1","15:18"],"7":["15:19","16:17"],M:["16:13","16:17"]},weekday:{"1":["11:26","11:31"],"2":["11:32","12:5"],"3":["12:6","12:10"]}},Shoftim:Shoftim,"Ki Teitzei":{num:49,hebrew:"כִּי־תֵצֵא",book:5,haft:{k:"Isaiah",b:"54:1",e:"54:10"},fullkriyah:{"1":["21:10","21:21"],"2":["21:22","22:7"],"3":["22:8","23:7"],"4":["23:8","23:24"],"5":["23:25","24:4"],"6":["24:5","24:13"],"7":["24:14","25:19"],M:["25:17","25:19"]},weekday:{"1":["21:10","21:14"],"2":["21:15","21:17"],"3":["21:18","21:21"]}},"Ki Tavo":{num:50,hebrew:"כִּי־תָבוֹא",book:5,haft:{k:"Isaiah",b:"60:1",e:"60:22"},fullkriyah:{"1":["26:1","26:11"],"2":["26:12","26:15"],"3":["26:16","26:19"],"4":["27:1","27:10"],"5":["27:11","28:6"],"6":["28:7","28:69"],"7":["29:1","29:8"],M:["29:6","29:8"]},weekday:{"1":["26:1","26:3"],"2":["26:4","26:11"],"3":["26:12","26:15"]}},Nitzavim:Nitzavim,Vayeilech:Vayeilech,"Ha'azinu":{num:53,hebrew:"הַאֲזִינוּ",book:5,haft:{k:"II Samuel",b:"22:1",e:"22:51"},fullkriyah:{"1":["32:1","32:6"],"2":["32:7","32:12"],"3":["32:13","32:18"],"4":["32:19","32:28"],"5":["32:29","32:39"],"6":["32:40","32:43"],"7":["32:44","32:52"],M:["32:48","32:52"]},weekday:{"1":["32:1","32:3"],"2":["32:4","32:6"],"3":["32:7","32:12"]}},"Vezot Haberakhah":{num:54,hebrew:"וְזֹאת הַבְּרָכָה",book:5,haft:{k:"Joshua",b:"1:1",e:"1:18"},seph:{k:"Joshua",b:"1:1",e:"1:9"},fullkriyah:{"1":["33:1","33:7"],"2":["33:8","33:12"],"3":["33:13","33:17"],"4":["33:18","33:21"],"5":["33:22","33:26"],"6":["33:27","33:29"],"7":["34:1","34:12"]},weekday:{"1":["33:1","33:7"],"2":["33:8","33:12"],"3":["33:13","33:17"]}},"Vayakhel-Pekudei":{num:[22,23],combined:true,p1:"Vayakhel",p2:"Pekudei",num1:22,num2:23,book:2,fullkriyah:{"1":["35:1","35:29"],"2":["35:30","37:16"],"3":["37:17","37:29"],"4":["38:1","39:1"],"5":["39:2","39:21"],"6":["39:22","39:43"],"7":["40:1","40:38"],M:["40:34","40:38"]}},"Tazria-Metzora":{num:[27,28],combined:true,p1:"Tazria",p2:"Metzora",num1:27,num2:28,book:3,fullkriyah:{"1":["12:1","13:23"],"2":["13:24","13:39"],"3":["13:40","13:54"],"4":["13:55","14:20"],"5":["14:21","14:32"],"6":["14:33","15:15"],"7":["15:16","15:33"],M:["15:31","15:33"]}},"Achrei Mot-Kedoshim":{num:[29,30],combined:true,p1:"Achrei Mot",p2:"Kedoshim",num1:29,num2:30,book:3,haft:{k:"Amos",b:"9:7",e:"9:15"},seph:{k:"Ezekiel",b:"20:2",e:"20:20"},fullkriyah:{"1":["16:1","16:24"],"2":["16:25","17:7"],"3":["17:8","18:21"],"4":["18:22","19:14"],"5":["19:15","19:32"],"6":["19:33","20:7"],"7":["20:8","20:27"],M:["20:25","20:27"]}},"Behar-Bechukotai":{num:[32,33],combined:true,p1:"Behar",p2:"Bechukotai",num1:32,num2:33,book:3,fullkriyah:{"1":["25:1","25:18"],"2":["25:19","25:28"],"3":["25:29","25:38"],"4":["25:39","26:9"],"5":["26:10","26:46"],"6":["27:1","27:15"],"7":["27:16","27:34"],M:["27:32","27:34"]}},"Chukat-Balak":{num:[39,40],combined:true,p1:"Chukat",p2:"Balak",num1:39,num2:40,book:4,fullkriyah:{"1":["19:1","20:6"],"2":["20:7","20:21"],"3":["20:22","21:20"],"4":["21:21","22:12"],"5":["22:13","22:38"],"6":["22:39","23:26"],"7":["23:27","25:9"],M:["25:7","25:9"]}},"Matot-Masei":{num:[42,43],combined:true,p1:"Matot",p2:"Masei",num1:42,num2:43,book:4,fullkriyah:{"1":["30:2","31:12"],"2":["31:13","31:54"],"3":["32:1","32:19"],"4":["32:20","33:49"],"5":["33:50","34:15"],"6":["34:16","35:8"],"7":["35:9","36:13"],M:["36:11","36:13"]}},"Nitzavim-Vayeilech":{num:[51,52],combined:true,p1:"Nitzavim",p2:"Vayeilech",num1:51,num2:52,book:5,fullkriyah:{"1":["29:9","29:28"],"2":["30:1","30:6"],"3":["30:7","30:14"],"4":["30:15","31:6"],"5":["31:7","31:13"],"6":["31:14","31:19"],"7":["31:20","31:30"],M:["31:28","31:30"]}}};
|
|
1954
|
+
|
|
1955
|
+
/*! @hebcal/leyning v9.0.1 */
|
|
1956
|
+
const Genesis=[0,31,25,24,26,32,22,24,22,29,32,32,20,18,24,21,16,27,33,38,18,34,24,20,67,34,35,46,22,35,43,54,33,20,31,29,43,36,30,23,23,57,38,34,34,28,34,31,22,33,26];const Exodus=[0,22,25,22,31,23,30,29,28,35,29,10,51,22,31,27,36,16,27,25,26,37,30,33,18,40,37,21,43,46,38,18,35,23,35,35,38,29,31,43,38];const Leviticus=[0,17,16,17,35,26,23,38,36,24,20,47,8,59,57,33,34,16,30,37,27,24,33,44,23,55,46,34];const Numbers=[0,54,34,51,49,31,27,89,26,23,36,35,16,33,45,41,35,28,32,22,29,35,41,30,25,19,65,23,31,39,17,54,42,56,29,34,13];const Deuteronomy=[0,46,37,29,49,30,25,26,20,29,22,32,31,19,29,23,22,20,22,21,20,23,29,26,22,19,19,26,69,28,20,30,52,29,12];const Joshua=[0,18,24,17,24,15,27,26,35,27,43,23,24,33,15,63,10,18,28,51,9,45,34,16,33];const Judges=[0,36,23,31,24,31,40,25,35,57,18,40,15,25,20,20,31,13,31,30,48,25];const Ruth=[0,22,23,18,22];const Isaiah=[0,31,22,26,6,30,13,25,23,20,34,16,6,22,32,9,14,14,7,25,6,17,25,18,23,12,21,13,29,24,33,9,20,24,17,10,22,38,22,8,31,29,25,28,28,25,13,15,22,26,11,23,15,12,17,13,12,21,14,21,22,11,12,19,11,25,24];const Jeremiah=[0,19,37,25,31,31,30,34,23,25,25,23,17,27,22,21,21,27,23,15,18,14,30,40,10,38,24,22,17,32,24,40,44,26,22,19,32,21,28,18,16,18,22,13,30,5,28,7,47,39,46,64,34];const Lamentations=[0,22,22,66,22,22];const Baruch=[0,22,35,38,37,9,72];const Esther=[0,22,23,15,17,14,14,10,17,32,3];const Ecclesiastes=[0,18,26,22,17,19,12,29,17,18,20,10,14];const Ezekiel=[0,28,10,27,17,17,14,27,18,11,22,25,28,23,23,8,63,24,32,14,44,37,31,49,27,17,21,36,26,21,26,18,32,33,31,15,38,28,23,29,49,26,20,27,31,25,24,23,35];const Daniel=[0,21,49,100,34,30,29,28,27,27,21,45,13,64,42];const Hosea=[0,9,25,5,19,15,11,16,14,17,15,11,15,15,10];const Joel=[0,20,27,5,21];const Amos=[0,15,16,15,13,27,14,17,14,15];const Obadiah=[0,21];const Jonah=[0,16,11,10,11];const Micah=[0,16,13,12,14,14,16,20];const Nachum=[0,14,14,19];const Habakkuk=[0,17,20,19];const Zephaniah=[0,18,15,20];const Haggai=[0,15,23];const Zechariah=[0,17,17,10,14,11,15,14,23,17,12,17,14,9,21];const Malachi=[0,14,17,24];var numverses = {Genesis:Genesis,Exodus:Exodus,Leviticus:Leviticus,Numbers:Numbers,Deuteronomy:Deuteronomy,Joshua:Joshua,Judges:Judges,Ruth:Ruth,"I Samuel":[0,28,36,21,22,12,21,17,22,27,27,15,25,23,52,35,23,58,30,24,42,16,23,28,23,43,25,12,25,11,31,13],"II Samuel":[0,27,32,39,12,25,23,29,18,13,19,27,31,39,33,37,23,29,32,44,26,22,51,39,25],"I Kings":[0,53,46,28,20,32,38,51,66,28,29,43,33,34,31,34,34,24,46,21,43,29,54],"II Kings":[0,18,25,27,44,27,33,20,29,37,36,20,22,25,29,38,20,41,37,37,21,26,20,37,20,30],Isaiah:Isaiah,Jeremiah:Jeremiah,Lamentations:Lamentations,Baruch:Baruch,Esther:Esther,Ecclesiastes:Ecclesiastes,"Song of Songs":[0,17,17,11,16,16,12,14,14],Ezekiel:Ezekiel,Daniel:Daniel,Hosea:Hosea,Joel:Joel,Amos:Amos,Obadiah:Obadiah,Jonah:Jonah,Micah:Micah,Nachum:Nachum,Habakkuk:Habakkuk,Zephaniah:Zephaniah,Haggai:Haggai,Zechariah:Zechariah,Malachi:Malachi};
|
|
1957
|
+
|
|
1958
|
+
/*! @hebcal/leyning v9.0.1 */
|
|
1959
|
+
|
|
1960
|
+
/**
|
|
1961
|
+
* Names of the books of the Torah. BOOK[1] === 'Genesis'
|
|
1962
|
+
* @readonly
|
|
1963
|
+
*/
|
|
1964
|
+
const BOOK = [
|
|
1965
|
+
'',
|
|
1966
|
+
'Genesis',
|
|
1967
|
+
'Exodus',
|
|
1968
|
+
'Leviticus',
|
|
1969
|
+
'Numbers',
|
|
1970
|
+
'Deuteronomy',
|
|
1971
|
+
];
|
|
1972
|
+
/**
|
|
1973
|
+
* The number of verses in each book of the Tanakh.
|
|
1974
|
+
* @readonly
|
|
1975
|
+
*/
|
|
1976
|
+
const NUM_VERSES = numverses;
|
|
1977
|
+
/**
|
|
1978
|
+
* Formats parsha as a string
|
|
1979
|
+
* @param parsha untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei']
|
|
1980
|
+
*/
|
|
1981
|
+
function parshaToString(parsha) {
|
|
1982
|
+
if (typeof parsha === 'string') {
|
|
1983
|
+
return parsha;
|
|
1984
|
+
}
|
|
1985
|
+
else if (!Array.isArray(parsha) ||
|
|
1986
|
+
parsha.length === 0 ||
|
|
1987
|
+
parsha.length > 2) {
|
|
1988
|
+
throw new TypeError(`Bad parsha argument: ${parsha}`);
|
|
1989
|
+
}
|
|
1990
|
+
let s = parsha[0];
|
|
1991
|
+
if (parsha.length === 2) {
|
|
1992
|
+
s += '-' + parsha[1];
|
|
1993
|
+
}
|
|
1994
|
+
return s;
|
|
1995
|
+
}
|
|
1996
|
+
/**
|
|
1997
|
+
* Calculates the number of verses in an aliyah or haftara based on
|
|
1998
|
+
* the `b` (begin verse), `e` (end verse) and `k` (book).
|
|
1999
|
+
* Modifies `aliyah` by setting the `v` field.
|
|
2000
|
+
*/
|
|
2001
|
+
function calculateNumVerses(aliyah) {
|
|
2002
|
+
if (aliyah.v) {
|
|
2003
|
+
return aliyah.v;
|
|
2004
|
+
}
|
|
2005
|
+
const chapVerseBegin = aliyah.b.split(':');
|
|
2006
|
+
const chapVerseEnd = aliyah.e.split(':');
|
|
2007
|
+
const c1 = parseInt(chapVerseBegin[0], 10);
|
|
2008
|
+
const c2 = parseInt(chapVerseEnd[0], 10);
|
|
2009
|
+
const v1 = parseInt(chapVerseBegin[1], 10);
|
|
2010
|
+
const v2 = parseInt(chapVerseEnd[1], 10);
|
|
2011
|
+
if (c1 === c2) {
|
|
2012
|
+
aliyah.v = v2 - v1 + 1;
|
|
2013
|
+
}
|
|
2014
|
+
else if (typeof aliyah.k === 'string') {
|
|
2015
|
+
const numv = NUM_VERSES[aliyah.k];
|
|
2016
|
+
if (typeof numv !== 'object' || !numv.length) {
|
|
2017
|
+
throw new ReferenceError(`Can't find numverses for ${aliyah.k}`);
|
|
2018
|
+
}
|
|
2019
|
+
let total = numv[c1] - v1 + 1;
|
|
2020
|
+
for (let chap = c1 + 1; chap < c2; chap++) {
|
|
2021
|
+
total += numv[chap];
|
|
2022
|
+
}
|
|
2023
|
+
total += v2;
|
|
2024
|
+
aliyah.v = total;
|
|
2025
|
+
}
|
|
2026
|
+
return aliyah.v;
|
|
2027
|
+
}
|
|
2028
|
+
/**
|
|
2029
|
+
* Formats an aliyah object like "Numbers 28:9-15"
|
|
2030
|
+
*/
|
|
2031
|
+
function formatAliyahShort(aliyah, showBook) {
|
|
2032
|
+
const begin = aliyah.b;
|
|
2033
|
+
const end0 = aliyah.e;
|
|
2034
|
+
const prefix = showBook ? aliyah.k + ' ' : '';
|
|
2035
|
+
if (begin === end0) {
|
|
2036
|
+
return `${prefix}${begin}`;
|
|
2037
|
+
}
|
|
2038
|
+
const cv1 = begin.split(':');
|
|
2039
|
+
const cv2 = end0.split(':');
|
|
2040
|
+
const end = cv1[0] === cv2[0] ? cv2[1] : end0;
|
|
2041
|
+
return `${prefix}${begin}-${end}`;
|
|
2042
|
+
}
|
|
2043
|
+
|
|
2044
|
+
/*! @hebcal/leyning v9.0.1 */
|
|
2045
|
+
|
|
2046
|
+
/**
|
|
2047
|
+
* Makes a deep copy of the src object using JSON stringify and parse
|
|
2048
|
+
*/
|
|
2049
|
+
function clone(src) {
|
|
2050
|
+
return JSON.parse(JSON.stringify(src));
|
|
2051
|
+
}
|
|
2052
|
+
function cloneHaftara(haft) {
|
|
2053
|
+
if (!haft) {
|
|
2054
|
+
return haft;
|
|
2055
|
+
}
|
|
2056
|
+
const dest = clone(haft);
|
|
2057
|
+
if (Array.isArray(dest)) {
|
|
2058
|
+
dest.map(calculateNumVerses);
|
|
2059
|
+
}
|
|
2060
|
+
else {
|
|
2061
|
+
calculateNumVerses(dest);
|
|
2062
|
+
}
|
|
2063
|
+
return dest;
|
|
2064
|
+
}
|
|
2065
|
+
/**
|
|
2066
|
+
* Returns the total number of verses in an array of Aliyah (or haftarah) objects
|
|
2067
|
+
*/
|
|
2068
|
+
function sumVerses(aliyot) {
|
|
2069
|
+
return Array.isArray(aliyot)
|
|
2070
|
+
? aliyot.reduce((prev, cur) => prev + cur.v, 0)
|
|
2071
|
+
: aliyot.v;
|
|
2072
|
+
}
|
|
2073
|
+
|
|
2074
|
+
/*! @hebcal/leyning v9.0.1 */
|
|
2075
|
+
const Shavuot={note:"Israel only",il:true,megillah:"Ruth",haft:[{k:"Ezekiel",b:"1:1",e:"1:28"},{k:"Ezekiel",b:"3:12",e:"3:12"}],fullkriyah:{"1":{p:17,k:2,b:"19:1",e:"19:6"},"2":{p:17,k:2,b:"19:7",e:"19:13"},"3":{p:17,k:2,b:"19:14",e:"19:19"},"4":{p:17,k:2,b:"19:20",e:"20:14"},"5":{p:17,k:2,b:"20:15",e:"20:23"},M:{p:41,k:4,b:"28:26",e:"28:31"}}};const Purim={megillah:"Esther",fullkriyah:{"1":{p:16,k:2,b:"17:8",e:"17:10"},"2":{p:16,k:2,b:"17:11",e:"17:13"},"3":{p:16,k:2,b:"17:14",e:"17:16"}}};var festivals0 = {"Pesach I":{haft:[{k:"Joshua",b:"3:5",e:"3:7"},{k:"Joshua",b:"5:2",e:"6:1"},{k:"Joshua",b:"6:27",e:"6:27"}],seph:[{k:"Joshua",b:"5:2",e:"6:1"},{k:"Joshua",b:"6:27",e:"6:27"}],fullkriyah:{"1":{p:15,k:2,b:"12:21",e:"12:24"},"2":{p:15,k:2,b:"12:25",e:"12:28"},"3":{p:15,k:2,b:"12:29",e:"12:36"},"4":{p:15,k:2,b:"12:37",e:"12:42"},"5":{p:15,k:2,b:"12:43",e:"12:51"},M:{p:41,k:4,b:"28:16",e:"28:25"}}},"Pesach I (on Shabbat)":{haft:[{k:"Joshua",b:"3:5",e:"3:7"},{k:"Joshua",b:"5:2",e:"6:1"},{k:"Joshua",b:"6:27",e:"6:27"}],seph:[{k:"Joshua",b:"5:2",e:"6:1"},{k:"Joshua",b:"6:27",e:"6:27"}],fullkriyah:{"1":{p:15,k:2,b:"12:21",e:"12:24"},"2":{p:15,k:2,b:"12:25",e:"12:28"},"3":{p:15,k:2,b:"12:29",e:"12:32"},"4":{p:15,k:2,b:"12:33",e:"12:36"},"5":{p:15,k:2,b:"12:37",e:"12:42"},"6":{p:15,k:2,b:"12:43",e:"12:47"},"7":{p:15,k:2,b:"12:48",e:"12:51"},M:{p:41,k:4,b:"28:16",e:"28:25"}}},"Pesach II":{haft:[{k:"II Kings",b:"23:1",e:"23:9"},{k:"II Kings",b:"23:21",e:"23:25"}],fullkriyah:{"1":{p:31,k:3,b:"22:26",e:"23:3"},"2":{p:31,k:3,b:"23:4",e:"23:14"},"3":{p:31,k:3,b:"23:15",e:"23:22"},"4":{p:31,k:3,b:"23:23",e:"23:32"},"5":{p:31,k:3,b:"23:33",e:"23:44"},M:{p:41,k:4,b:"28:16",e:"28:25"}}},"Pesach II (CH''M)":{note:"Israel only - according to Vaani T'fillati Siddur Yisraeli",il:true,fullkriyah:{"1":{p:31,k:3,b:"22:26",e:"23:8"},"2":{p:31,k:3,b:"23:9",e:"23:14"},"3":{p:31,k:3,b:"23:15",e:"23:44"},"4":{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach Chol ha-Moed Day 1":{fullkriyah:{"1":{p:15,k:2,b:"13:1",e:"13:4"},"2":{p:15,k:2,b:"13:5",e:"13:10"},"3":{p:15,k:2,b:"13:11",e:"13:16"},"4":{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach Chol ha-Moed Day 2":{fullkriyah:{"1":{p:18,k:2,b:"22:24",e:"22:26"},"2":{p:18,k:2,b:"22:27",e:"23:5"},"3":{p:18,k:2,b:"23:6",e:"23:19"},"4":{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach Chol ha-Moed Day 3":{fullkriyah:{"1":{p:21,k:2,b:"34:1",e:"34:10"},"2":{p:21,k:2,b:"34:11",e:"34:17"},"3":{p:21,k:2,b:"34:18",e:"34:26"},"4":{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach Chol ha-Moed Day 4":{fullkriyah:{"1":{p:36,k:4,b:"9:1",e:"9:5"},"2":{p:36,k:4,b:"9:6",e:"9:8"},"3":{p:36,k:4,b:"9:9",e:"9:14"},"4":{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach Shabbat Chol ha-Moed":{megillah:"Song of Songs",haft:{k:"Ezekiel",b:"37:1",e:"37:14"},fullkriyah:{"1":{p:21,k:2,b:"33:12",e:"33:16"},"2":{p:21,k:2,b:"33:17",e:"33:19"},"3":{p:21,k:2,b:"33:20",e:"33:23"},"4":{p:21,k:2,b:"34:1",e:"34:3"},"5":{p:21,k:2,b:"34:4",e:"34:10"},"6":{p:21,k:2,b:"34:11",e:"34:17"},"7":{p:21,k:2,b:"34:18",e:"34:26"},M:{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach VII":{haft:{k:"II Samuel",b:"22:1",e:"22:51"},fullkriyah:{"1":{p:16,k:2,b:"13:17",e:"13:22"},"2":{p:16,k:2,b:"14:1",e:"14:8"},"3":{p:16,k:2,b:"14:9",e:"14:14"},"4":{p:16,k:2,b:"14:15",e:"14:25"},"5":{p:16,k:2,b:"14:26",e:"15:26"},M:{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach VII (on Shabbat)":{megillah:"Song of Songs",haft:{k:"II Samuel",b:"22:1",e:"22:51"},fullkriyah:{"1":{p:16,k:2,b:"13:17",e:"13:19"},"2":{p:16,k:2,b:"13:20",e:"13:22"},"3":{p:16,k:2,b:"14:1",e:"14:4"},"4":{p:16,k:2,b:"14:5",e:"14:8"},"5":{p:16,k:2,b:"14:9",e:"14:14"},"6":{p:16,k:2,b:"14:15",e:"14:25"},"7":{p:16,k:2,b:"14:26",e:"15:26"},M:{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach VIII":{haft:{k:"Isaiah",b:"10:32",e:"12:6"},fullkriyah:{"1":{p:47,k:5,b:"15:19",e:"15:23"},"2":{p:47,k:5,b:"16:1",e:"16:3"},"3":{p:47,k:5,b:"16:4",e:"16:8"},"4":{p:47,k:5,b:"16:9",e:"16:12"},"5":{p:47,k:5,b:"16:13",e:"16:17"},M:{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach VIII (on Shabbat)":{megillah:"Song of Songs",haft:{k:"Isaiah",b:"10:32",e:"12:6"},fullkriyah:{"1":{p:47,k:5,b:"14:22",e:"14:29"},"2":{p:47,k:5,b:"15:1",e:"15:18"},"3":{p:47,k:5,b:"15:19",e:"15:23"},"4":{p:47,k:5,b:"16:1",e:"16:3"},"5":{p:47,k:5,b:"16:4",e:"16:8"},"6":{p:47,k:5,b:"16:9",e:"16:12"},"7":{p:47,k:5,b:"16:13",e:"16:17"},M:{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach III (CH''M)":{alias:true,il:true,key:"Pesach Chol ha-Moed Day 1"},"Pesach IV (CH''M)":{alias:true,il:true,key:"Pesach Chol ha-Moed Day 2"},"Pesach V (CH''M)":{alias:true,il:true,key:"Pesach Chol ha-Moed Day 3"},"Pesach VI (CH''M)":{alias:true,il:true,key:"Pesach Chol ha-Moed Day 4"},"Pesach Chol ha-Moed Day 2 on Sunday":{alias:true,il:false,key:"Pesach Chol ha-Moed Day 1"},"Pesach Chol ha-Moed Day 3 on Monday":{alias:true,il:false,key:"Pesach Chol ha-Moed Day 2"},Shavuot:Shavuot,"Shavuot I":{haft:[{k:"Ezekiel",b:"1:1",e:"1:28"},{k:"Ezekiel",b:"3:12",e:"3:12"}],fullkriyah:{"1":{p:17,k:2,b:"19:1",e:"19:6"},"2":{p:17,k:2,b:"19:7",e:"19:13"},"3":{p:17,k:2,b:"19:14",e:"19:19"},"4":{p:17,k:2,b:"19:20",e:"20:14"},"5":{p:17,k:2,b:"20:15",e:"20:23"},M:{p:41,k:4,b:"28:26",e:"28:31"}}},"Shavuot II":{megillah:"Ruth",haft:{k:"Habakkuk",b:"3:1",e:"3:19"},seph:{k:"Habakkuk",b:"2:20",e:"3:19"},fullkriyah:{"1":{p:47,k:5,b:"15:19",e:"15:23"},"2":{p:47,k:5,b:"16:1",e:"16:3"},"3":{p:47,k:5,b:"16:4",e:"16:8"},"4":{p:47,k:5,b:"16:9",e:"16:12"},"5":{p:47,k:5,b:"16:13",e:"16:17"},M:{p:41,k:4,b:"28:26",e:"28:31"}}},"Shavuot II (on Shabbat)":{megillah:"Ruth",haft:{k:"Habakkuk",b:"3:1",e:"3:19"},seph:{k:"Habakkuk",b:"2:20",e:"3:19"},fullkriyah:{"1":{p:47,k:5,b:"14:22",e:"14:29"},"2":{p:47,k:5,b:"15:1",e:"15:18"},"3":{p:47,k:5,b:"15:19",e:"15:23"},"4":{p:47,k:5,b:"16:1",e:"16:3"},"5":{p:47,k:5,b:"16:4",e:"16:8"},"6":{p:47,k:5,b:"16:9",e:"16:12"},"7":{p:47,k:5,b:"16:13",e:"16:17"},M:{p:41,k:4,b:"28:26",e:"28:31"}}},"Fast Day (Morning)":{fullkriyah:{"1":{p:21,k:2,b:"32:11",e:"32:14"},"2":{p:21,k:2,b:"34:1",e:"34:3"},"3":{p:21,k:2,b:"34:4",e:"34:10"}}},"Fast Day (Afternoon)":{haft:{k:"Isaiah",b:"55:6",e:"56:8"},fullkriyah:{"1":{p:21,k:2,b:"32:11",e:"32:14"},"2":{p:21,k:2,b:"34:1",e:"34:3"},M:{p:21,k:2,b:"34:4",e:"34:10"}}},"Asara B'Tevet":{alias:true,key:"Fast Day (Morning)"},"Ta'anit Esther":{alias:true,key:"Fast Day (Morning)"},"Tzom Gedaliah":{alias:true,key:"Fast Day (Morning)"},"Tzom Tammuz":{alias:true,key:"Fast Day (Morning)"},"Asara B'Tevet (Mincha)":{alias:true,key:"Fast Day (Afternoon)"},"Ta'anit Esther (Mincha)":{alias:true,key:"Fast Day (Afternoon)"},"Tzom Gedaliah (Mincha)":{alias:true,key:"Fast Day (Afternoon)"},"Tzom Tammuz (Mincha)":{alias:true,key:"Fast Day (Afternoon)"},"Erev Tish'a B'Av":{megillah:"Lamentations"},"Tish'a B'Av":{haft:{k:"Jeremiah",b:"8:13",e:"9:23"},fullkriyah:{"1":{p:45,k:5,b:"4:25",e:"4:29"},"2":{p:45,k:5,b:"4:30",e:"4:35"},"3":{p:45,k:5,b:"4:36",e:"4:40"}}},"Tish'a B'Av (Mincha)":{alias:true,key:"Fast Day (Afternoon)"},"Rosh Hashana I":{haft:{k:"I Samuel",b:"1:1",e:"2:10"},fullkriyah:{"1":{p:4,k:1,b:"21:1",e:"21:4"},"2":{p:4,k:1,b:"21:5",e:"21:12"},"3":{p:4,k:1,b:"21:13",e:"21:21"},"4":{p:4,k:1,b:"21:22",e:"21:27"},"5":{p:4,k:1,b:"21:28",e:"21:34"},M:{p:41,k:4,b:"29:1",e:"29:6"}}},"Rosh Hashana I (on Shabbat)":{haft:{k:"I Samuel",b:"1:1",e:"2:10"},fullkriyah:{"1":{p:4,k:1,b:"21:1",e:"21:4"},"2":{p:4,k:1,b:"21:5",e:"21:8"},"3":{p:4,k:1,b:"21:9",e:"21:12"},"4":{p:4,k:1,b:"21:13",e:"21:17"},"5":{p:4,k:1,b:"21:18",e:"21:21"},"6":{p:4,k:1,b:"21:22",e:"21:27"},"7":{p:4,k:1,b:"21:28",e:"21:34"},M:{p:41,k:4,b:"29:1",e:"29:6"}}},"Rosh Hashana II":{haft:{k:"Jeremiah",b:"31:2",e:"31:20",note:"labeled 31:1–19 in some books"},fullkriyah:{"1":{p:4,k:1,b:"22:1",e:"22:3"},"2":{p:4,k:1,b:"22:4",e:"22:8"},"3":{p:4,k:1,b:"22:9",e:"22:14"},"4":{p:4,k:1,b:"22:15",e:"22:19"},"5":{p:4,k:1,b:"22:20",e:"22:24"},M:{p:41,k:4,b:"29:1",e:"29:6"}}},"Yom Kippur":{haft:{k:"Isaiah",b:"57:14",e:"58:14"},fullkriyah:{"1":{p:29,k:3,b:"16:1",e:"16:6"},"2":{p:29,k:3,b:"16:7",e:"16:11"},"3":{p:29,k:3,b:"16:12",e:"16:17"},"4":{p:29,k:3,b:"16:18",e:"16:24"},"5":{p:29,k:3,b:"16:25",e:"16:30"},"6":{p:29,k:3,b:"16:31",e:"16:34"},M:{p:41,k:4,b:"29:7",e:"29:11"}}},"Yom Kippur (on Shabbat)":{haft:{k:"Isaiah",b:"57:14",e:"58:14"},fullkriyah:{"1":{p:29,k:3,b:"16:1",e:"16:3"},"2":{p:29,k:3,b:"16:4",e:"16:6"},"3":{p:29,k:3,b:"16:7",e:"16:11"},"4":{p:29,k:3,b:"16:12",e:"16:17"},"5":{p:29,k:3,b:"16:18",e:"16:24"},"6":{p:29,k:3,b:"16:25",e:"16:30"},"7":{p:29,k:3,b:"16:31",e:"16:34"},M:{p:41,k:4,b:"29:7",e:"29:11"}}},"Yom Kippur (Mincha)":{alias:true,key:"Yom Kippur (Mincha, Traditional)"},"Yom Kippur (Mincha, Traditional)":{haft:[{k:"Jonah",b:"1:1",e:"4:11"},{k:"Micah",b:"7:18",e:"7:20"}],fullkriyah:{"1":{p:29,k:3,b:"18:1",e:"18:5"},"2":{p:29,k:3,b:"18:6",e:"18:21"},M:{p:29,k:3,b:"18:22",e:"18:30"}}},"Yom Kippur (Mincha, Alternate)":{haft:[{k:"Jonah",b:"1:1",e:"4:11"},{k:"Micah",b:"7:18",e:"7:20"}],fullkriyah:{"1":{p:30,k:3,b:"19:1",e:"19:4"},"2":{p:30,k:3,b:"19:5",e:"19:10"},M:{p:30,k:3,b:"19:11",e:"19:18"}}},"Sukkot I":{haft:{k:"Zechariah",b:"14:1",e:"14:21"},fullkriyah:{"1":{p:31,k:3,b:"22:26",e:"23:3"},"2":{p:31,k:3,b:"23:4",e:"23:14"},"3":{p:31,k:3,b:"23:15",e:"23:22"},"4":{p:31,k:3,b:"23:23",e:"23:32"},"5":{p:31,k:3,b:"23:33",e:"23:44"},M:{p:41,k:4,b:"29:12",e:"29:16"}}},"Sukkot I (on Shabbat)":{haft:{k:"Zechariah",b:"14:1",e:"14:21"},fullkriyah:{"1":{p:31,k:3,b:"22:26",e:"22:33"},"2":{p:31,k:3,b:"23:1",e:"23:3"},"3":{p:31,k:3,b:"23:4",e:"23:8"},"4":{p:31,k:3,b:"23:9",e:"23:14"},"5":{p:31,k:3,b:"23:15",e:"23:22"},"6":{p:31,k:3,b:"23:23",e:"23:32"},"7":{p:31,k:3,b:"23:33",e:"23:44"},M:{p:41,k:4,b:"29:12",e:"29:16"}}},"Sukkot II":{haft:{k:"I Kings",b:"8:2",e:"8:21"},fullkriyah:{"1":{p:31,k:3,b:"22:26",e:"23:3"},"2":{p:31,k:3,b:"23:4",e:"23:14"},"3":{p:31,k:3,b:"23:15",e:"23:22"},"4":{p:31,k:3,b:"23:23",e:"23:32"},"5":{p:31,k:3,b:"23:33",e:"23:44"},M:{p:41,k:4,b:"29:12",e:"29:16"}}},"Sukkot Chol ha-Moed Day 1":{fullkriyah:{"1":{p:41,k:4,b:"29:17",e:"29:19"},"2":{p:41,k:4,b:"29:20",e:"29:22"},"3":{p:41,k:4,b:"29:23",e:"29:25"},"4":{p:41,k:4,b:"29:17",e:"29:22"}}},"Sukkot Chol ha-Moed Day 2":{fullkriyah:{"1":{p:41,k:4,b:"29:20",e:"29:22"},"2":{p:41,k:4,b:"29:23",e:"29:25"},"3":{p:41,k:4,b:"29:26",e:"29:28"},"4":{p:41,k:4,b:"29:20",e:"29:25"}}},"Sukkot Chol ha-Moed Day 3":{fullkriyah:{"1":{p:41,k:4,b:"29:23",e:"29:25"},"2":{p:41,k:4,b:"29:26",e:"29:28"},"3":{p:41,k:4,b:"29:29",e:"29:31"},"4":{p:41,k:4,b:"29:23",e:"29:28"}}},"Sukkot Chol ha-Moed Day 4":{fullkriyah:{"1":{p:41,k:4,b:"29:26",e:"29:28"},"2":{p:41,k:4,b:"29:29",e:"29:31"},"3":{p:41,k:4,b:"29:32",e:"29:34"},"4":{p:41,k:4,b:"29:26",e:"29:31"}}},"Sukkot Chol ha-Moed Day 5":{fullkriyah:{"1":{p:41,k:4,b:"29:29",e:"29:31"},"2":{p:41,k:4,b:"29:32",e:"29:34"},"3":{p:41,k:4,b:"29:35",e:"29:37"},"4":{p:41,k:4,b:"29:29",e:"29:34"}}},"Sukkot Shabbat Chol ha-Moed":{megillah:"Ecclesiastes",haft:{k:"Ezekiel",b:"38:18",e:"39:16"},fullkriyah:{"1":{p:21,k:2,b:"33:12",e:"33:16"},"2":{p:21,k:2,b:"33:17",e:"33:19"},"3":{p:21,k:2,b:"33:20",e:"33:23"},"4":{p:21,k:2,b:"34:1",e:"34:3"},"5":{p:21,k:2,b:"34:4",e:"34:10"},"6":{p:21,k:2,b:"34:11",e:"34:17"},"7":{p:21,k:2,b:"34:18",e:"34:26"},"M-day1":{p:41,k:4,b:"29:17",e:"29:22"},"M-day2":{p:41,k:4,b:"29:20",e:"29:25"},"M-day3":{p:41,k:4,b:"29:23",e:"29:28"},"M-day4":{p:41,k:4,b:"29:26",e:"29:31"},"M-day5":{p:41,k:4,b:"29:29",e:"29:34"}}},"Sukkot Final Day (Hoshana Raba)":{fullkriyah:{"1":{p:41,k:4,b:"29:26",e:"29:28"},"2":{p:41,k:4,b:"29:29",e:"29:31"},"3":{p:41,k:4,b:"29:32",e:"29:34"},"4":{p:41,k:4,b:"29:29",e:"29:34"}}},"Shmini Atzeret":{haft:{k:"I Kings",b:"8:54",e:"8:66"},fullkriyah:{"1":{p:47,k:5,b:"14:22",e:"14:29"},"2":{p:47,k:5,b:"15:1",e:"15:18"},"3":{p:47,k:5,b:"15:19",e:"16:3"},"4":{p:47,k:5,b:"16:4",e:"16:8"},"5":{p:47,k:5,b:"16:9",e:"16:17"},M:{p:41,k:4,b:"29:35",e:"30:1"}}},"Shmini Atzeret (on Shabbat)":{megillah:"Ecclesiastes",haft:{k:"I Kings",b:"8:54",e:"8:66"},fullkriyah:{"1":{p:47,k:5,b:"14:22",e:"14:29"},"2":{p:47,k:5,b:"15:1",e:"15:18"},"3":{p:47,k:5,b:"15:19",e:"15:23"},"4":{p:47,k:5,b:"16:1",e:"16:3"},"5":{p:47,k:5,b:"16:4",e:"16:8"},"6":{p:47,k:5,b:"16:9",e:"16:12"},"7":{p:47,k:5,b:"16:13",e:"16:17"},M:{p:41,k:4,b:"29:35",e:"30:1"}}},"Erev Simchat Torah":{fullkriyah:{"1":{p:54,k:5,b:"33:1",e:"33:7"},"2":{p:54,k:5,b:"33:8",e:"33:12"},"3":{p:54,k:5,b:"33:13",e:"33:17"}}},"Simchat Torah":{haft:{k:"Joshua",b:"1:1",e:"1:18"},fullkriyah:{"1":{p:54,k:5,b:"33:1",e:"33:7"},"2":{p:54,k:5,b:"33:8",e:"33:12"},"3":{p:54,k:5,b:"33:13",e:"33:17"},"4":{p:54,k:5,b:"33:18",e:"33:21"},"5":{p:54,k:5,b:"33:22",e:"33:26"},"6":{p:54,k:5,b:"33:27",e:"34:12"},"7":{p:1,k:1,b:"1:1",e:"2:3"},M:{p:41,k:4,b:"29:35",e:"30:1"}}},"Simchat Torah (on Shabbat)":{megillah:"Ecclesiastes",haft:{k:"Joshua",b:"1:1",e:"1:18"},fullkriyah:{"1":{p:54,k:5,b:"33:1",e:"33:7"},"2":{p:54,k:5,b:"33:8",e:"33:12"},"3":{p:54,k:5,b:"33:13",e:"33:17"},"4":{p:54,k:5,b:"33:18",e:"33:21"},"5":{p:54,k:5,b:"33:22",e:"33:26"},"6":{p:54,k:5,b:"33:27",e:"33:29"},"7":{p:54,k:5,b:"34:1",e:"34:12"},"8":{p:1,k:1,b:"1:1",e:"2:3"},M:{p:41,k:4,b:"29:35",e:"30:1"}}},"Shabbat Rosh Chodesh Chanukah":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{"7":{p:41,k:4,b:"28:9",e:"28:15"},M:{p:35,k:4,b:"7:42",e:"7:47"}}},"Chanukah Day 1":{fullkriyah:{"1":{p:35,k:4,b:"7:1",e:"7:11"},"2":{p:35,k:4,b:"7:12",e:"7:14"},"3":{p:35,k:4,b:"7:15",e:"7:17"}},alt:{"1":{p:35,k:4,b:"7:1",e:"7:3"},"2":{p:35,k:4,b:"7:4",e:"7:11"},"3":{p:35,k:4,b:"7:12",e:"7:17"}}},"Chanukah Day 1 (on Shabbat)":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{M:{p:35,k:4,b:"7:1",e:"7:17"}}},"Chanukah Day 2":{fullkriyah:{"1":{p:35,k:4,b:"7:18",e:"7:20"},"2":{p:35,k:4,b:"7:21",e:"7:23"},"3":{p:35,k:4,b:"7:24",e:"7:29"}},alt:{"1":{p:35,k:4,b:"7:18",e:"7:20"},"2":{p:35,k:4,b:"7:21",e:"7:23"},"3":{p:35,k:4,b:"7:18",e:"7:23"}}},"Chanukah Day 2 (on Shabbat)":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{M:{p:35,k:4,b:"7:18",e:"7:23"}}},"Chanukah Day 3":{fullkriyah:{"1":{p:35,k:4,b:"7:24",e:"7:26"},"2":{p:35,k:4,b:"7:27",e:"7:29"},"3":{p:35,k:4,b:"7:30",e:"7:35"}},alt:{"1":{p:35,k:4,b:"7:24",e:"7:26"},"2":{p:35,k:4,b:"7:27",e:"7:29"},"3":{p:35,k:4,b:"7:24",e:"7:29"}}},"Chanukah Day 3 (on Shabbat)":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{M:{p:35,k:4,b:"7:24",e:"7:29"}}},"Chanukah Day 4":{fullkriyah:{"1":{p:35,k:4,b:"7:30",e:"7:32"},"2":{p:35,k:4,b:"7:33",e:"7:35"},"3":{p:35,k:4,b:"7:36",e:"7:41"}},alt:{"1":{p:35,k:4,b:"7:30",e:"7:32"},"2":{p:35,k:4,b:"7:33",e:"7:35"},"3":{p:35,k:4,b:"7:30",e:"7:35"}}},"Chanukah Day 4 (on Shabbat)":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{M:{p:35,k:4,b:"7:30",e:"7:35"}}},"Chanukah Day 5":{fullkriyah:{"1":{p:35,k:4,b:"7:36",e:"7:38"},"2":{p:35,k:4,b:"7:39",e:"7:41"},"3":{p:35,k:4,b:"7:42",e:"7:47"}},alt:{"1":{p:35,k:4,b:"7:36",e:"7:38"},"2":{p:35,k:4,b:"7:39",e:"7:41"},"3":{p:35,k:4,b:"7:36",e:"7:41"}}},"Chanukah Day 5 (on Shabbat)":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{M:{p:35,k:4,b:"7:36",e:"7:41"}}},"Chanukah Day 6":{fullkriyah:{"1":{p:41,k:4,b:"28:1",e:"28:5"},"2":{p:41,k:4,b:"28:6",e:"28:10"},"3":{p:41,k:4,b:"28:11",e:"28:15"},"4":{p:35,k:4,b:"7:42",e:"7:47"}}},"Chanukah Day 7":{fullkriyah:{"1":{p:35,k:4,b:"7:48",e:"7:50"},"2":{p:35,k:4,b:"7:51",e:"7:53"},"3":{p:35,k:4,b:"7:54",e:"7:59"}},alt:{"1":{p:35,k:4,b:"7:48",e:"7:50"},"2":{p:35,k:4,b:"7:51",e:"7:53"},"3":{p:35,k:4,b:"7:48",e:"7:53"}}},"Chanukah Day 7 (on Rosh Chodesh)":{fullkriyah:{"1":{p:41,k:4,b:"28:1",e:"28:5"},"2":{p:41,k:4,b:"28:6",e:"28:10"},"3":{p:41,k:4,b:"28:11",e:"28:15"},"4":{p:35,k:4,b:"7:48",e:"7:53"}}},"Chanukah Day 7 (on Shabbat)":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{M:{p:35,k:4,b:"7:48",e:"7:53"}}},"Chanukah Day 8":{fullkriyah:{"1":{p:35,k:4,b:"7:54",e:"7:56"},"2":{p:35,k:4,b:"7:57",e:"7:59"},"3":{p:35,k:4,b:"7:60",e:"8:4"}}},"Chanukah Day 8 (on Shabbat)":{haft:{k:"I Kings",b:"7:40",e:"7:50"},fullkriyah:{M:{p:35,k:4,b:"7:54",e:"8:4"}}},"Erev Purim":{megillah:"Esther"},Purim:Purim,"Shushan Purim":{note:"Jerusalem & walled cities only",il:true,megillah:"Esther",fullkriyah:{"1":{p:16,k:2,b:"17:8",e:"17:10"},"2":{p:16,k:2,b:"17:11",e:"17:13"},"3":{p:16,k:2,b:"17:14",e:"17:16"}}},"Shushan Purim (on Shabbat)":{il:true,note:"Jerusalem & walled cities only: special maftir Exodus 17:8-16, same Haftara as Shabbat Zachor"},"Shabbat HaChodesh":{haft:{k:"Ezekiel",b:"45:16",e:"46:18"},seph:{k:"Ezekiel",b:"45:18",e:"46:15"},fullkriyah:{M:{p:15,k:2,b:"12:1",e:"12:20"}}},"Shabbat HaChodesh (on Rosh Chodesh)":{haft:{k:"Ezekiel",b:"45:16",e:"46:18"},seph:{k:"Ezekiel",b:"45:18",e:"46:15"},fullkriyah:{"7":{p:41,k:4,b:"28:9",e:"28:15"},M:{p:15,k:2,b:"12:1",e:"12:20"}}},"Shabbat HaGadol":{haft:{k:"Malachi",b:"3:4",e:"3:24"}},"Shabbat Parah":{haft:{k:"Ezekiel",b:"36:16",e:"36:38"},seph:{k:"Ezekiel",b:"36:16",e:"36:36"},fullkriyah:{M:{p:39,k:4,b:"19:1",e:"19:22"}}},"Shabbat Shekalim":{haft:{k:"II Kings",b:"12:1",e:"12:17"},seph:{k:"II Kings",b:"11:17",e:"12:17"},fullkriyah:{M:{p:21,k:2,b:"30:11",e:"30:16"}}},"Shabbat Shekalim (on Rosh Chodesh)":{haft:{k:"II Kings",b:"12:1",e:"12:17"},seph:{k:"II Kings",b:"11:17",e:"12:17"},fullkriyah:{"7":{p:41,k:4,b:"28:9",e:"28:15"},M:{p:21,k:2,b:"30:11",e:"30:16"}}},"Shabbat Shuva (with Vayeilech)":{haft:[{k:"Hosea",b:"14:2",e:"14:10"},{k:"Micah",b:"7:18",e:"7:20"}]},"Shabbat Shuva (with Ha'azinu)":{haft:[{k:"Hosea",b:"14:2",e:"14:10"},{k:"Joel",b:"2:15",e:"2:27"}],seph:[{k:"Hosea",b:"14:2",e:"14:10"},{k:"Micah",b:"7:18",e:"7:20"}]},"Shabbat Shuva":{haft:[{k:"Hosea",b:"14:2",e:"14:10"},{k:"Micah",b:"7:18",e:"7:20"},{k:"Joel",b:"2:15",e:"2:27"}]},"Shabbat Zachor":{haft:{k:"I Samuel",b:"15:2",e:"15:34"},seph:{k:"I Samuel",b:"15:1",e:"15:34"},fullkriyah:{M:{p:49,k:5,b:"25:17",e:"25:19"}}},"Pinchas occurring after 17 Tammuz":{haft:{k:"Jeremiah",b:"1:1",e:"2:3"}},"Kedoshim following Special Shabbat":{haft:{k:"Amos",b:"9:7",e:"9:15"},seph:{k:"Ezekiel",b:"20:2",e:"20:20"}},"Masei on Shabbat Rosh Chodesh":{haft:[{k:"Jeremiah",b:"2:4",e:"2:28"},{k:"Jeremiah",b:"3:4",e:"3:4"}],seph:[{k:"Jeremiah",b:"2:4",e:"2:28"},{k:"Jeremiah",b:"4:1",e:"4:2"},{k:"Isaiah",b:"66:1",e:"66:1"},{k:"Isaiah",b:"66:23",e:"66:23"}],fullkriyah:{M:{p:41,k:4,b:"28:9",e:"28:15"}}},"Matot-Masei on Shabbat Rosh Chodesh":{alias:true,key:"Masei on Shabbat Rosh Chodesh"},"Ki Teitzei with 3rd Haftarah of Consolation":{haft:[{k:"Isaiah",b:"54:1",e:"54:10"},{k:"Isaiah",b:"54:11",e:"55:5"}]},"Rosh Chodesh":{fullkriyah:{"1":{p:41,k:4,b:"28:1",e:"28:3"},"2":{p:41,k:4,b:"28:3",e:"28:5"},"3":{p:41,k:4,b:"28:6",e:"28:10"},"4":{p:41,k:4,b:"28:11",e:"28:15"}}},"Rosh Chodesh Nisan":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Iyyar":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Sivan":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Tamuz":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Av":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Elul":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Tishrei":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Cheshvan":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Kislev":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Sh'vat":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Adar":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Adar I":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Adar II":{alias:true,key:"Rosh Chodesh"},"Shabbat Rosh Chodesh":{haft:{k:"Isaiah",b:"66:1",e:"66:24"},fullkriyah:{M:{p:41,k:4,b:"28:9",e:"28:15"}}},"Shabbat Machar Chodesh":{haft:{k:"I Samuel",b:"20:18",e:"20:42"}}};
|
|
2076
|
+
|
|
2077
|
+
/*! @hebcal/leyning v9.0.1 */
|
|
2078
|
+
|
|
2079
|
+
const festivals = festivals0;
|
|
2080
|
+
/**
|
|
2081
|
+
* Is there a special festival Torah Reading for `holiday`?
|
|
2082
|
+
*/
|
|
2083
|
+
function hasFestival(holiday) {
|
|
2084
|
+
return typeof festivals[holiday] === 'object';
|
|
2085
|
+
}
|
|
2086
|
+
/**
|
|
2087
|
+
* Returns the raw metadata for festival reading for `holiday`
|
|
2088
|
+
*/
|
|
2089
|
+
function lookupFestival(holiday) {
|
|
2090
|
+
let src = festivals[holiday];
|
|
2091
|
+
if (typeof src === 'undefined') {
|
|
2092
|
+
return undefined;
|
|
2093
|
+
}
|
|
2094
|
+
if (src.alias) {
|
|
2095
|
+
const tmp = festivals[src.key];
|
|
2096
|
+
if (typeof tmp === 'undefined') {
|
|
2097
|
+
throw new Error(`Leyning alias ${holiday} => ${src.key} not found`);
|
|
2098
|
+
}
|
|
2099
|
+
src = tmp;
|
|
2100
|
+
}
|
|
2101
|
+
const result = src.fullkriyah ? clone(src) : src;
|
|
2102
|
+
if (result.fullkriyah) {
|
|
2103
|
+
for (const aliyah of Object.values(result.fullkriyah)) {
|
|
2104
|
+
if (typeof aliyah.k === 'number') {
|
|
2105
|
+
aliyah.k = BOOK[aliyah.k];
|
|
2106
|
+
}
|
|
2107
|
+
}
|
|
2108
|
+
}
|
|
2109
|
+
if (src.note) {
|
|
2110
|
+
result.note = src.note;
|
|
2111
|
+
}
|
|
2112
|
+
return result;
|
|
2113
|
+
}
|
|
2114
|
+
|
|
2115
|
+
/*! @hebcal/leyning v9.0.1 */
|
|
2116
|
+
|
|
2117
|
+
const HOLIDAY_IGNORE_MASK$1 = flags.DAF_YOMI |
|
|
2118
|
+
flags.OMER_COUNT |
|
|
2119
|
+
flags.SHABBAT_MEVARCHIM |
|
|
2120
|
+
flags.MOLAD |
|
|
2121
|
+
flags.USER_EVENT |
|
|
2122
|
+
flags.HEBREW_DATE |
|
|
2123
|
+
flags.MISHNA_YOMI |
|
|
2124
|
+
flags.MODERN_HOLIDAY |
|
|
2125
|
+
flags.YERUSHALMI_YOMI;
|
|
2126
|
+
/**
|
|
2127
|
+
* Based on the event date, type and title, finds the relevant leyning key
|
|
2128
|
+
* @param ev event
|
|
2129
|
+
* @param [il] true if Israel holiday scheme
|
|
2130
|
+
* @returns key to look up in holiday-reading.json
|
|
2131
|
+
*/
|
|
2132
|
+
function getLeyningKeyForEvent(ev, il = false) {
|
|
2133
|
+
if (typeof ev.eventTime !== 'undefined') {
|
|
2134
|
+
return undefined;
|
|
2135
|
+
}
|
|
2136
|
+
const mask = ev.getFlags();
|
|
2137
|
+
if (mask & HOLIDAY_IGNORE_MASK$1) {
|
|
2138
|
+
return undefined;
|
|
2139
|
+
}
|
|
2140
|
+
// Skip all Erevs except for Simchat Torah
|
|
2141
|
+
const desc = ev.getDesc();
|
|
2142
|
+
if (mask & flags.EREV && !hasFestival(desc)) {
|
|
2143
|
+
return undefined;
|
|
2144
|
+
}
|
|
2145
|
+
const hd = ev.getDate();
|
|
2146
|
+
const day = hd.getDate();
|
|
2147
|
+
const dow = hd.abs() % 7;
|
|
2148
|
+
const month = hd.getMonth();
|
|
2149
|
+
const isShabbat = dow === 6;
|
|
2150
|
+
const isRoshChodesh = day === 1 || day === 30;
|
|
2151
|
+
const holiday = ev.basename();
|
|
2152
|
+
const isPesach = holiday === 'Pesach';
|
|
2153
|
+
if (il && isPesach) {
|
|
2154
|
+
if (isShabbat) {
|
|
2155
|
+
return day === 15 || day === 21
|
|
2156
|
+
? desc + ' (on Shabbat)'
|
|
2157
|
+
: 'Pesach Shabbat Chol ha-Moed';
|
|
2158
|
+
}
|
|
2159
|
+
return desc;
|
|
2160
|
+
}
|
|
2161
|
+
if (day === 1 && month === months.TISHREI) {
|
|
2162
|
+
return isShabbat ? 'Rosh Hashana I (on Shabbat)' : 'Rosh Hashana I';
|
|
2163
|
+
}
|
|
2164
|
+
const cholHaMoedDay = ev.cholHaMoedDay;
|
|
2165
|
+
if (typeof cholHaMoedDay === 'number') {
|
|
2166
|
+
// Sukkot or Pesach
|
|
2167
|
+
if (isShabbat) {
|
|
2168
|
+
return holiday + ' Shabbat Chol ha-Moed';
|
|
2169
|
+
}
|
|
2170
|
+
else if (desc === 'Sukkot VII (Hoshana Raba)') {
|
|
2171
|
+
return 'Sukkot Final Day (Hoshana Raba)';
|
|
2172
|
+
}
|
|
2173
|
+
if (isPesach && cholHaMoedDay) {
|
|
2174
|
+
if (dow === 0 && desc === "Pesach IV (CH''M)") {
|
|
2175
|
+
return 'Pesach Chol ha-Moed Day 2 on Sunday';
|
|
2176
|
+
}
|
|
2177
|
+
else if (dow === 1 && desc === "Pesach V (CH''M)") {
|
|
2178
|
+
return 'Pesach Chol ha-Moed Day 3 on Monday';
|
|
2179
|
+
}
|
|
2180
|
+
}
|
|
2181
|
+
return `${holiday} Chol ha-Moed Day ${cholHaMoedDay}`;
|
|
2182
|
+
}
|
|
2183
|
+
const chanukahDay = ev.chanukahDay;
|
|
2184
|
+
if (typeof chanukahDay === 'number') {
|
|
2185
|
+
if (isShabbat && isRoshChodesh) {
|
|
2186
|
+
return 'Shabbat Rosh Chodesh Chanukah';
|
|
2187
|
+
}
|
|
2188
|
+
else if (isRoshChodesh && chanukahDay === 7) {
|
|
2189
|
+
return 'Chanukah Day 7 (on Rosh Chodesh)';
|
|
2190
|
+
}
|
|
2191
|
+
else if (isShabbat) {
|
|
2192
|
+
return `Chanukah Day ${chanukahDay} (on Shabbat)`;
|
|
2193
|
+
}
|
|
2194
|
+
else {
|
|
2195
|
+
return `Chanukah Day ${chanukahDay}`;
|
|
2196
|
+
}
|
|
2197
|
+
}
|
|
2198
|
+
if (isRoshChodesh &&
|
|
2199
|
+
(desc === 'Shabbat HaChodesh' || desc === 'Shabbat Shekalim')) {
|
|
2200
|
+
return desc + ' (on Rosh Chodesh)';
|
|
2201
|
+
}
|
|
2202
|
+
if (il && desc === 'Shmini Atzeret') {
|
|
2203
|
+
return 'Simchat Torah' + (isShabbat ? ' (on Shabbat)' : '');
|
|
2204
|
+
}
|
|
2205
|
+
if (desc === 'Chag HaBanot') {
|
|
2206
|
+
return undefined;
|
|
2207
|
+
}
|
|
2208
|
+
if (isShabbat && 'Shabbat' !== desc.substring(0, 7)) {
|
|
2209
|
+
if (isRoshChodesh) {
|
|
2210
|
+
if (desc === 'Rosh Chodesh Tevet') {
|
|
2211
|
+
return 'Shabbat Rosh Chodesh Chanukah';
|
|
2212
|
+
}
|
|
2213
|
+
return 'Shabbat Rosh Chodesh';
|
|
2214
|
+
}
|
|
2215
|
+
const desc2 = desc + ' (on Shabbat)';
|
|
2216
|
+
if (hasFestival(desc2)) {
|
|
2217
|
+
return desc2;
|
|
2218
|
+
}
|
|
2219
|
+
}
|
|
2220
|
+
if (hasFestival(desc)) {
|
|
2221
|
+
return desc;
|
|
2222
|
+
}
|
|
2223
|
+
if (isShabbat) {
|
|
2224
|
+
const tommorow = hd.next().getDate();
|
|
2225
|
+
if (tommorow === 30 || tommorow === 1) {
|
|
2226
|
+
return 'Shabbat Machar Chodesh';
|
|
2227
|
+
}
|
|
2228
|
+
}
|
|
2229
|
+
if (desc === 'Rosh Hashana LaBehemot') {
|
|
2230
|
+
return undefined;
|
|
2231
|
+
}
|
|
2232
|
+
if (desc === 'Rosh Chodesh Tevet') {
|
|
2233
|
+
if (isShabbat) {
|
|
2234
|
+
return 'Shabbat Rosh Chodesh Chanukah';
|
|
2235
|
+
}
|
|
2236
|
+
if (day === 30 || HDate.shortKislev(hd.getFullYear())) {
|
|
2237
|
+
return 'Chanukah Day 6'; // 30th of Kislev or 1st of Tevet
|
|
2238
|
+
}
|
|
2239
|
+
else {
|
|
2240
|
+
return 'Chanukah Day 7 (on Rosh Chodesh)'; // 1st of Tevet
|
|
2241
|
+
}
|
|
2242
|
+
}
|
|
2243
|
+
if (isRoshChodesh) {
|
|
2244
|
+
return desc;
|
|
2245
|
+
}
|
|
2246
|
+
if (desc === "Tish'a B'Av (observed)") {
|
|
2247
|
+
return "Tish'a B'Av";
|
|
2248
|
+
}
|
|
2249
|
+
return undefined;
|
|
2250
|
+
}
|
|
2251
|
+
|
|
2252
|
+
class QuickLRU extends Map {
|
|
2253
|
+
constructor(options = {}) {
|
|
2254
|
+
super();
|
|
2255
|
+
|
|
2256
|
+
if (!(options.maxSize && options.maxSize > 0)) {
|
|
2257
|
+
throw new TypeError('`maxSize` must be a number greater than 0');
|
|
2258
|
+
}
|
|
2259
|
+
|
|
2260
|
+
if (typeof options.maxAge === 'number' && options.maxAge === 0) {
|
|
2261
|
+
throw new TypeError('`maxAge` must be a number greater than 0');
|
|
2262
|
+
}
|
|
2263
|
+
|
|
2264
|
+
// TODO: Use private class fields when ESLint supports them.
|
|
2265
|
+
this.maxSize = options.maxSize;
|
|
2266
|
+
this.maxAge = options.maxAge || Number.POSITIVE_INFINITY;
|
|
2267
|
+
this.onEviction = options.onEviction;
|
|
2268
|
+
this.cache = new Map();
|
|
2269
|
+
this.oldCache = new Map();
|
|
2270
|
+
this._size = 0;
|
|
2271
|
+
}
|
|
2272
|
+
|
|
2273
|
+
// TODO: Use private class methods when targeting Node.js 16.
|
|
2274
|
+
_emitEvictions(cache) {
|
|
2275
|
+
if (typeof this.onEviction !== 'function') {
|
|
2276
|
+
return;
|
|
2277
|
+
}
|
|
2278
|
+
|
|
2279
|
+
for (const [key, item] of cache) {
|
|
2280
|
+
this.onEviction(key, item.value);
|
|
2281
|
+
}
|
|
2282
|
+
}
|
|
2283
|
+
|
|
2284
|
+
_deleteIfExpired(key, item) {
|
|
2285
|
+
if (typeof item.expiry === 'number' && item.expiry <= Date.now()) {
|
|
2286
|
+
if (typeof this.onEviction === 'function') {
|
|
2287
|
+
this.onEviction(key, item.value);
|
|
2288
|
+
}
|
|
2289
|
+
|
|
2290
|
+
return this.delete(key);
|
|
2291
|
+
}
|
|
2292
|
+
|
|
2293
|
+
return false;
|
|
2294
|
+
}
|
|
2295
|
+
|
|
2296
|
+
_getOrDeleteIfExpired(key, item) {
|
|
2297
|
+
const deleted = this._deleteIfExpired(key, item);
|
|
2298
|
+
if (deleted === false) {
|
|
2299
|
+
return item.value;
|
|
2300
|
+
}
|
|
2301
|
+
}
|
|
2302
|
+
|
|
2303
|
+
_getItemValue(key, item) {
|
|
2304
|
+
return item.expiry ? this._getOrDeleteIfExpired(key, item) : item.value;
|
|
2305
|
+
}
|
|
2306
|
+
|
|
2307
|
+
_peek(key, cache) {
|
|
2308
|
+
const item = cache.get(key);
|
|
2309
|
+
|
|
2310
|
+
return this._getItemValue(key, item);
|
|
2311
|
+
}
|
|
2312
|
+
|
|
2313
|
+
_set(key, value) {
|
|
2314
|
+
this.cache.set(key, value);
|
|
2315
|
+
this._size++;
|
|
2316
|
+
|
|
2317
|
+
if (this._size >= this.maxSize) {
|
|
2318
|
+
this._size = 0;
|
|
2319
|
+
this._emitEvictions(this.oldCache);
|
|
2320
|
+
this.oldCache = this.cache;
|
|
2321
|
+
this.cache = new Map();
|
|
2322
|
+
}
|
|
2323
|
+
}
|
|
2324
|
+
|
|
2325
|
+
_moveToRecent(key, item) {
|
|
2326
|
+
this.oldCache.delete(key);
|
|
2327
|
+
this._set(key, item);
|
|
2328
|
+
}
|
|
2329
|
+
|
|
2330
|
+
* _entriesAscending() {
|
|
2331
|
+
for (const item of this.oldCache) {
|
|
2332
|
+
const [key, value] = item;
|
|
2333
|
+
if (!this.cache.has(key)) {
|
|
2334
|
+
const deleted = this._deleteIfExpired(key, value);
|
|
2335
|
+
if (deleted === false) {
|
|
2336
|
+
yield item;
|
|
2337
|
+
}
|
|
2338
|
+
}
|
|
2339
|
+
}
|
|
2340
|
+
|
|
2341
|
+
for (const item of this.cache) {
|
|
2342
|
+
const [key, value] = item;
|
|
2343
|
+
const deleted = this._deleteIfExpired(key, value);
|
|
2344
|
+
if (deleted === false) {
|
|
2345
|
+
yield item;
|
|
2346
|
+
}
|
|
2347
|
+
}
|
|
2348
|
+
}
|
|
2349
|
+
|
|
2350
|
+
get(key) {
|
|
2351
|
+
if (this.cache.has(key)) {
|
|
2352
|
+
const item = this.cache.get(key);
|
|
2353
|
+
|
|
2354
|
+
return this._getItemValue(key, item);
|
|
2355
|
+
}
|
|
2356
|
+
|
|
2357
|
+
if (this.oldCache.has(key)) {
|
|
2358
|
+
const item = this.oldCache.get(key);
|
|
2359
|
+
if (this._deleteIfExpired(key, item) === false) {
|
|
2360
|
+
this._moveToRecent(key, item);
|
|
2361
|
+
return item.value;
|
|
2362
|
+
}
|
|
2363
|
+
}
|
|
2364
|
+
}
|
|
2365
|
+
|
|
2366
|
+
set(key, value, {maxAge = this.maxAge} = {}) {
|
|
2367
|
+
const expiry =
|
|
2368
|
+
typeof maxAge === 'number' && maxAge !== Number.POSITIVE_INFINITY ?
|
|
2369
|
+
Date.now() + maxAge :
|
|
2370
|
+
undefined;
|
|
2371
|
+
if (this.cache.has(key)) {
|
|
2372
|
+
this.cache.set(key, {
|
|
2373
|
+
value,
|
|
2374
|
+
expiry
|
|
2375
|
+
});
|
|
2376
|
+
} else {
|
|
2377
|
+
this._set(key, {value, expiry});
|
|
2378
|
+
}
|
|
2379
|
+
|
|
2380
|
+
return this;
|
|
2381
|
+
}
|
|
2382
|
+
|
|
2383
|
+
has(key) {
|
|
2384
|
+
if (this.cache.has(key)) {
|
|
2385
|
+
return !this._deleteIfExpired(key, this.cache.get(key));
|
|
2386
|
+
}
|
|
2387
|
+
|
|
2388
|
+
if (this.oldCache.has(key)) {
|
|
2389
|
+
return !this._deleteIfExpired(key, this.oldCache.get(key));
|
|
2390
|
+
}
|
|
2391
|
+
|
|
2392
|
+
return false;
|
|
2393
|
+
}
|
|
2394
|
+
|
|
2395
|
+
peek(key) {
|
|
2396
|
+
if (this.cache.has(key)) {
|
|
2397
|
+
return this._peek(key, this.cache);
|
|
2398
|
+
}
|
|
2399
|
+
|
|
2400
|
+
if (this.oldCache.has(key)) {
|
|
2401
|
+
return this._peek(key, this.oldCache);
|
|
2402
|
+
}
|
|
2403
|
+
}
|
|
2404
|
+
|
|
2405
|
+
delete(key) {
|
|
2406
|
+
const deleted = this.cache.delete(key);
|
|
2407
|
+
if (deleted) {
|
|
2408
|
+
this._size--;
|
|
2409
|
+
}
|
|
2410
|
+
|
|
2411
|
+
return this.oldCache.delete(key) || deleted;
|
|
2412
|
+
}
|
|
2413
|
+
|
|
2414
|
+
clear() {
|
|
2415
|
+
this.cache.clear();
|
|
2416
|
+
this.oldCache.clear();
|
|
2417
|
+
this._size = 0;
|
|
2418
|
+
}
|
|
2419
|
+
|
|
2420
|
+
resize(newSize) {
|
|
2421
|
+
if (!(newSize && newSize > 0)) {
|
|
2422
|
+
throw new TypeError('`maxSize` must be a number greater than 0');
|
|
2423
|
+
}
|
|
2424
|
+
|
|
2425
|
+
const items = [...this._entriesAscending()];
|
|
2426
|
+
const removeCount = items.length - newSize;
|
|
2427
|
+
if (removeCount < 0) {
|
|
2428
|
+
this.cache = new Map(items);
|
|
2429
|
+
this.oldCache = new Map();
|
|
2430
|
+
this._size = items.length;
|
|
2431
|
+
} else {
|
|
2432
|
+
if (removeCount > 0) {
|
|
2433
|
+
this._emitEvictions(items.slice(0, removeCount));
|
|
2434
|
+
}
|
|
2435
|
+
|
|
2436
|
+
this.oldCache = new Map(items.slice(removeCount));
|
|
2437
|
+
this.cache = new Map();
|
|
2438
|
+
this._size = 0;
|
|
2439
|
+
}
|
|
2440
|
+
|
|
2441
|
+
this.maxSize = newSize;
|
|
2442
|
+
}
|
|
2443
|
+
|
|
2444
|
+
* keys() {
|
|
2445
|
+
for (const [key] of this) {
|
|
2446
|
+
yield key;
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
|
|
2450
|
+
* values() {
|
|
2451
|
+
for (const [, value] of this) {
|
|
2452
|
+
yield value;
|
|
2453
|
+
}
|
|
2454
|
+
}
|
|
2455
|
+
|
|
2456
|
+
* [Symbol.iterator]() {
|
|
2457
|
+
for (const item of this.cache) {
|
|
2458
|
+
const [key, value] = item;
|
|
2459
|
+
const deleted = this._deleteIfExpired(key, value);
|
|
2460
|
+
if (deleted === false) {
|
|
2461
|
+
yield [key, value.value];
|
|
2462
|
+
}
|
|
2463
|
+
}
|
|
2464
|
+
|
|
2465
|
+
for (const item of this.oldCache) {
|
|
2466
|
+
const [key, value] = item;
|
|
2467
|
+
if (!this.cache.has(key)) {
|
|
2468
|
+
const deleted = this._deleteIfExpired(key, value);
|
|
2469
|
+
if (deleted === false) {
|
|
2470
|
+
yield [key, value.value];
|
|
2471
|
+
}
|
|
2472
|
+
}
|
|
2473
|
+
}
|
|
2474
|
+
}
|
|
2475
|
+
|
|
2476
|
+
* entriesDescending() {
|
|
2477
|
+
let items = [...this.cache];
|
|
2478
|
+
for (let i = items.length - 1; i >= 0; --i) {
|
|
2479
|
+
const item = items[i];
|
|
2480
|
+
const [key, value] = item;
|
|
2481
|
+
const deleted = this._deleteIfExpired(key, value);
|
|
2482
|
+
if (deleted === false) {
|
|
2483
|
+
yield [key, value.value];
|
|
2484
|
+
}
|
|
2485
|
+
}
|
|
2486
|
+
|
|
2487
|
+
items = [...this.oldCache];
|
|
2488
|
+
for (let i = items.length - 1; i >= 0; --i) {
|
|
2489
|
+
const item = items[i];
|
|
2490
|
+
const [key, value] = item;
|
|
2491
|
+
if (!this.cache.has(key)) {
|
|
2492
|
+
const deleted = this._deleteIfExpired(key, value);
|
|
2493
|
+
if (deleted === false) {
|
|
2494
|
+
yield [key, value.value];
|
|
2495
|
+
}
|
|
2496
|
+
}
|
|
2497
|
+
}
|
|
2498
|
+
}
|
|
2499
|
+
|
|
2500
|
+
* entriesAscending() {
|
|
2501
|
+
for (const [key, value] of this._entriesAscending()) {
|
|
2502
|
+
yield [key, value.value];
|
|
2503
|
+
}
|
|
2504
|
+
}
|
|
2505
|
+
|
|
2506
|
+
get size() {
|
|
2507
|
+
if (!this._size) {
|
|
2508
|
+
return this.oldCache.size;
|
|
2509
|
+
}
|
|
2510
|
+
|
|
2511
|
+
let oldCacheSize = 0;
|
|
2512
|
+
for (const key of this.oldCache.keys()) {
|
|
2513
|
+
if (!this.cache.has(key)) {
|
|
2514
|
+
oldCacheSize++;
|
|
2515
|
+
}
|
|
2516
|
+
}
|
|
2517
|
+
|
|
2518
|
+
return Math.min(this._size + oldCacheSize, this.maxSize);
|
|
2519
|
+
}
|
|
2520
|
+
|
|
2521
|
+
entries() {
|
|
2522
|
+
return this.entriesAscending();
|
|
2523
|
+
}
|
|
2524
|
+
|
|
2525
|
+
forEach(callbackFunction, thisArgument = this) {
|
|
2526
|
+
for (const [key, value] of this.entriesAscending()) {
|
|
2527
|
+
callbackFunction.call(thisArgument, value, key, this);
|
|
2528
|
+
}
|
|
2529
|
+
}
|
|
2530
|
+
|
|
2531
|
+
get [Symbol.toStringTag]() {
|
|
2532
|
+
return JSON.stringify([...this.entriesAscending()]);
|
|
2533
|
+
}
|
|
2534
|
+
}
|
|
2535
|
+
|
|
2536
|
+
/*! @hebcal/core v5.7.7 */
|
|
2537
|
+
|
|
2538
|
+
const SUN$1 = 0;
|
|
2539
|
+
const TUE$1 = 2;
|
|
2540
|
+
const FRI$1 = 5;
|
|
2541
|
+
const SAT$1 = 6;
|
|
2542
|
+
const NISAN$1 = months.NISAN;
|
|
2543
|
+
const IYYAR = months.IYYAR;
|
|
2544
|
+
/**
|
|
2545
|
+
* Yom HaShoah first observed in 1951.
|
|
2546
|
+
* When the actual date of Yom Hashoah falls on a Friday, the
|
|
2547
|
+
* state of Israel observes Yom Hashoah on the preceding
|
|
2548
|
+
* Thursday. When it falls on a Sunday, Yom Hashoah is observed
|
|
2549
|
+
* on the following Monday.
|
|
2550
|
+
* http://www.ushmm.org/remembrance/dor/calendar/
|
|
2551
|
+
* @private
|
|
2552
|
+
* @param year
|
|
2553
|
+
*/
|
|
2554
|
+
function dateYomHaShoah(year) {
|
|
2555
|
+
if (year < 5711) {
|
|
2556
|
+
return null;
|
|
2557
|
+
}
|
|
2558
|
+
let nisan27dt = new HDate(27, NISAN$1, year);
|
|
2559
|
+
if (nisan27dt.getDay() === FRI$1) {
|
|
2560
|
+
nisan27dt = new HDate(26, NISAN$1, year);
|
|
2561
|
+
}
|
|
2562
|
+
else if (nisan27dt.getDay() === SUN$1) {
|
|
2563
|
+
nisan27dt = new HDate(28, NISAN$1, year);
|
|
2564
|
+
}
|
|
2565
|
+
return nisan27dt;
|
|
2566
|
+
}
|
|
2567
|
+
/**
|
|
2568
|
+
* Yom HaAtzma'ut only celebrated after 1948
|
|
2569
|
+
* @private
|
|
2570
|
+
* @param year
|
|
2571
|
+
*/
|
|
2572
|
+
function dateYomHaZikaron(year) {
|
|
2573
|
+
if (year < 5708) {
|
|
2574
|
+
return null;
|
|
2575
|
+
}
|
|
2576
|
+
let day;
|
|
2577
|
+
const pesach = new HDate(15, NISAN$1, year);
|
|
2578
|
+
const pdow = pesach.getDay();
|
|
2579
|
+
if (pdow === SUN$1) {
|
|
2580
|
+
day = 2;
|
|
2581
|
+
}
|
|
2582
|
+
else if (pdow === SAT$1) {
|
|
2583
|
+
day = 3;
|
|
2584
|
+
}
|
|
2585
|
+
else if (year < 5764) {
|
|
2586
|
+
day = 4;
|
|
2587
|
+
}
|
|
2588
|
+
else if (pdow === TUE$1) {
|
|
2589
|
+
day = 5;
|
|
2590
|
+
}
|
|
2591
|
+
else {
|
|
2592
|
+
day = 4;
|
|
2593
|
+
}
|
|
2594
|
+
return new HDate(day, IYYAR, year);
|
|
2595
|
+
}
|
|
2596
|
+
|
|
2597
|
+
/*! @hebcal/core v5.7.7 */
|
|
2598
|
+
|
|
2599
|
+
/** @private */
|
|
2600
|
+
function renderParshaName(parsha, locale) {
|
|
2601
|
+
const locale0 = locale !== null && locale !== void 0 ? locale : Locale.getLocaleName();
|
|
2602
|
+
let name = Locale.gettext(parsha[0], locale0);
|
|
2603
|
+
if (parsha.length === 2) {
|
|
2604
|
+
const hyphen = locale0 === 'he' ? '־' : '-';
|
|
2605
|
+
name += hyphen + Locale.gettext(parsha[1], locale0);
|
|
2606
|
+
}
|
|
2607
|
+
name = name.replace(/'/g, '’');
|
|
2608
|
+
const str = Locale.gettext('Parashat', locale) + ' ' + name;
|
|
2609
|
+
return str.normalize();
|
|
2610
|
+
}
|
|
2611
|
+
|
|
2612
|
+
/*! @hebcal/core v5.7.7 */
|
|
2613
|
+
|
|
2614
|
+
/*
|
|
2615
|
+
Hebcal - A Jewish Calendar Generator
|
|
2616
|
+
Copyright (c) 1994-2020 Danny Sadinoff
|
|
2617
|
+
Portions copyright Eyal Schachter and Michael J. Radwin
|
|
2618
|
+
|
|
2619
|
+
https://github.com/hebcal/hebcal-es6
|
|
2620
|
+
|
|
2621
|
+
This program is free software; you can redistribute it and/or
|
|
2622
|
+
modify it under the terms of the GNU General Public License
|
|
2623
|
+
as published by the Free Software Foundation; either version 2
|
|
2624
|
+
of the License, or (at your option) any later version.
|
|
2625
|
+
|
|
2626
|
+
This program is distributed in the hope that it will be useful,
|
|
2627
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2628
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2629
|
+
GNU General Public License for more details.
|
|
2630
|
+
|
|
2631
|
+
You should have received a copy of the GNU General Public License
|
|
2632
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
2633
|
+
*/
|
|
2634
|
+
/*
|
|
2635
|
+
* Many of the following algorithms were taken from hebrew calendar
|
|
2636
|
+
* routines by Maimonedes, from his Mishneh Torah, and implemented by
|
|
2637
|
+
* Nachum Dershowitz Department of Computer Science
|
|
2638
|
+
* (217) 333-4219 University of Illinois at Urbana-Champaign
|
|
2639
|
+
* nachum@cs.uiuedu 1304 West Springfield Avenue
|
|
2640
|
+
* Urbana, Illinois 61801
|
|
2641
|
+
*
|
|
2642
|
+
* The routines were included in the emacs 19 distribution.
|
|
2643
|
+
*
|
|
2644
|
+
*/
|
|
2645
|
+
const INCOMPLETE = 0;
|
|
2646
|
+
const REGULAR = 1;
|
|
2647
|
+
const COMPLETE = 2;
|
|
2648
|
+
function yearType(hyear) {
|
|
2649
|
+
const longC = HDate.longCheshvan(hyear);
|
|
2650
|
+
const shortK = HDate.shortKislev(hyear);
|
|
2651
|
+
if (longC && !shortK) {
|
|
2652
|
+
return COMPLETE;
|
|
2653
|
+
}
|
|
2654
|
+
else if (!longC && shortK) {
|
|
2655
|
+
return INCOMPLETE;
|
|
2656
|
+
}
|
|
2657
|
+
else {
|
|
2658
|
+
return REGULAR;
|
|
2659
|
+
}
|
|
2660
|
+
}
|
|
2661
|
+
/**
|
|
2662
|
+
* Represents Parashah HaShavua for an entire Hebrew year
|
|
2663
|
+
*/
|
|
2664
|
+
class Sedra {
|
|
2665
|
+
/**
|
|
2666
|
+
* Caculates the Parashah HaShavua for an entire Hebrew year
|
|
2667
|
+
* @param hyear - Hebrew year (e.g. 5749)
|
|
2668
|
+
* @param il - Use Israel sedra schedule (false for Diaspora)
|
|
2669
|
+
*/
|
|
2670
|
+
constructor(hyear, il) {
|
|
2671
|
+
hyear = +hyear;
|
|
2672
|
+
this.year = hyear;
|
|
2673
|
+
const rh0 = new HDate(1, months.TISHREI, hyear);
|
|
2674
|
+
const rh = rh0.abs();
|
|
2675
|
+
const rhDay = rh0.getDay() + 1;
|
|
2676
|
+
// find the first Saturday on or after Rosh Hashana
|
|
2677
|
+
this.firstSaturday = HDate.dayOnOrBefore(6, rh + 6);
|
|
2678
|
+
const leap = +HDate.isLeapYear(hyear);
|
|
2679
|
+
this.il = Boolean(il);
|
|
2680
|
+
const type = yearType(hyear);
|
|
2681
|
+
let key = `${leap}${rhDay}${type}`;
|
|
2682
|
+
if (types[key]) {
|
|
2683
|
+
this.theSedraArray = types[key];
|
|
2684
|
+
}
|
|
2685
|
+
else {
|
|
2686
|
+
key = key + +this.il; // cast to num, then concat
|
|
2687
|
+
this.theSedraArray = types[key];
|
|
2688
|
+
}
|
|
2689
|
+
if (!this.theSedraArray) {
|
|
2690
|
+
throw new Error(`improper sedra year type ${key} calculated for ${hyear}`);
|
|
2691
|
+
}
|
|
2692
|
+
}
|
|
2693
|
+
/**
|
|
2694
|
+
* Returns the parsha (or parshiyot) read on Hebrew date
|
|
2695
|
+
* @deprecated Use {@link lookup} instead
|
|
2696
|
+
* @param hd Hebrew date or R.D. days
|
|
2697
|
+
*/
|
|
2698
|
+
get(hd) {
|
|
2699
|
+
return this.lookup(hd).parsha;
|
|
2700
|
+
}
|
|
2701
|
+
/**
|
|
2702
|
+
* Looks up parsha for the date, then returns a translated or transliterated string
|
|
2703
|
+
* @deprecated Use {@link lookup} instead
|
|
2704
|
+
* @param hd Hebrew date or R.D. days
|
|
2705
|
+
* @param [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale
|
|
2706
|
+
*/
|
|
2707
|
+
getString(hd, locale) {
|
|
2708
|
+
const parsha = this.get(hd);
|
|
2709
|
+
return renderParshaName(parsha, locale);
|
|
2710
|
+
}
|
|
2711
|
+
/**
|
|
2712
|
+
* Checks to see if this day would be a regular parasha HaShavua
|
|
2713
|
+
* Torah reading or special holiday reading
|
|
2714
|
+
* @deprecated Use {@link lookup} instead
|
|
2715
|
+
* @param hd Hebrew date or R.D. days
|
|
2716
|
+
*/
|
|
2717
|
+
isParsha(hd) {
|
|
2718
|
+
return !this.lookup(hd).chag;
|
|
2719
|
+
}
|
|
2720
|
+
/**
|
|
2721
|
+
* Returns the date that a parsha occurs
|
|
2722
|
+
* or `null` if the parsha doesn't occur this year
|
|
2723
|
+
* @param parsha if a `string`, specified with Sephardic transliterations
|
|
2724
|
+
* like `'Noach'` or `'Matot-Masei'`. If an array, must be a 1- or 2-element
|
|
2725
|
+
* array such as `['Noach']` or `['Matot', 'Masei']`. If a `number`, should
|
|
2726
|
+
* be a 0-based parsha index (`0` for Bereshit, `1` for Noach) or a negative
|
|
2727
|
+
* number for a doubled parsha (e.g. `-21` for Vayakhel-Pekudei)
|
|
2728
|
+
*/
|
|
2729
|
+
find(parsha) {
|
|
2730
|
+
if (typeof parsha === 'number') {
|
|
2731
|
+
if (parsha >= parshiot.length || (parsha < 0 && !isValidDouble(parsha))) {
|
|
2732
|
+
throw new RangeError(`Invalid parsha number: ${parsha}`);
|
|
2733
|
+
}
|
|
2734
|
+
return this.findInternal(parsha);
|
|
2735
|
+
}
|
|
2736
|
+
else if (typeof parsha === 'string') {
|
|
2737
|
+
const num = parsha2id$1.get(parsha);
|
|
2738
|
+
if (typeof num === 'number') {
|
|
2739
|
+
return this.find(num);
|
|
2740
|
+
}
|
|
2741
|
+
else if (parsha.indexOf('-') !== -1) {
|
|
2742
|
+
if (parsha === CHMPESACH || parsha === CHMSUKOT) {
|
|
2743
|
+
return this.findInternal(parsha);
|
|
2744
|
+
}
|
|
2745
|
+
return this.find(parsha.split('-'));
|
|
2746
|
+
}
|
|
2747
|
+
else {
|
|
2748
|
+
// try to find Saturday holiday like 'Yom Kippur'
|
|
2749
|
+
return this.findInternal(parsha);
|
|
2750
|
+
}
|
|
2751
|
+
}
|
|
2752
|
+
else if (Array.isArray(parsha)) {
|
|
2753
|
+
const plen = parsha.length;
|
|
2754
|
+
if ((plen !== 1 && plen !== 2) || typeof parsha[0] !== 'string') {
|
|
2755
|
+
throw new TypeError(`Invalid parsha argument: ${JSON.stringify(parsha)}`);
|
|
2756
|
+
}
|
|
2757
|
+
if (plen === 1) {
|
|
2758
|
+
return this.find(parsha[0]);
|
|
2759
|
+
}
|
|
2760
|
+
const p1 = parsha[0];
|
|
2761
|
+
const p2 = parsha[1];
|
|
2762
|
+
const num1 = parsha2id$1.get(p1);
|
|
2763
|
+
const num2 = parsha2id$1.get(p2);
|
|
2764
|
+
if (typeof num1 !== 'number' ||
|
|
2765
|
+
typeof num2 !== 'number' ||
|
|
2766
|
+
num2 !== num1 + 1 ||
|
|
2767
|
+
!isValidDouble(-num1)) {
|
|
2768
|
+
throw new RangeError(`Unrecognized parsha name: ${p1}-${p2}`);
|
|
2769
|
+
}
|
|
2770
|
+
return this.find(-num1);
|
|
2771
|
+
}
|
|
2772
|
+
return null; /* NOTREACHED */
|
|
2773
|
+
}
|
|
2774
|
+
findInternal(parsha) {
|
|
2775
|
+
const idx = this.theSedraArray.indexOf(parsha);
|
|
2776
|
+
if (idx === -1) {
|
|
2777
|
+
return null; // doesn't occur this year
|
|
2778
|
+
}
|
|
2779
|
+
return new HDate(this.firstSaturday + idx * 7);
|
|
2780
|
+
}
|
|
2781
|
+
/**
|
|
2782
|
+
* Returns the date that a parsha (or its doubled or undoubled counterpart)
|
|
2783
|
+
* occurs, or `null` if the parsha doesn't occur this year
|
|
2784
|
+
*/
|
|
2785
|
+
findContaining(parsha) {
|
|
2786
|
+
const hdate = this.find(parsha);
|
|
2787
|
+
if (hdate) {
|
|
2788
|
+
return hdate;
|
|
2789
|
+
}
|
|
2790
|
+
if (typeof parsha === 'number') {
|
|
2791
|
+
// a valid negative number (double parsha in a year where they are
|
|
2792
|
+
// combined) would've been found above, and a invalid negative number
|
|
2793
|
+
// would've thrown an error, so this parsha must be a positive number
|
|
2794
|
+
// representing either p1 or p2
|
|
2795
|
+
const p1 = -parsha;
|
|
2796
|
+
if (isValidDouble(p1)) {
|
|
2797
|
+
return this.find(p1);
|
|
2798
|
+
}
|
|
2799
|
+
else {
|
|
2800
|
+
// this must be the second individual parsha of a doubled pair
|
|
2801
|
+
// for example 29 for Kedoshim, so check for -28 for Achrei Mot-Kedoshim
|
|
2802
|
+
return this.find(p1 + 1);
|
|
2803
|
+
}
|
|
2804
|
+
}
|
|
2805
|
+
else {
|
|
2806
|
+
const num = parsha2id$1.get(parsha);
|
|
2807
|
+
if (num) {
|
|
2808
|
+
// parsha is either the first or second individual parsha of
|
|
2809
|
+
// a pair that is doubled this year
|
|
2810
|
+
const p1 = -num;
|
|
2811
|
+
if (isValidDouble(p1)) {
|
|
2812
|
+
return this.find(p1);
|
|
2813
|
+
}
|
|
2814
|
+
else {
|
|
2815
|
+
return this.find(p1 + 1);
|
|
2816
|
+
}
|
|
2817
|
+
}
|
|
2818
|
+
else {
|
|
2819
|
+
// this was indeed a doubled parsha, so return date of the first half
|
|
2820
|
+
const [p1] = parsha.split('-');
|
|
2821
|
+
return this.find(p1);
|
|
2822
|
+
}
|
|
2823
|
+
}
|
|
2824
|
+
}
|
|
2825
|
+
/**
|
|
2826
|
+
* Returns the underlying annual sedra schedule.
|
|
2827
|
+
* Used by `@hebcal/triennial`
|
|
2828
|
+
*/
|
|
2829
|
+
getSedraArray() {
|
|
2830
|
+
return this.theSedraArray;
|
|
2831
|
+
}
|
|
2832
|
+
/**
|
|
2833
|
+
* R.D. date of the first Saturday on or after Rosh Hashana
|
|
2834
|
+
*/
|
|
2835
|
+
getFirstSaturday() {
|
|
2836
|
+
return this.firstSaturday;
|
|
2837
|
+
}
|
|
2838
|
+
getYear() {
|
|
2839
|
+
return this.year;
|
|
2840
|
+
}
|
|
2841
|
+
/**
|
|
2842
|
+
* Returns an object describing the parsha on the first Saturday on or after `hd`
|
|
2843
|
+
* @param hd Hebrew date or R.D. days
|
|
2844
|
+
*/
|
|
2845
|
+
lookup(hd) {
|
|
2846
|
+
const abs = typeof hd === 'number' ? hd : HDate.isHDate(hd) ? hd.abs() : NaN;
|
|
2847
|
+
if (isNaN(abs)) {
|
|
2848
|
+
throw new TypeError(`Bad date argument: ${hd}`);
|
|
2849
|
+
}
|
|
2850
|
+
// find the first saturday on or after today's date
|
|
2851
|
+
const saturday = HDate.dayOnOrBefore(6, abs + 6);
|
|
2852
|
+
const weekNum = (saturday - this.firstSaturday) / 7;
|
|
2853
|
+
const index = this.theSedraArray[weekNum];
|
|
2854
|
+
if (typeof index === 'undefined') {
|
|
2855
|
+
const sedra = getSedra(this.year + 1, this.il);
|
|
2856
|
+
return sedra.lookup(saturday); // must be next year
|
|
2857
|
+
}
|
|
2858
|
+
const hdate = new HDate(saturday);
|
|
2859
|
+
if (typeof index === 'string') {
|
|
2860
|
+
// Shabbat has a chag. Return a description
|
|
2861
|
+
return { parsha: [index], chag: true, hdate };
|
|
2862
|
+
}
|
|
2863
|
+
if (index >= 0) {
|
|
2864
|
+
return { parsha: [parshiot[index]], chag: false, num: index + 1, hdate };
|
|
2865
|
+
}
|
|
2866
|
+
const p1 = D(index); // undouble the parsha
|
|
2867
|
+
return {
|
|
2868
|
+
parsha: [parshiot[p1], parshiot[p1 + 1]],
|
|
2869
|
+
chag: false,
|
|
2870
|
+
num: [p1 + 1, p1 + 2],
|
|
2871
|
+
hdate,
|
|
2872
|
+
};
|
|
2873
|
+
}
|
|
2874
|
+
}
|
|
2875
|
+
/**
|
|
2876
|
+
* The 54 parshiyot of the Torah as transilterated strings.
|
|
2877
|
+
* parshiot[0] == 'Bereshit', parshiot[1] == 'Noach', parshiot[52] == "Ha'azinu".
|
|
2878
|
+
* @readonly
|
|
2879
|
+
* @type {string[]}
|
|
2880
|
+
*/
|
|
2881
|
+
const parshiot = [
|
|
2882
|
+
'Bereshit',
|
|
2883
|
+
'Noach',
|
|
2884
|
+
'Lech-Lecha',
|
|
2885
|
+
'Vayera',
|
|
2886
|
+
'Chayei Sara',
|
|
2887
|
+
'Toldot',
|
|
2888
|
+
'Vayetzei',
|
|
2889
|
+
'Vayishlach',
|
|
2890
|
+
'Vayeshev',
|
|
2891
|
+
'Miketz',
|
|
2892
|
+
'Vayigash',
|
|
2893
|
+
'Vayechi',
|
|
2894
|
+
'Shemot',
|
|
2895
|
+
'Vaera',
|
|
2896
|
+
'Bo',
|
|
2897
|
+
'Beshalach',
|
|
2898
|
+
'Yitro',
|
|
2899
|
+
'Mishpatim',
|
|
2900
|
+
'Terumah',
|
|
2901
|
+
'Tetzaveh',
|
|
2902
|
+
'Ki Tisa',
|
|
2903
|
+
'Vayakhel',
|
|
2904
|
+
'Pekudei',
|
|
2905
|
+
'Vayikra',
|
|
2906
|
+
'Tzav',
|
|
2907
|
+
'Shmini',
|
|
2908
|
+
'Tazria',
|
|
2909
|
+
'Metzora',
|
|
2910
|
+
'Achrei Mot',
|
|
2911
|
+
'Kedoshim',
|
|
2912
|
+
'Emor',
|
|
2913
|
+
'Behar',
|
|
2914
|
+
'Bechukotai',
|
|
2915
|
+
'Bamidbar',
|
|
2916
|
+
'Nasso',
|
|
2917
|
+
"Beha'alotcha",
|
|
2918
|
+
"Sh'lach",
|
|
2919
|
+
'Korach',
|
|
2920
|
+
'Chukat',
|
|
2921
|
+
'Balak',
|
|
2922
|
+
'Pinchas',
|
|
2923
|
+
'Matot',
|
|
2924
|
+
'Masei',
|
|
2925
|
+
'Devarim',
|
|
2926
|
+
'Vaetchanan',
|
|
2927
|
+
'Eikev',
|
|
2928
|
+
"Re'eh",
|
|
2929
|
+
'Shoftim',
|
|
2930
|
+
'Ki Teitzei',
|
|
2931
|
+
'Ki Tavo',
|
|
2932
|
+
'Nitzavim',
|
|
2933
|
+
'Vayeilech',
|
|
2934
|
+
"Ha'azinu",
|
|
2935
|
+
];
|
|
2936
|
+
// 0-based parsha IDs
|
|
2937
|
+
const parsha2id$1 = new Map();
|
|
2938
|
+
for (let id = 0; id < parshiot.length; id++) {
|
|
2939
|
+
const name = parshiot[id];
|
|
2940
|
+
parsha2id$1.set(name, id);
|
|
2941
|
+
}
|
|
2942
|
+
// 0-based parsha IDs
|
|
2943
|
+
const doubles = [
|
|
2944
|
+
21, // Vayakhel-Pekudei
|
|
2945
|
+
26, // Tazria-Metzora
|
|
2946
|
+
28, // Achrei Mot-Kedoshim
|
|
2947
|
+
31, // Behar-Bechukotai
|
|
2948
|
+
38, // Chukat-Balak
|
|
2949
|
+
41, // Matot-Masei
|
|
2950
|
+
50, // Nitzavim-Vayeilech
|
|
2951
|
+
];
|
|
2952
|
+
/**
|
|
2953
|
+
* @private
|
|
2954
|
+
* @param id a negative number
|
|
2955
|
+
*/
|
|
2956
|
+
function isValidDouble(id) {
|
|
2957
|
+
return doubles.includes(-id);
|
|
2958
|
+
}
|
|
2959
|
+
/**
|
|
2960
|
+
* parsha doubler/undoubler
|
|
2961
|
+
* @private
|
|
2962
|
+
* @param p
|
|
2963
|
+
*/
|
|
2964
|
+
function D(p) {
|
|
2965
|
+
return -p;
|
|
2966
|
+
}
|
|
2967
|
+
const RH = 'Rosh Hashana'; // 0
|
|
2968
|
+
const YK = 'Yom Kippur'; // 1
|
|
2969
|
+
const SUKKOT = 'Sukkot'; // 0
|
|
2970
|
+
const CHMSUKOT = 'Sukkot Shabbat Chol ha-Moed'; // 0
|
|
2971
|
+
const SHMINI = 'Shmini Atzeret'; // 0
|
|
2972
|
+
const PESACH = 'Pesach'; // 25
|
|
2973
|
+
const PESACH1 = 'Pesach I';
|
|
2974
|
+
const CHMPESACH = 'Pesach Shabbat Chol ha-Moed'; // 25
|
|
2975
|
+
const PESACH7 = 'Pesach VII'; // 25
|
|
2976
|
+
const PESACH8 = 'Pesach VIII';
|
|
2977
|
+
const SHAVUOT$1 = 'Shavuot'; // 33
|
|
2978
|
+
/**
|
|
2979
|
+
* Returns an array from start to end
|
|
2980
|
+
* @private
|
|
2981
|
+
* @param start beginning number, inclusive
|
|
2982
|
+
* @param stop ending number, inclusive
|
|
2983
|
+
*/
|
|
2984
|
+
function range(start, stop) {
|
|
2985
|
+
return Array.from({ length: stop - start + 1 }, (v, k) => k + start);
|
|
2986
|
+
}
|
|
2987
|
+
const yearStartVayeilech = [51, 52, CHMSUKOT];
|
|
2988
|
+
const yearStartHaazinu = [52, YK, CHMSUKOT];
|
|
2989
|
+
const yearStartRH = [RH, 52, SUKKOT, SHMINI];
|
|
2990
|
+
const r020 = range(0, 20);
|
|
2991
|
+
const r027 = range(0, 27);
|
|
2992
|
+
const r3340 = range(33, 40);
|
|
2993
|
+
const r4349 = range(43, 49);
|
|
2994
|
+
const r4350 = range(43, 50);
|
|
2995
|
+
/**
|
|
2996
|
+
* The ordinary year types (keviot)
|
|
2997
|
+
* names are leap/nonleap - day - incomplete/regular/complete - diaspora/Israel
|
|
2998
|
+
* @private
|
|
2999
|
+
* @readonly
|
|
3000
|
+
*/
|
|
3001
|
+
const types = {
|
|
3002
|
+
/* Hebrew year that starts on Monday, is `incomplete' (Heshvan and
|
|
3003
|
+
* Kislev each have 29 days), and has Passover start on Tuesday. */
|
|
3004
|
+
// e.g. 5753
|
|
3005
|
+
'020': yearStartVayeilech.concat(r020, D(21), 23, 24, PESACH, 25, D(26), D(28), 30, D(31), r3340, D(41), r4349, D(50)),
|
|
3006
|
+
/* Hebrew year that starts on Monday, is `complete' (Heshvan and
|
|
3007
|
+
* Kislev each have 30 days), and has Passover start on Thursday. */
|
|
3008
|
+
// e.g. 5756
|
|
3009
|
+
'0220': yearStartVayeilech.concat(r020, D(21), 23, 24, PESACH, 25, D(26), D(28), 30, D(31), 33, SHAVUOT$1, range(34, 37), D(38), 40, D(41), r4349, D(50)),
|
|
3010
|
+
/* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29
|
|
3011
|
+
* days and Kislev has 30 days), and has Passover start on Saturday. */
|
|
3012
|
+
// e.g. 5701
|
|
3013
|
+
'0510': yearStartHaazinu.concat(r020, D(21), 23, 24, PESACH1, PESACH8, 25, D(26), D(28), 30, D(31), r3340, D(41), r4350),
|
|
3014
|
+
/* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29
|
|
3015
|
+
* days and Kislev has 30 days), and has Passover start on Saturday. */
|
|
3016
|
+
// e.g. 5745
|
|
3017
|
+
'0511': yearStartHaazinu.concat(r020, D(21), 23, 24, PESACH, 25, D(26), D(28), range(30, 40), D(41), r4350),
|
|
3018
|
+
/* Hebrew year that starts on Thursday, is `complete' (Heshvan and
|
|
3019
|
+
* Kislev each have 30 days), and has Passover start on Sunday. */
|
|
3020
|
+
// e.g. 5754
|
|
3021
|
+
'052': yearStartHaazinu.concat(range(0, 24), PESACH7, 25, D(26), D(28), 30, D(31), r3340, D(41), r4350),
|
|
3022
|
+
/* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and Kislev
|
|
3023
|
+
* each have 29 days), and has Passover start on Sunday. */
|
|
3024
|
+
// e.g. 5761
|
|
3025
|
+
'070': yearStartRH.concat(r020, D(21), 23, 24, PESACH7, 25, D(26), D(28), 30, D(31), r3340, D(41), r4350),
|
|
3026
|
+
/* Hebrew year that starts on Saturday, is `complete' (Heshvan and
|
|
3027
|
+
* Kislev each have 30 days), and has Passover start on Tuesday. */
|
|
3028
|
+
// e.g. 5716
|
|
3029
|
+
'072': yearStartRH.concat(r020, D(21), 23, 24, CHMPESACH, 25, D(26), D(28), 30, D(31), r3340, D(41), r4349, D(50)),
|
|
3030
|
+
/* -- The leap year types (keviot) -- */
|
|
3031
|
+
/* Hebrew year that starts on Monday, is `incomplete' (Heshvan and
|
|
3032
|
+
* Kislev each have 29 days), and has Passover start on Thursday. */
|
|
3033
|
+
// e.g. 5746
|
|
3034
|
+
'1200': yearStartVayeilech.concat(r027, CHMPESACH, range(28, 33), SHAVUOT$1, range(34, 37), D(38), 40, D(41), r4349, D(50)),
|
|
3035
|
+
/* Hebrew year that starts on Monday, is `incomplete' (Heshvan and
|
|
3036
|
+
* Kislev each have 29 days), and has Passover start on Thursday. */
|
|
3037
|
+
// e.g. 5746
|
|
3038
|
+
'1201': yearStartVayeilech.concat(r027, CHMPESACH, range(28, 40), D(41), r4349, D(50)),
|
|
3039
|
+
/* Hebrew year that starts on Monday, is `complete' (Heshvan and
|
|
3040
|
+
* Kislev each have 30 days), and has Passover start on Saturday. */
|
|
3041
|
+
// e.g.5752
|
|
3042
|
+
'1220': yearStartVayeilech.concat(r027, PESACH1, PESACH8, range(28, 40), D(41), r4350),
|
|
3043
|
+
/* Hebrew year that starts on Monday, is `complete' (Heshvan and
|
|
3044
|
+
* Kislev each have 30 days), and has Passover start on Saturday. */
|
|
3045
|
+
// e.g.5752
|
|
3046
|
+
'1221': yearStartVayeilech.concat(r027, PESACH, range(28, 50)),
|
|
3047
|
+
/* Hebrew year that starts on Thursday, is `incomplete' (Heshvan and
|
|
3048
|
+
* Kislev both have 29 days), and has Passover start on Sunday. */
|
|
3049
|
+
// e.g. 5768
|
|
3050
|
+
'150': yearStartHaazinu.concat(range(0, 28), PESACH7, range(29, 50)),
|
|
3051
|
+
/* Hebrew year that starts on Thursday, is `complete' (Heshvan and
|
|
3052
|
+
* Kislev both have 30 days), and has Passover start on Tuesday. */
|
|
3053
|
+
// eg. 5771
|
|
3054
|
+
'152': yearStartHaazinu.concat(range(0, 28), CHMPESACH, range(29, 49), D(50)),
|
|
3055
|
+
/* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and
|
|
3056
|
+
* Kislev each have 29 days), and has Passover start on Tuesday. */
|
|
3057
|
+
// e.g.5757
|
|
3058
|
+
'170': yearStartRH.concat(r027, CHMPESACH, range(28, 40), D(41), r4349, D(50)),
|
|
3059
|
+
/* Hebrew year that starts on Saturday, is `complete' (Heshvan and
|
|
3060
|
+
* Kislev each have 30 days), and has Passover start on Thursday. */
|
|
3061
|
+
'1720': yearStartRH.concat(r027, CHMPESACH, range(28, 33), SHAVUOT$1, range(34, 37), D(38), 40, D(41), r4349, D(50)),
|
|
3062
|
+
};
|
|
3063
|
+
/* Hebrew year that starts on Monday, is `complete' (Heshvan and
|
|
3064
|
+
* Kislev each have 30 days), and has Passover start on Thursday. */
|
|
3065
|
+
types['0221'] = types['020'];
|
|
3066
|
+
/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29
|
|
3067
|
+
* days and Kislev has 30 days), and has Passover start on Thursday. */
|
|
3068
|
+
// e.g. 5715
|
|
3069
|
+
types['0310'] = types['0220'];
|
|
3070
|
+
/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29
|
|
3071
|
+
* days and Kislev has 30 days), and has Passover start on Thursday. */
|
|
3072
|
+
types['0311'] = types['020'];
|
|
3073
|
+
/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29
|
|
3074
|
+
* days and Kislev has 30 days), and has Passover start on Saturday. */
|
|
3075
|
+
// e.g. 5715
|
|
3076
|
+
types['1310'] = types['1220'];
|
|
3077
|
+
/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29
|
|
3078
|
+
* days and Kislev has 30 days), and has Passover start on Saturday. */
|
|
3079
|
+
types['1311'] = types['1221'];
|
|
3080
|
+
/* Hebrew year that starts on Saturday, is `complete' (Heshvan and
|
|
3081
|
+
* Kislev each have 30 days), and has Passover start on Thursday. */
|
|
3082
|
+
types['1721'] = types['170'];
|
|
3083
|
+
const sedraCache = new QuickLRU({ maxSize: 400 });
|
|
3084
|
+
/**
|
|
3085
|
+
* Convenience function to create an instance of `Sedra` or reuse a previously
|
|
3086
|
+
* created and cached instance.
|
|
3087
|
+
* @param hyear
|
|
3088
|
+
* @param il
|
|
3089
|
+
*/
|
|
3090
|
+
function getSedra(hyear, il) {
|
|
3091
|
+
const cacheKey = `${hyear}-${il ? 1 : 0}`;
|
|
3092
|
+
let sedra = sedraCache.get(cacheKey);
|
|
3093
|
+
if (!sedra) {
|
|
3094
|
+
sedra = new Sedra(hyear, il);
|
|
3095
|
+
sedraCache.set(cacheKey, sedra);
|
|
3096
|
+
}
|
|
3097
|
+
return sedra;
|
|
3098
|
+
}
|
|
3099
|
+
|
|
3100
|
+
/*! @hebcal/core v5.7.7 */
|
|
3101
|
+
|
|
3102
|
+
const Nisan = months.NISAN;
|
|
3103
|
+
const Iyyar = months.IYYAR;
|
|
3104
|
+
const Sivan = months.SIVAN;
|
|
3105
|
+
const Tamuz = months.TAMUZ;
|
|
3106
|
+
const Av = months.AV;
|
|
3107
|
+
const Elul = months.ELUL;
|
|
3108
|
+
const Tishrei = months.TISHREI;
|
|
3109
|
+
const Cheshvan = months.CHESHVAN;
|
|
3110
|
+
const Kislev = months.KISLEV;
|
|
3111
|
+
const Shvat = months.SHVAT;
|
|
3112
|
+
const Adar2 = months.ADAR_II;
|
|
3113
|
+
const CHAG$1 = flags.CHAG;
|
|
3114
|
+
const LIGHT_CANDLES = flags.LIGHT_CANDLES;
|
|
3115
|
+
const YOM_TOV_ENDS = flags.YOM_TOV_ENDS;
|
|
3116
|
+
const CHUL_ONLY = flags.CHUL_ONLY;
|
|
3117
|
+
const IL_ONLY$1 = flags.IL_ONLY;
|
|
3118
|
+
const LIGHT_CANDLES_TZEIS$1 = flags.LIGHT_CANDLES_TZEIS;
|
|
3119
|
+
const CHANUKAH_CANDLES$1 = flags.CHANUKAH_CANDLES;
|
|
3120
|
+
const MAJOR_FAST$1 = flags.MAJOR_FAST;
|
|
3121
|
+
const MINOR_HOLIDAY$1 = flags.MINOR_HOLIDAY;
|
|
3122
|
+
const EREV$1 = flags.EREV;
|
|
3123
|
+
const CHOL_HAMOED = flags.CHOL_HAMOED;
|
|
3124
|
+
const emojiPesach = '🫓';
|
|
3125
|
+
const emojiSukkot = '🌿🍋';
|
|
3126
|
+
const ROSH_HASHANA_II = 'Rosh Hashana II';
|
|
3127
|
+
const EREV_YOM_KIPPUR = 'Erev Yom Kippur';
|
|
3128
|
+
const YOM_KIPPUR = 'Yom Kippur';
|
|
3129
|
+
const EREV_SUKKOT = 'Erev Sukkot';
|
|
3130
|
+
const SUKKOT_I = 'Sukkot I';
|
|
3131
|
+
const SUKKOT_II = 'Sukkot II';
|
|
3132
|
+
const SUKKOT_III_CHM = "Sukkot III (CH''M)";
|
|
3133
|
+
const SUKKOT_IV_CHM = "Sukkot IV (CH''M)";
|
|
3134
|
+
const SUKKOT_V_CHM = "Sukkot V (CH''M)";
|
|
3135
|
+
const SUKKOT_VI_CHM = "Sukkot VI (CH''M)";
|
|
3136
|
+
const SHMINI_ATZERET = 'Shmini Atzeret';
|
|
3137
|
+
const SIMCHAT_TORAH = 'Simchat Torah';
|
|
3138
|
+
const SUKKOT_II_CHM = "Sukkot II (CH''M)";
|
|
3139
|
+
const SUKKOT_VII_HOSHANA_RABA = 'Sukkot VII (Hoshana Raba)';
|
|
3140
|
+
const CHANUKAH_1_CANDLE = 'Chanukah: 1 Candle';
|
|
3141
|
+
const TU_BISHVAT = 'Tu BiShvat';
|
|
3142
|
+
const EREV_PURIM = 'Erev Purim';
|
|
3143
|
+
const PURIM = 'Purim';
|
|
3144
|
+
const SHUSHAN_PURIM = 'Shushan Purim';
|
|
3145
|
+
const EREV_PESACH = 'Erev Pesach';
|
|
3146
|
+
const PESACH_I = 'Pesach I';
|
|
3147
|
+
const PESACH_II = 'Pesach II';
|
|
3148
|
+
const PESACH_II_CHM = "Pesach II (CH''M)";
|
|
3149
|
+
const PESACH_III_CHM = "Pesach III (CH''M)";
|
|
3150
|
+
const PESACH_IV_CHM = "Pesach IV (CH''M)";
|
|
3151
|
+
const PESACH_V_CHM = "Pesach V (CH''M)";
|
|
3152
|
+
const PESACH_VI_CHM = "Pesach VI (CH''M)";
|
|
3153
|
+
const PESACH_VII = 'Pesach VII';
|
|
3154
|
+
const PESACH_VIII = 'Pesach VIII';
|
|
3155
|
+
const PESACH_SHENI = 'Pesach Sheni';
|
|
3156
|
+
const LAG_BAOMER = 'Lag BaOmer';
|
|
3157
|
+
const EREV_SHAVUOT = 'Erev Shavuot';
|
|
3158
|
+
const SHAVUOT = 'Shavuot';
|
|
3159
|
+
const SHAVUOT_I = 'Shavuot I';
|
|
3160
|
+
const SHAVUOT_II = 'Shavuot II';
|
|
3161
|
+
const TU_BAV = "Tu B'Av";
|
|
3162
|
+
const ROSH_HASHANA_LABEHEMOT = 'Rosh Hashana LaBehemot';
|
|
3163
|
+
const EREV_ROSH_HASHANA = 'Erev Rosh Hashana';
|
|
3164
|
+
const YOM_YERUSHALAYIM = 'Yom Yerushalayim';
|
|
3165
|
+
const BEN_GURION_DAY = 'Ben-Gurion Day';
|
|
3166
|
+
const FAMILY_DAY = 'Family Day';
|
|
3167
|
+
const YITZHAK_RABIN_MEMORIAL_DAY = 'Yitzhak Rabin Memorial Day';
|
|
3168
|
+
const HERZL_DAY = 'Herzl Day';
|
|
3169
|
+
const JABOTINSKY_DAY = 'Jabotinsky Day';
|
|
3170
|
+
const SIGD = 'Sigd';
|
|
3171
|
+
const YOM_HAALIYAH = 'Yom HaAliyah';
|
|
3172
|
+
const YOM_HAALIYAH_SCHOOL_OBSERVANCE = 'Yom HaAliyah School Observance';
|
|
3173
|
+
const HEBREW_LANGUAGE_DAY = 'Hebrew Language Day';
|
|
3174
|
+
/**
|
|
3175
|
+
* Transliterated names of holidays, used by `Event.getDesc()`
|
|
3176
|
+
* @readonly
|
|
3177
|
+
* @enum {string}
|
|
3178
|
+
*/
|
|
3179
|
+
const holidayDesc = {
|
|
3180
|
+
/** Asara B'Tevet */
|
|
3181
|
+
ASARA_BTEVET: "Asara B'Tevet",
|
|
3182
|
+
/** Birkat Hachamah */
|
|
3183
|
+
BIRKAT_HACHAMAH: 'Birkat Hachamah',
|
|
3184
|
+
/** Chag HaBanot */
|
|
3185
|
+
CHAG_HABANOT: 'Chag HaBanot',
|
|
3186
|
+
/** Chanukah: 8th Day */
|
|
3187
|
+
CHANUKAH_8TH_DAY: 'Chanukah: 8th Day',
|
|
3188
|
+
/** Erev Tish'a B'Av */
|
|
3189
|
+
EREV_TISHA_BAV: "Erev Tish'a B'Av",
|
|
3190
|
+
/** Leil Selichot */
|
|
3191
|
+
LEIL_SELICHOT: 'Leil Selichot',
|
|
3192
|
+
/** Purim Katan */
|
|
3193
|
+
PURIM_KATAN: 'Purim Katan',
|
|
3194
|
+
/** Purim Meshulash */
|
|
3195
|
+
PURIM_MESHULASH: 'Purim Meshulash',
|
|
3196
|
+
/** Shabbat Chazon */
|
|
3197
|
+
SHABBAT_CHAZON: 'Shabbat Chazon',
|
|
3198
|
+
/** Shabbat HaChodesh */
|
|
3199
|
+
SHABBAT_HACHODESH: 'Shabbat HaChodesh',
|
|
3200
|
+
/** Shabbat HaGadol */
|
|
3201
|
+
SHABBAT_HAGADOL: 'Shabbat HaGadol',
|
|
3202
|
+
/** Shabbat Nachamu */
|
|
3203
|
+
SHABBAT_NACHAMU: 'Shabbat Nachamu',
|
|
3204
|
+
/** Shabbat Parah */
|
|
3205
|
+
SHABBAT_PARAH: 'Shabbat Parah',
|
|
3206
|
+
/** Shabbat Shekalim */
|
|
3207
|
+
SHABBAT_SHEKALIM: 'Shabbat Shekalim',
|
|
3208
|
+
/** Shabbat Shirah */
|
|
3209
|
+
SHABBAT_SHIRAH: 'Shabbat Shirah',
|
|
3210
|
+
/** Shabbat Shuva */
|
|
3211
|
+
SHABBAT_SHUVA: 'Shabbat Shuva',
|
|
3212
|
+
/** Shabbat Zachor */
|
|
3213
|
+
SHABBAT_ZACHOR: 'Shabbat Zachor',
|
|
3214
|
+
/** Shushan Purim Katan */
|
|
3215
|
+
SHUSHAN_PURIM_KATAN: 'Shushan Purim Katan',
|
|
3216
|
+
/** Ta'anit Bechorot */
|
|
3217
|
+
TAANIT_BECHOROT: "Ta'anit Bechorot",
|
|
3218
|
+
/** Ta'anit Esther */
|
|
3219
|
+
TAANIT_ESTHER: "Ta'anit Esther",
|
|
3220
|
+
/** Tish'a B'Av */
|
|
3221
|
+
TISHA_BAV: "Tish'a B'Av",
|
|
3222
|
+
/** Tzom Gedaliah */
|
|
3223
|
+
TZOM_GEDALIAH: 'Tzom Gedaliah',
|
|
3224
|
+
/** Tzom Tammuz */
|
|
3225
|
+
TZOM_TAMMUZ: 'Tzom Tammuz',
|
|
3226
|
+
/** Yom HaAtzma'ut */
|
|
3227
|
+
YOM_HAATZMA_UT: "Yom HaAtzma'ut",
|
|
3228
|
+
/** Yom HaShoah */
|
|
3229
|
+
YOM_HASHOAH: 'Yom HaShoah',
|
|
3230
|
+
/** Yom HaZikaron */
|
|
3231
|
+
YOM_HAZIKARON: 'Yom HaZikaron',
|
|
3232
|
+
/** Ben-Gurion Day */
|
|
3233
|
+
BEN_GURION_DAY,
|
|
3234
|
+
/** Chanukah: 1 Candle */
|
|
3235
|
+
CHANUKAH_1_CANDLE,
|
|
3236
|
+
/** Erev Pesach */
|
|
3237
|
+
EREV_PESACH,
|
|
3238
|
+
/** Erev Purim */
|
|
3239
|
+
EREV_PURIM,
|
|
3240
|
+
/** Erev Rosh Hashana */
|
|
3241
|
+
EREV_ROSH_HASHANA,
|
|
3242
|
+
/** Erev Shavuot */
|
|
3243
|
+
EREV_SHAVUOT,
|
|
3244
|
+
/** Erev Sukkot */
|
|
3245
|
+
EREV_SUKKOT,
|
|
3246
|
+
/** Erev Yom Kippur */
|
|
3247
|
+
EREV_YOM_KIPPUR,
|
|
3248
|
+
/** Family Day */
|
|
3249
|
+
FAMILY_DAY,
|
|
3250
|
+
/** Hebrew Language Day */
|
|
3251
|
+
HEBREW_LANGUAGE_DAY,
|
|
3252
|
+
/** Herzl Day */
|
|
3253
|
+
HERZL_DAY,
|
|
3254
|
+
/** Jabotinsky Day */
|
|
3255
|
+
JABOTINSKY_DAY,
|
|
3256
|
+
/** Lag BaOmer */
|
|
3257
|
+
LAG_BAOMER,
|
|
3258
|
+
/** Pesach I */
|
|
3259
|
+
PESACH_I,
|
|
3260
|
+
/** Pesach II */
|
|
3261
|
+
PESACH_II,
|
|
3262
|
+
/** Pesach III (CH''M) */
|
|
3263
|
+
PESACH_III_CHM,
|
|
3264
|
+
/** Pesach II (CH''M) */
|
|
3265
|
+
PESACH_II_CHM,
|
|
3266
|
+
/** Pesach IV (CH''M) */
|
|
3267
|
+
PESACH_IV_CHM,
|
|
3268
|
+
/** Pesach Sheni */
|
|
3269
|
+
PESACH_SHENI,
|
|
3270
|
+
/** Pesach VII */
|
|
3271
|
+
PESACH_VII,
|
|
3272
|
+
/** Pesach VIII */
|
|
3273
|
+
PESACH_VIII,
|
|
3274
|
+
/** Pesach VI (CH''M) */
|
|
3275
|
+
PESACH_VI_CHM,
|
|
3276
|
+
/** Pesach V (CH''M) */
|
|
3277
|
+
PESACH_V_CHM,
|
|
3278
|
+
/** Purim */
|
|
3279
|
+
PURIM,
|
|
3280
|
+
/** Rosh Hashana II */
|
|
3281
|
+
ROSH_HASHANA_II,
|
|
3282
|
+
/** Rosh Hashana LaBehemot */
|
|
3283
|
+
ROSH_HASHANA_LABEHEMOT,
|
|
3284
|
+
/** Shavuot */
|
|
3285
|
+
SHAVUOT,
|
|
3286
|
+
/** Shavuot I */
|
|
3287
|
+
SHAVUOT_I,
|
|
3288
|
+
/** Shavuot II */
|
|
3289
|
+
SHAVUOT_II,
|
|
3290
|
+
/** Shmini Atzeret */
|
|
3291
|
+
SHMINI_ATZERET,
|
|
3292
|
+
/** Shushan Purim */
|
|
3293
|
+
SHUSHAN_PURIM,
|
|
3294
|
+
/** Sigd */
|
|
3295
|
+
SIGD,
|
|
3296
|
+
/** Simchat Torah */
|
|
3297
|
+
SIMCHAT_TORAH,
|
|
3298
|
+
/** Sukkot I */
|
|
3299
|
+
SUKKOT_I,
|
|
3300
|
+
/** Sukkot II */
|
|
3301
|
+
SUKKOT_II,
|
|
3302
|
+
/** Sukkot III (CH''M) */
|
|
3303
|
+
SUKKOT_III_CHM,
|
|
3304
|
+
/** Sukkot II (CH''M) */
|
|
3305
|
+
SUKKOT_II_CHM,
|
|
3306
|
+
/** Sukkot IV (CH''M) */
|
|
3307
|
+
SUKKOT_IV_CHM,
|
|
3308
|
+
/** Sukkot VII (Hoshana Raba) */
|
|
3309
|
+
SUKKOT_VII_HOSHANA_RABA,
|
|
3310
|
+
/** Sukkot VI (CH''M) */
|
|
3311
|
+
SUKKOT_VI_CHM,
|
|
3312
|
+
/** Sukkot V (CH''M) */
|
|
3313
|
+
SUKKOT_V_CHM,
|
|
3314
|
+
/** Tu B\'Av */
|
|
3315
|
+
TU_BAV,
|
|
3316
|
+
/** Tu BiShvat */
|
|
3317
|
+
TU_BISHVAT,
|
|
3318
|
+
/** Yitzhak Rabin Memorial Day */
|
|
3319
|
+
YITZHAK_RABIN_MEMORIAL_DAY,
|
|
3320
|
+
/** Yom HaAliyah */
|
|
3321
|
+
YOM_HAALIYAH,
|
|
3322
|
+
/** Yom HaAliyah School Observance */
|
|
3323
|
+
YOM_HAALIYAH_SCHOOL_OBSERVANCE,
|
|
3324
|
+
/** Yom Kippur */
|
|
3325
|
+
YOM_KIPPUR,
|
|
3326
|
+
/** Yom Yerushalayim */
|
|
3327
|
+
YOM_YERUSHALAYIM,
|
|
3328
|
+
};
|
|
3329
|
+
const staticHolidays = [
|
|
3330
|
+
{
|
|
3331
|
+
mm: Tishrei,
|
|
3332
|
+
dd: 2,
|
|
3333
|
+
desc: ROSH_HASHANA_II,
|
|
3334
|
+
flags: CHAG$1 | YOM_TOV_ENDS,
|
|
3335
|
+
emoji: '🍏🍯',
|
|
3336
|
+
},
|
|
3337
|
+
{ mm: Tishrei, dd: 9, desc: EREV_YOM_KIPPUR, flags: EREV$1 | LIGHT_CANDLES },
|
|
3338
|
+
{
|
|
3339
|
+
mm: Tishrei,
|
|
3340
|
+
dd: 10,
|
|
3341
|
+
desc: YOM_KIPPUR,
|
|
3342
|
+
flags: CHAG$1 | MAJOR_FAST$1 | YOM_TOV_ENDS,
|
|
3343
|
+
},
|
|
3344
|
+
{
|
|
3345
|
+
mm: Tishrei,
|
|
3346
|
+
dd: 14,
|
|
3347
|
+
desc: EREV_SUKKOT,
|
|
3348
|
+
flags: CHUL_ONLY | EREV$1 | LIGHT_CANDLES,
|
|
3349
|
+
emoji: emojiSukkot,
|
|
3350
|
+
},
|
|
3351
|
+
{
|
|
3352
|
+
mm: Tishrei,
|
|
3353
|
+
dd: 15,
|
|
3354
|
+
desc: SUKKOT_I,
|
|
3355
|
+
flags: CHUL_ONLY | CHAG$1 | LIGHT_CANDLES_TZEIS$1,
|
|
3356
|
+
emoji: emojiSukkot,
|
|
3357
|
+
},
|
|
3358
|
+
{
|
|
3359
|
+
mm: Tishrei,
|
|
3360
|
+
dd: 16,
|
|
3361
|
+
desc: SUKKOT_II,
|
|
3362
|
+
flags: CHUL_ONLY | CHAG$1 | YOM_TOV_ENDS,
|
|
3363
|
+
emoji: emojiSukkot,
|
|
3364
|
+
},
|
|
3365
|
+
{
|
|
3366
|
+
mm: Tishrei,
|
|
3367
|
+
dd: 17,
|
|
3368
|
+
desc: SUKKOT_III_CHM,
|
|
3369
|
+
flags: CHUL_ONLY | CHOL_HAMOED,
|
|
3370
|
+
chmDay: 1,
|
|
3371
|
+
emoji: emojiSukkot,
|
|
3372
|
+
},
|
|
3373
|
+
{
|
|
3374
|
+
mm: Tishrei,
|
|
3375
|
+
dd: 18,
|
|
3376
|
+
desc: SUKKOT_IV_CHM,
|
|
3377
|
+
flags: CHUL_ONLY | CHOL_HAMOED,
|
|
3378
|
+
chmDay: 2,
|
|
3379
|
+
emoji: emojiSukkot,
|
|
3380
|
+
},
|
|
3381
|
+
{
|
|
3382
|
+
mm: Tishrei,
|
|
3383
|
+
dd: 19,
|
|
3384
|
+
desc: SUKKOT_V_CHM,
|
|
3385
|
+
flags: CHUL_ONLY | CHOL_HAMOED,
|
|
3386
|
+
chmDay: 3,
|
|
3387
|
+
emoji: emojiSukkot,
|
|
3388
|
+
},
|
|
3389
|
+
{
|
|
3390
|
+
mm: Tishrei,
|
|
3391
|
+
dd: 20,
|
|
3392
|
+
desc: SUKKOT_VI_CHM,
|
|
3393
|
+
flags: CHUL_ONLY | CHOL_HAMOED,
|
|
3394
|
+
chmDay: 4,
|
|
3395
|
+
emoji: emojiSukkot,
|
|
3396
|
+
},
|
|
3397
|
+
{
|
|
3398
|
+
mm: Tishrei,
|
|
3399
|
+
dd: 22,
|
|
3400
|
+
desc: SHMINI_ATZERET,
|
|
3401
|
+
flags: CHUL_ONLY | CHAG$1 | LIGHT_CANDLES_TZEIS$1,
|
|
3402
|
+
},
|
|
3403
|
+
{
|
|
3404
|
+
mm: Tishrei,
|
|
3405
|
+
dd: 23,
|
|
3406
|
+
desc: SIMCHAT_TORAH,
|
|
3407
|
+
flags: CHUL_ONLY | CHAG$1 | YOM_TOV_ENDS,
|
|
3408
|
+
},
|
|
3409
|
+
{
|
|
3410
|
+
mm: Tishrei,
|
|
3411
|
+
dd: 14,
|
|
3412
|
+
desc: EREV_SUKKOT,
|
|
3413
|
+
flags: IL_ONLY$1 | EREV$1 | LIGHT_CANDLES,
|
|
3414
|
+
emoji: emojiSukkot,
|
|
3415
|
+
},
|
|
3416
|
+
{
|
|
3417
|
+
mm: Tishrei,
|
|
3418
|
+
dd: 15,
|
|
3419
|
+
desc: SUKKOT_I,
|
|
3420
|
+
flags: IL_ONLY$1 | CHAG$1 | YOM_TOV_ENDS,
|
|
3421
|
+
emoji: emojiSukkot,
|
|
3422
|
+
},
|
|
3423
|
+
{
|
|
3424
|
+
mm: Tishrei,
|
|
3425
|
+
dd: 16,
|
|
3426
|
+
desc: SUKKOT_II_CHM,
|
|
3427
|
+
flags: IL_ONLY$1 | CHOL_HAMOED,
|
|
3428
|
+
chmDay: 1,
|
|
3429
|
+
emoji: emojiSukkot,
|
|
3430
|
+
},
|
|
3431
|
+
{
|
|
3432
|
+
mm: Tishrei,
|
|
3433
|
+
dd: 17,
|
|
3434
|
+
desc: SUKKOT_III_CHM,
|
|
3435
|
+
flags: IL_ONLY$1 | CHOL_HAMOED,
|
|
3436
|
+
chmDay: 2,
|
|
3437
|
+
emoji: emojiSukkot,
|
|
3438
|
+
},
|
|
3439
|
+
{
|
|
3440
|
+
mm: Tishrei,
|
|
3441
|
+
dd: 18,
|
|
3442
|
+
desc: SUKKOT_IV_CHM,
|
|
3443
|
+
flags: IL_ONLY$1 | CHOL_HAMOED,
|
|
3444
|
+
chmDay: 3,
|
|
3445
|
+
emoji: emojiSukkot,
|
|
3446
|
+
},
|
|
3447
|
+
{
|
|
3448
|
+
mm: Tishrei,
|
|
3449
|
+
dd: 19,
|
|
3450
|
+
desc: SUKKOT_V_CHM,
|
|
3451
|
+
flags: IL_ONLY$1 | CHOL_HAMOED,
|
|
3452
|
+
chmDay: 4,
|
|
3453
|
+
emoji: emojiSukkot,
|
|
3454
|
+
},
|
|
3455
|
+
{
|
|
3456
|
+
mm: Tishrei,
|
|
3457
|
+
dd: 20,
|
|
3458
|
+
desc: SUKKOT_VI_CHM,
|
|
3459
|
+
flags: IL_ONLY$1 | CHOL_HAMOED,
|
|
3460
|
+
chmDay: 5,
|
|
3461
|
+
emoji: emojiSukkot,
|
|
3462
|
+
},
|
|
3463
|
+
{
|
|
3464
|
+
mm: Tishrei,
|
|
3465
|
+
dd: 22,
|
|
3466
|
+
desc: SHMINI_ATZERET,
|
|
3467
|
+
flags: IL_ONLY$1 | CHAG$1 | YOM_TOV_ENDS,
|
|
3468
|
+
},
|
|
3469
|
+
{
|
|
3470
|
+
mm: Tishrei,
|
|
3471
|
+
dd: 21,
|
|
3472
|
+
desc: SUKKOT_VII_HOSHANA_RABA,
|
|
3473
|
+
flags: LIGHT_CANDLES | CHOL_HAMOED,
|
|
3474
|
+
chmDay: -1,
|
|
3475
|
+
emoji: emojiSukkot,
|
|
3476
|
+
},
|
|
3477
|
+
{
|
|
3478
|
+
mm: Kislev,
|
|
3479
|
+
dd: 24,
|
|
3480
|
+
desc: CHANUKAH_1_CANDLE,
|
|
3481
|
+
flags: EREV$1 | MINOR_HOLIDAY$1 | CHANUKAH_CANDLES$1,
|
|
3482
|
+
emoji: '🕎1️⃣',
|
|
3483
|
+
},
|
|
3484
|
+
{ mm: Shvat, dd: 15, desc: TU_BISHVAT, flags: MINOR_HOLIDAY$1, emoji: '🌳' },
|
|
3485
|
+
{
|
|
3486
|
+
mm: Adar2,
|
|
3487
|
+
dd: 13,
|
|
3488
|
+
desc: EREV_PURIM,
|
|
3489
|
+
flags: EREV$1 | MINOR_HOLIDAY$1,
|
|
3490
|
+
emoji: '🎭️📜',
|
|
3491
|
+
},
|
|
3492
|
+
{ mm: Adar2, dd: 14, desc: PURIM, flags: MINOR_HOLIDAY$1, emoji: '🎭️📜' },
|
|
3493
|
+
{
|
|
3494
|
+
mm: Adar2,
|
|
3495
|
+
dd: 15,
|
|
3496
|
+
desc: SHUSHAN_PURIM,
|
|
3497
|
+
flags: MINOR_HOLIDAY$1,
|
|
3498
|
+
emoji: '🎭️📜',
|
|
3499
|
+
},
|
|
3500
|
+
// Pesach Israel
|
|
3501
|
+
{
|
|
3502
|
+
mm: Nisan,
|
|
3503
|
+
dd: 14,
|
|
3504
|
+
desc: EREV_PESACH,
|
|
3505
|
+
flags: IL_ONLY$1 | EREV$1 | LIGHT_CANDLES,
|
|
3506
|
+
emoji: '🫓🍷',
|
|
3507
|
+
},
|
|
3508
|
+
{
|
|
3509
|
+
mm: Nisan,
|
|
3510
|
+
dd: 15,
|
|
3511
|
+
desc: PESACH_I,
|
|
3512
|
+
flags: IL_ONLY$1 | CHAG$1 | YOM_TOV_ENDS,
|
|
3513
|
+
emoji: emojiPesach,
|
|
3514
|
+
},
|
|
3515
|
+
{
|
|
3516
|
+
mm: Nisan,
|
|
3517
|
+
dd: 16,
|
|
3518
|
+
desc: PESACH_II_CHM,
|
|
3519
|
+
flags: IL_ONLY$1 | CHOL_HAMOED,
|
|
3520
|
+
chmDay: 1,
|
|
3521
|
+
emoji: emojiPesach,
|
|
3522
|
+
},
|
|
3523
|
+
{
|
|
3524
|
+
mm: Nisan,
|
|
3525
|
+
dd: 17,
|
|
3526
|
+
desc: PESACH_III_CHM,
|
|
3527
|
+
flags: IL_ONLY$1 | CHOL_HAMOED,
|
|
3528
|
+
chmDay: 2,
|
|
3529
|
+
emoji: emojiPesach,
|
|
3530
|
+
},
|
|
3531
|
+
{
|
|
3532
|
+
mm: Nisan,
|
|
3533
|
+
dd: 18,
|
|
3534
|
+
desc: PESACH_IV_CHM,
|
|
3535
|
+
flags: IL_ONLY$1 | CHOL_HAMOED,
|
|
3536
|
+
chmDay: 3,
|
|
3537
|
+
emoji: emojiPesach,
|
|
3538
|
+
},
|
|
3539
|
+
{
|
|
3540
|
+
mm: Nisan,
|
|
3541
|
+
dd: 19,
|
|
3542
|
+
desc: PESACH_V_CHM,
|
|
3543
|
+
flags: IL_ONLY$1 | CHOL_HAMOED,
|
|
3544
|
+
chmDay: 4,
|
|
3545
|
+
emoji: emojiPesach,
|
|
3546
|
+
},
|
|
3547
|
+
{
|
|
3548
|
+
mm: Nisan,
|
|
3549
|
+
dd: 20,
|
|
3550
|
+
desc: PESACH_VI_CHM,
|
|
3551
|
+
flags: IL_ONLY$1 | CHOL_HAMOED | LIGHT_CANDLES,
|
|
3552
|
+
chmDay: 5,
|
|
3553
|
+
emoji: emojiPesach,
|
|
3554
|
+
},
|
|
3555
|
+
{
|
|
3556
|
+
mm: Nisan,
|
|
3557
|
+
dd: 21,
|
|
3558
|
+
desc: PESACH_VII,
|
|
3559
|
+
flags: IL_ONLY$1 | CHAG$1 | YOM_TOV_ENDS,
|
|
3560
|
+
emoji: emojiPesach,
|
|
3561
|
+
},
|
|
3562
|
+
// Pesach chutz l'aretz
|
|
3563
|
+
{
|
|
3564
|
+
mm: Nisan,
|
|
3565
|
+
dd: 14,
|
|
3566
|
+
desc: EREV_PESACH,
|
|
3567
|
+
flags: CHUL_ONLY | EREV$1 | LIGHT_CANDLES,
|
|
3568
|
+
emoji: '🫓🍷',
|
|
3569
|
+
},
|
|
3570
|
+
{
|
|
3571
|
+
mm: Nisan,
|
|
3572
|
+
dd: 15,
|
|
3573
|
+
desc: PESACH_I,
|
|
3574
|
+
flags: CHUL_ONLY | CHAG$1 | LIGHT_CANDLES_TZEIS$1,
|
|
3575
|
+
emoji: '🫓🍷',
|
|
3576
|
+
},
|
|
3577
|
+
{
|
|
3578
|
+
mm: Nisan,
|
|
3579
|
+
dd: 16,
|
|
3580
|
+
desc: PESACH_II,
|
|
3581
|
+
flags: CHUL_ONLY | CHAG$1 | YOM_TOV_ENDS,
|
|
3582
|
+
emoji: emojiPesach,
|
|
3583
|
+
},
|
|
3584
|
+
{
|
|
3585
|
+
mm: Nisan,
|
|
3586
|
+
dd: 17,
|
|
3587
|
+
desc: PESACH_III_CHM,
|
|
3588
|
+
flags: CHUL_ONLY | CHOL_HAMOED,
|
|
3589
|
+
chmDay: 1,
|
|
3590
|
+
emoji: emojiPesach,
|
|
3591
|
+
},
|
|
3592
|
+
{
|
|
3593
|
+
mm: Nisan,
|
|
3594
|
+
dd: 18,
|
|
3595
|
+
desc: PESACH_IV_CHM,
|
|
3596
|
+
flags: CHUL_ONLY | CHOL_HAMOED,
|
|
3597
|
+
chmDay: 2,
|
|
3598
|
+
emoji: emojiPesach,
|
|
3599
|
+
},
|
|
3600
|
+
{
|
|
3601
|
+
mm: Nisan,
|
|
3602
|
+
dd: 19,
|
|
3603
|
+
desc: PESACH_V_CHM,
|
|
3604
|
+
flags: CHUL_ONLY | CHOL_HAMOED,
|
|
3605
|
+
chmDay: 3,
|
|
3606
|
+
emoji: emojiPesach,
|
|
3607
|
+
},
|
|
3608
|
+
{
|
|
3609
|
+
mm: Nisan,
|
|
3610
|
+
dd: 20,
|
|
3611
|
+
desc: PESACH_VI_CHM,
|
|
3612
|
+
flags: CHUL_ONLY | CHOL_HAMOED | LIGHT_CANDLES,
|
|
3613
|
+
chmDay: 4,
|
|
3614
|
+
emoji: emojiPesach,
|
|
3615
|
+
},
|
|
3616
|
+
{
|
|
3617
|
+
mm: Nisan,
|
|
3618
|
+
dd: 21,
|
|
3619
|
+
desc: PESACH_VII,
|
|
3620
|
+
flags: CHUL_ONLY | CHAG$1 | LIGHT_CANDLES_TZEIS$1,
|
|
3621
|
+
emoji: emojiPesach,
|
|
3622
|
+
},
|
|
3623
|
+
{
|
|
3624
|
+
mm: Nisan,
|
|
3625
|
+
dd: 22,
|
|
3626
|
+
desc: PESACH_VIII,
|
|
3627
|
+
flags: CHUL_ONLY | CHAG$1 | YOM_TOV_ENDS,
|
|
3628
|
+
emoji: emojiPesach,
|
|
3629
|
+
},
|
|
3630
|
+
{ mm: Iyyar, dd: 14, desc: PESACH_SHENI, flags: MINOR_HOLIDAY$1 },
|
|
3631
|
+
{ mm: Iyyar, dd: 18, desc: LAG_BAOMER, flags: MINOR_HOLIDAY$1, emoji: '🔥' },
|
|
3632
|
+
{
|
|
3633
|
+
mm: Sivan,
|
|
3634
|
+
dd: 5,
|
|
3635
|
+
desc: EREV_SHAVUOT,
|
|
3636
|
+
flags: EREV$1 | LIGHT_CANDLES,
|
|
3637
|
+
emoji: '⛰️🌸',
|
|
3638
|
+
},
|
|
3639
|
+
{
|
|
3640
|
+
mm: Sivan,
|
|
3641
|
+
dd: 6,
|
|
3642
|
+
desc: SHAVUOT,
|
|
3643
|
+
flags: IL_ONLY$1 | CHAG$1 | YOM_TOV_ENDS,
|
|
3644
|
+
emoji: '⛰️🌸',
|
|
3645
|
+
},
|
|
3646
|
+
{
|
|
3647
|
+
mm: Sivan,
|
|
3648
|
+
dd: 6,
|
|
3649
|
+
desc: SHAVUOT_I,
|
|
3650
|
+
flags: CHUL_ONLY | CHAG$1 | LIGHT_CANDLES_TZEIS$1,
|
|
3651
|
+
emoji: '⛰️🌸',
|
|
3652
|
+
},
|
|
3653
|
+
{
|
|
3654
|
+
mm: Sivan,
|
|
3655
|
+
dd: 7,
|
|
3656
|
+
desc: SHAVUOT_II,
|
|
3657
|
+
flags: CHUL_ONLY | CHAG$1 | YOM_TOV_ENDS,
|
|
3658
|
+
emoji: '⛰️🌸',
|
|
3659
|
+
},
|
|
3660
|
+
{ mm: Av, dd: 15, desc: TU_BAV, flags: MINOR_HOLIDAY$1, emoji: '❤️' },
|
|
3661
|
+
{
|
|
3662
|
+
mm: Elul,
|
|
3663
|
+
dd: 1,
|
|
3664
|
+
desc: ROSH_HASHANA_LABEHEMOT,
|
|
3665
|
+
flags: MINOR_HOLIDAY$1,
|
|
3666
|
+
emoji: '🐑',
|
|
3667
|
+
},
|
|
3668
|
+
{
|
|
3669
|
+
mm: Elul,
|
|
3670
|
+
dd: 29,
|
|
3671
|
+
desc: EREV_ROSH_HASHANA,
|
|
3672
|
+
flags: EREV$1 | LIGHT_CANDLES,
|
|
3673
|
+
emoji: '🍏🍯',
|
|
3674
|
+
},
|
|
3675
|
+
];
|
|
3676
|
+
const staticModernHolidays = [
|
|
3677
|
+
{ firstYear: 5727, mm: Iyyar, dd: 28, desc: YOM_YERUSHALAYIM, chul: true },
|
|
3678
|
+
{
|
|
3679
|
+
firstYear: 5737,
|
|
3680
|
+
mm: Kislev,
|
|
3681
|
+
dd: 6,
|
|
3682
|
+
desc: BEN_GURION_DAY,
|
|
3683
|
+
satPostponeToSun: true,
|
|
3684
|
+
friPostponeToSun: true,
|
|
3685
|
+
},
|
|
3686
|
+
{ firstYear: 5750, mm: Shvat, dd: 30, desc: FAMILY_DAY },
|
|
3687
|
+
{
|
|
3688
|
+
firstYear: 5758,
|
|
3689
|
+
mm: Cheshvan,
|
|
3690
|
+
dd: 12,
|
|
3691
|
+
desc: YITZHAK_RABIN_MEMORIAL_DAY,
|
|
3692
|
+
friSatMovetoThu: true,
|
|
3693
|
+
},
|
|
3694
|
+
{ firstYear: 5764, mm: Iyyar, dd: 10, desc: HERZL_DAY, satPostponeToSun: true },
|
|
3695
|
+
{
|
|
3696
|
+
firstYear: 5765,
|
|
3697
|
+
mm: Tamuz,
|
|
3698
|
+
dd: 29,
|
|
3699
|
+
desc: JABOTINSKY_DAY,
|
|
3700
|
+
satPostponeToSun: true,
|
|
3701
|
+
},
|
|
3702
|
+
{
|
|
3703
|
+
firstYear: 5769,
|
|
3704
|
+
mm: Cheshvan,
|
|
3705
|
+
dd: 29,
|
|
3706
|
+
desc: SIGD,
|
|
3707
|
+
chul: true,
|
|
3708
|
+
suppressEmoji: true,
|
|
3709
|
+
},
|
|
3710
|
+
{ firstYear: 5777, mm: Nisan, dd: 10, desc: YOM_HAALIYAH, chul: true },
|
|
3711
|
+
{ firstYear: 5777, mm: Cheshvan, dd: 7, desc: YOM_HAALIYAH_SCHOOL_OBSERVANCE },
|
|
3712
|
+
// https://www.gov.il/he/departments/policies/2012_des5234
|
|
3713
|
+
{
|
|
3714
|
+
firstYear: 5773,
|
|
3715
|
+
mm: months.TEVET,
|
|
3716
|
+
dd: 21,
|
|
3717
|
+
desc: HEBREW_LANGUAGE_DAY,
|
|
3718
|
+
friSatMovetoThu: true,
|
|
3719
|
+
},
|
|
3720
|
+
];
|
|
3721
|
+
|
|
3722
|
+
/*! @hebcal/core v5.7.7 */
|
|
3723
|
+
|
|
3724
|
+
/** Represents a built-in holiday like Pesach, Purim or Tu BiShvat */
|
|
3725
|
+
class HolidayEvent extends Event {
|
|
3726
|
+
basename() {
|
|
3727
|
+
return this.getDesc()
|
|
3728
|
+
.replace(/ \d{4}$/, '')
|
|
3729
|
+
.replace(/ \(CH''M\)$/, '')
|
|
3730
|
+
.replace(/ \(observed\)$/, '')
|
|
3731
|
+
.replace(/ \(Hoshana Raba\)$/, '')
|
|
3732
|
+
.replace(/ [IV]+$/, '')
|
|
3733
|
+
.replace(/: \d Candles?$/, '')
|
|
3734
|
+
.replace(/: 8th Day$/, '')
|
|
3735
|
+
.replace(/^Erev /, '');
|
|
3736
|
+
}
|
|
3737
|
+
url() {
|
|
3738
|
+
const year = this.getDate().greg().getFullYear();
|
|
3739
|
+
if (year < 100) {
|
|
3740
|
+
return undefined;
|
|
3741
|
+
}
|
|
3742
|
+
const url = 'https://www.hebcal.com/holidays/' +
|
|
3743
|
+
this.basename().toLowerCase().replace(/'/g, '').replace(/ /g, '-') +
|
|
3744
|
+
'-' +
|
|
3745
|
+
this.urlDateSuffix();
|
|
3746
|
+
return this.getFlags() & flags.IL_ONLY ? url + '?i=on' : url;
|
|
3747
|
+
}
|
|
3748
|
+
urlDateSuffix() {
|
|
3749
|
+
const year = this.getDate().greg().getFullYear();
|
|
3750
|
+
return String(year);
|
|
3751
|
+
}
|
|
3752
|
+
getEmoji() {
|
|
3753
|
+
if (this.emoji) {
|
|
3754
|
+
return this.emoji;
|
|
3755
|
+
}
|
|
3756
|
+
else if (this.getFlags() & flags.SPECIAL_SHABBAT) {
|
|
3757
|
+
return '🕍';
|
|
3758
|
+
}
|
|
3759
|
+
else {
|
|
3760
|
+
return '✡️';
|
|
3761
|
+
}
|
|
3762
|
+
}
|
|
3763
|
+
getCategories() {
|
|
3764
|
+
if (this.cholHaMoedDay) {
|
|
3765
|
+
return ['holiday', 'major', 'cholhamoed'];
|
|
3766
|
+
}
|
|
3767
|
+
const cats = super.getCategories();
|
|
3768
|
+
if (cats[0] !== 'unknown') {
|
|
3769
|
+
return cats;
|
|
3770
|
+
}
|
|
3771
|
+
// Don't depend on flags.MINOR_HOLIDAY always being set. Look for minor holidays.
|
|
3772
|
+
const desc = this.getDesc();
|
|
3773
|
+
switch (desc) {
|
|
3774
|
+
case holidayDesc.LAG_BAOMER:
|
|
3775
|
+
case holidayDesc.LEIL_SELICHOT:
|
|
3776
|
+
case holidayDesc.PESACH_SHENI:
|
|
3777
|
+
case holidayDesc.EREV_PURIM:
|
|
3778
|
+
case holidayDesc.PURIM_KATAN:
|
|
3779
|
+
case holidayDesc.SHUSHAN_PURIM:
|
|
3780
|
+
case holidayDesc.TU_BAV:
|
|
3781
|
+
case holidayDesc.TU_BISHVAT:
|
|
3782
|
+
case holidayDesc.ROSH_HASHANA_LABEHEMOT:
|
|
3783
|
+
return ['holiday', 'minor'];
|
|
3784
|
+
}
|
|
3785
|
+
return ['holiday', 'major'];
|
|
3786
|
+
}
|
|
3787
|
+
/**
|
|
3788
|
+
* Returns (translated) description of this event
|
|
3789
|
+
* @param [locale] Optional locale name (defaults to active locale).
|
|
3790
|
+
*/
|
|
3791
|
+
render(locale) {
|
|
3792
|
+
const str = super.render(locale);
|
|
3793
|
+
return str.replace(/'/g, '’');
|
|
3794
|
+
}
|
|
3795
|
+
/**
|
|
3796
|
+
* Returns a brief (translated) description of this event.
|
|
3797
|
+
* For most events, this is the same as render(). For some events, it procudes
|
|
3798
|
+
* a shorter text (e.g. without a time or added description).
|
|
3799
|
+
* @param [locale] Optional locale name (defaults to active locale).
|
|
3800
|
+
*/
|
|
3801
|
+
renderBrief(locale) {
|
|
3802
|
+
const str = super.renderBrief(locale);
|
|
3803
|
+
return str.replace(/'/g, '’');
|
|
3804
|
+
}
|
|
3805
|
+
/**
|
|
3806
|
+
* Makes a clone of this Event object
|
|
3807
|
+
* @deprecated
|
|
3808
|
+
*/
|
|
3809
|
+
clone() {
|
|
3810
|
+
const ev = new HolidayEvent(this.date, this.desc, this.mask);
|
|
3811
|
+
for (const property in this) {
|
|
3812
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
3813
|
+
if (this.hasOwnProperty(property)) {
|
|
3814
|
+
Object.defineProperty(ev, property, { value: this[property] });
|
|
3815
|
+
}
|
|
3816
|
+
}
|
|
3817
|
+
return ev;
|
|
3818
|
+
}
|
|
3819
|
+
}
|
|
3820
|
+
/**
|
|
3821
|
+
* Because Asara B'Tevet often occurs twice in the same Gregorian year,
|
|
3822
|
+
* we subclass HolidayEvent to override the `url()` method.
|
|
3823
|
+
*/
|
|
3824
|
+
class AsaraBTevetEvent extends HolidayEvent {
|
|
3825
|
+
urlDateSuffix() {
|
|
3826
|
+
const isoDate = isoDateString(this.getDate().greg());
|
|
3827
|
+
return isoDate.replace(/-/g, '');
|
|
3828
|
+
}
|
|
3829
|
+
}
|
|
3830
|
+
/** Represents Rosh Hashana, the Jewish New Year */
|
|
3831
|
+
class RoshHashanaEvent extends HolidayEvent {
|
|
3832
|
+
/**
|
|
3833
|
+
* @private
|
|
3834
|
+
* @param date Hebrew date event occurs
|
|
3835
|
+
* @param hyear Hebrew year
|
|
3836
|
+
* @param mask optional holiday flags
|
|
3837
|
+
*/
|
|
3838
|
+
constructor(date, hyear, mask) {
|
|
3839
|
+
super(date, `Rosh Hashana ${hyear}`, mask);
|
|
3840
|
+
this.hyear = hyear;
|
|
3841
|
+
}
|
|
3842
|
+
/**
|
|
3843
|
+
* Returns (translated) description of this event
|
|
3844
|
+
* @param [locale] Optional locale name (defaults to active locale).
|
|
3845
|
+
*/
|
|
3846
|
+
render(locale) {
|
|
3847
|
+
return Locale.gettext('Rosh Hashana', locale) + ' ' + this.hyear;
|
|
3848
|
+
}
|
|
3849
|
+
getEmoji() {
|
|
3850
|
+
return '🍏🍯';
|
|
3851
|
+
}
|
|
3852
|
+
}
|
|
3853
|
+
const roshChodeshStr = 'Rosh Chodesh';
|
|
3854
|
+
/** Represents Rosh Chodesh, the beginning of a new month */
|
|
3855
|
+
class RoshChodeshEvent extends HolidayEvent {
|
|
3856
|
+
/**
|
|
3857
|
+
* Constructs Rosh Chodesh event
|
|
3858
|
+
* @param date Hebrew date event occurs
|
|
3859
|
+
* @param monthName Hebrew month name (not translated)
|
|
3860
|
+
*/
|
|
3861
|
+
constructor(date, monthName) {
|
|
3862
|
+
super(date, `${roshChodeshStr} ${monthName}`, flags.ROSH_CHODESH);
|
|
3863
|
+
}
|
|
3864
|
+
/**
|
|
3865
|
+
* Returns (translated) description of this event
|
|
3866
|
+
* @param [locale] Optional locale name (defaults to active locale).
|
|
3867
|
+
*/
|
|
3868
|
+
render(locale) {
|
|
3869
|
+
const monthName = this.getDesc().substring(roshChodeshStr.length + 1);
|
|
3870
|
+
const monthName0 = Locale.gettext(monthName, locale);
|
|
3871
|
+
const monthName1 = monthName0.replace(/'/g, '’');
|
|
3872
|
+
return Locale.gettext(roshChodeshStr, locale) + ' ' + monthName1;
|
|
3873
|
+
}
|
|
3874
|
+
basename() {
|
|
3875
|
+
return this.getDesc();
|
|
3876
|
+
}
|
|
3877
|
+
getEmoji() {
|
|
3878
|
+
return this.emoji || '🌒';
|
|
3879
|
+
}
|
|
3880
|
+
}
|
|
3881
|
+
|
|
3882
|
+
/*! @hebcal/core v5.7.7 */
|
|
3883
|
+
|
|
3884
|
+
const ykk = 'Yom Kippur Katan';
|
|
3885
|
+
/** YKK is minor day of atonement on the day preceeding each Rosh Chodesh */
|
|
3886
|
+
class YomKippurKatanEvent extends HolidayEvent {
|
|
3887
|
+
/**
|
|
3888
|
+
* @private
|
|
3889
|
+
* @param date Hebrew date event occurs
|
|
3890
|
+
* @param nextMonthName name of the upcoming month
|
|
3891
|
+
*/
|
|
3892
|
+
constructor(date, nextMonthName) {
|
|
3893
|
+
super(date, `${ykk} ${nextMonthName}`, flags.MINOR_FAST | flags.YOM_KIPPUR_KATAN);
|
|
3894
|
+
this.nextMonthName = nextMonthName;
|
|
3895
|
+
this.memo = `Minor Day of Atonement on the day preceeding Rosh Chodesh ${nextMonthName}`;
|
|
3896
|
+
}
|
|
3897
|
+
basename() {
|
|
3898
|
+
return this.getDesc();
|
|
3899
|
+
}
|
|
3900
|
+
/**
|
|
3901
|
+
* @param [locale] Optional locale name (defaults to active locale).
|
|
3902
|
+
*/
|
|
3903
|
+
render(locale) {
|
|
3904
|
+
const monthName0 = Locale.gettext(this.nextMonthName, locale);
|
|
3905
|
+
const monthName = monthName0.replace(/'/g, '’');
|
|
3906
|
+
return Locale.gettext(ykk, locale) + ' ' + monthName;
|
|
3907
|
+
}
|
|
3908
|
+
/**
|
|
3909
|
+
* @param [locale] Optional locale name (defaults to active locale).
|
|
3910
|
+
*/
|
|
3911
|
+
renderBrief(locale) {
|
|
3912
|
+
return Locale.gettext(ykk, locale);
|
|
3913
|
+
}
|
|
3914
|
+
url() {
|
|
3915
|
+
return undefined;
|
|
3916
|
+
}
|
|
3917
|
+
}
|
|
3918
|
+
|
|
3919
|
+
/*! @hebcal/core v5.7.7 */
|
|
3920
|
+
|
|
3921
|
+
/*
|
|
3922
|
+
Hebcal - A Jewish Calendar Generator
|
|
3923
|
+
Copyright (c) 1994-2020 Danny Sadinoff
|
|
3924
|
+
Portions copyright Eyal Schachter and Michael J. Radwin
|
|
3925
|
+
|
|
3926
|
+
https://github.com/hebcal/hebcal-es6
|
|
3927
|
+
|
|
3928
|
+
This program is free software; you can redistribute it and/or
|
|
3929
|
+
modify it under the terms of the GNU General Public License
|
|
3930
|
+
as published by the Free Software Foundation; either version 2
|
|
3931
|
+
of the License, or (at your option) any later version.
|
|
3932
|
+
|
|
3933
|
+
This program is distributed in the hope that it will be useful,
|
|
3934
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
3935
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
3936
|
+
GNU General Public License for more details.
|
|
3937
|
+
|
|
3938
|
+
You should have received a copy of the GNU General Public License
|
|
3939
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
3940
|
+
*/
|
|
3941
|
+
/** @private */
|
|
3942
|
+
function observedInIsrael(ev) {
|
|
3943
|
+
return ev.observedInIsrael();
|
|
3944
|
+
}
|
|
3945
|
+
/** @private */
|
|
3946
|
+
function observedInDiaspora(ev) {
|
|
3947
|
+
return ev.observedInDiaspora();
|
|
3948
|
+
}
|
|
3949
|
+
/** @private */
|
|
3950
|
+
function holidayFilter(il) {
|
|
3951
|
+
return il ? observedInIsrael : observedInDiaspora;
|
|
3952
|
+
}
|
|
3953
|
+
/**
|
|
3954
|
+
* Returns an array of Events on this date (or `undefined` if no events)
|
|
3955
|
+
* @param date Hebrew Date, Gregorian date, or absolute R.D. day number
|
|
3956
|
+
* @param [il] use the Israeli schedule for holidays
|
|
3957
|
+
*/
|
|
3958
|
+
function getHolidaysOnDate(date, il) {
|
|
3959
|
+
const hd = HDate.isHDate(date) ? date : new HDate(date);
|
|
3960
|
+
const hdStr = hd.toString();
|
|
3961
|
+
const yearMap = getHolidaysForYear_(hd.getFullYear());
|
|
3962
|
+
const events = yearMap.get(hdStr);
|
|
3963
|
+
// if il isn't a boolean return both diaspora + IL for day
|
|
3964
|
+
if (typeof il === 'undefined' || typeof events === 'undefined') {
|
|
3965
|
+
return events;
|
|
3966
|
+
}
|
|
3967
|
+
const filtered = events.filter(holidayFilter(il));
|
|
3968
|
+
return filtered;
|
|
3969
|
+
}
|
|
3970
|
+
const CHAG = flags.CHAG;
|
|
3971
|
+
const IL_ONLY = flags.IL_ONLY;
|
|
3972
|
+
const LIGHT_CANDLES_TZEIS = flags.LIGHT_CANDLES_TZEIS;
|
|
3973
|
+
const CHANUKAH_CANDLES = flags.CHANUKAH_CANDLES;
|
|
3974
|
+
const MINOR_FAST = flags.MINOR_FAST;
|
|
3975
|
+
const SPECIAL_SHABBAT = flags.SPECIAL_SHABBAT;
|
|
3976
|
+
const MODERN_HOLIDAY = flags.MODERN_HOLIDAY;
|
|
3977
|
+
const MAJOR_FAST = flags.MAJOR_FAST;
|
|
3978
|
+
const MINOR_HOLIDAY = flags.MINOR_HOLIDAY;
|
|
3979
|
+
const EREV = flags.EREV;
|
|
3980
|
+
const SUN = 0;
|
|
3981
|
+
const TUE = 2;
|
|
3982
|
+
const THU = 4;
|
|
3983
|
+
const FRI = 5;
|
|
3984
|
+
const SAT = 6;
|
|
3985
|
+
const NISAN = months.NISAN;
|
|
3986
|
+
const TAMUZ = months.TAMUZ;
|
|
3987
|
+
const AV = months.AV;
|
|
3988
|
+
const TISHREI = months.TISHREI;
|
|
3989
|
+
const KISLEV = months.KISLEV;
|
|
3990
|
+
const TEVET = months.TEVET;
|
|
3991
|
+
const ADAR_I = months.ADAR_I;
|
|
3992
|
+
const ADAR_II = months.ADAR_II;
|
|
3993
|
+
const emojiIsraelFlag = { emoji: '🇮🇱' };
|
|
3994
|
+
const chanukahEmoji = '🕎';
|
|
3995
|
+
const yearCache = new QuickLRU({ maxSize: 400 });
|
|
3996
|
+
const KEYCAP_DIGITS = [
|
|
3997
|
+
'0️⃣',
|
|
3998
|
+
'1️⃣',
|
|
3999
|
+
'2️⃣',
|
|
4000
|
+
'3️⃣',
|
|
4001
|
+
'4️⃣',
|
|
4002
|
+
'5️⃣',
|
|
4003
|
+
'6️⃣',
|
|
4004
|
+
'7️⃣',
|
|
4005
|
+
'8️⃣',
|
|
4006
|
+
'9️⃣',
|
|
4007
|
+
];
|
|
4008
|
+
/**
|
|
4009
|
+
* Lower-level holidays interface, which returns a `Map` of `Event`s indexed by
|
|
4010
|
+
* `HDate.toString()`. These events must filtered especially for `flags.IL_ONLY`
|
|
4011
|
+
* or `flags.CHUL_ONLY` depending on Israel vs. Diaspora holiday scheme.
|
|
4012
|
+
* @private
|
|
4013
|
+
*/
|
|
4014
|
+
function getHolidaysForYear_(year) {
|
|
4015
|
+
if (typeof year !== 'number') {
|
|
4016
|
+
throw new TypeError(`bad Hebrew year: ${year}`);
|
|
4017
|
+
}
|
|
4018
|
+
else if (year < 1 || year > 32658) {
|
|
4019
|
+
throw new RangeError(`Hebrew year ${year} out of range 1-32658`);
|
|
4020
|
+
}
|
|
4021
|
+
const cached = yearCache.get(year);
|
|
4022
|
+
if (cached) {
|
|
4023
|
+
return cached;
|
|
4024
|
+
}
|
|
4025
|
+
const RH = new HDate(1, TISHREI, year);
|
|
4026
|
+
const pesach = new HDate(15, NISAN, year);
|
|
4027
|
+
const map = new Map();
|
|
4028
|
+
function add(...events) {
|
|
4029
|
+
for (const ev of events) {
|
|
4030
|
+
const key = ev.date.toString();
|
|
4031
|
+
const arr = map.get(key);
|
|
4032
|
+
if (typeof arr === 'object') {
|
|
4033
|
+
if (arr[0].getFlags() & EREV) {
|
|
4034
|
+
arr.unshift(ev);
|
|
4035
|
+
}
|
|
4036
|
+
else {
|
|
4037
|
+
arr.push(ev);
|
|
4038
|
+
}
|
|
4039
|
+
}
|
|
4040
|
+
else {
|
|
4041
|
+
map.set(key, [ev]);
|
|
4042
|
+
}
|
|
4043
|
+
}
|
|
4044
|
+
}
|
|
4045
|
+
for (const h of staticHolidays) {
|
|
4046
|
+
const hd = new HDate(h.dd, h.mm, year);
|
|
4047
|
+
const ev = new HolidayEvent(hd, h.desc, h.flags);
|
|
4048
|
+
if (h.emoji)
|
|
4049
|
+
ev.emoji = h.emoji;
|
|
4050
|
+
if (h.chmDay)
|
|
4051
|
+
ev.cholHaMoedDay = h.chmDay;
|
|
4052
|
+
add(ev);
|
|
4053
|
+
}
|
|
4054
|
+
// standard holidays that don't shift based on year
|
|
4055
|
+
add(new RoshHashanaEvent(RH, year, CHAG | LIGHT_CANDLES_TZEIS));
|
|
4056
|
+
// Variable date holidays
|
|
4057
|
+
const tzomGedaliahDay = RH.getDay() === THU ? 4 : 3;
|
|
4058
|
+
add(new HolidayEvent(new HDate(tzomGedaliahDay, TISHREI, year), holidayDesc.TZOM_GEDALIAH, MINOR_FAST));
|
|
4059
|
+
// first SAT after RH
|
|
4060
|
+
add(new HolidayEvent(new HDate(HDate.dayOnOrBefore(SAT, 7 + RH.abs())), holidayDesc.SHABBAT_SHUVA, SPECIAL_SHABBAT));
|
|
4061
|
+
const rchTevet = HDate.shortKislev(year)
|
|
4062
|
+
? new HDate(1, TEVET, year)
|
|
4063
|
+
: new HDate(30, KISLEV, year);
|
|
4064
|
+
add(new HolidayEvent(rchTevet, holidayDesc.CHAG_HABANOT, MINOR_HOLIDAY));
|
|
4065
|
+
// yes, we know Kislev 30-32 are wrong
|
|
4066
|
+
// HDate() corrects the month automatically
|
|
4067
|
+
for (let candles = 2; candles <= 8; candles++) {
|
|
4068
|
+
const hd = new HDate(23 + candles, KISLEV, year);
|
|
4069
|
+
add(new HolidayEvent(hd, `Chanukah: ${candles} Candles`, MINOR_HOLIDAY | CHANUKAH_CANDLES, {
|
|
4070
|
+
chanukahDay: candles - 1,
|
|
4071
|
+
emoji: chanukahEmoji + KEYCAP_DIGITS[candles],
|
|
4072
|
+
}));
|
|
4073
|
+
}
|
|
4074
|
+
add(new HolidayEvent(new HDate(32, KISLEV, year), holidayDesc.CHANUKAH_8TH_DAY, MINOR_HOLIDAY, { chanukahDay: 8, emoji: chanukahEmoji }));
|
|
4075
|
+
add(new AsaraBTevetEvent(new HDate(10, TEVET, year), holidayDesc.ASARA_BTEVET, MINOR_FAST));
|
|
4076
|
+
const pesachAbs = pesach.abs();
|
|
4077
|
+
add(new HolidayEvent(new HDate(HDate.dayOnOrBefore(SAT, pesachAbs - 43)), holidayDesc.SHABBAT_SHEKALIM, SPECIAL_SHABBAT), new HolidayEvent(new HDate(HDate.dayOnOrBefore(SAT, pesachAbs - 30)), holidayDesc.SHABBAT_ZACHOR, SPECIAL_SHABBAT), new HolidayEvent(new HDate(pesachAbs - (pesach.getDay() === TUE ? 33 : 31)), holidayDesc.TAANIT_ESTHER, MINOR_FAST));
|
|
4078
|
+
const haChodeshAbs = HDate.dayOnOrBefore(SAT, pesachAbs - 14);
|
|
4079
|
+
add(new HolidayEvent(new HDate(haChodeshAbs - 7), holidayDesc.SHABBAT_PARAH, SPECIAL_SHABBAT), new HolidayEvent(new HDate(haChodeshAbs), holidayDesc.SHABBAT_HACHODESH, SPECIAL_SHABBAT), new HolidayEvent(new HDate(HDate.dayOnOrBefore(SAT, pesachAbs - 1)), holidayDesc.SHABBAT_HAGADOL, SPECIAL_SHABBAT), new HolidayEvent(
|
|
4080
|
+
// if the fast falls on Shabbat, move to Thursday
|
|
4081
|
+
pesach.prev().getDay() === SAT
|
|
4082
|
+
? pesach.onOrBefore(THU)
|
|
4083
|
+
: new HDate(14, NISAN, year), holidayDesc.TAANIT_BECHOROT, MINOR_FAST));
|
|
4084
|
+
add(new HolidayEvent(new HDate(HDate.dayOnOrBefore(SAT, new HDate(1, TISHREI, year + 1).abs() - 4)), holidayDesc.LEIL_SELICHOT, MINOR_HOLIDAY, { emoji: '🕍' }));
|
|
4085
|
+
if (pesach.getDay() === SUN) {
|
|
4086
|
+
add(new HolidayEvent(new HDate(16, ADAR_II, year), holidayDesc.PURIM_MESHULASH, MINOR_HOLIDAY));
|
|
4087
|
+
}
|
|
4088
|
+
if (HDate.isLeapYear(year)) {
|
|
4089
|
+
add(new HolidayEvent(new HDate(14, ADAR_I, year), holidayDesc.PURIM_KATAN, MINOR_HOLIDAY, { emoji: '🎭️' }));
|
|
4090
|
+
add(new HolidayEvent(new HDate(15, ADAR_I, year), holidayDesc.SHUSHAN_PURIM_KATAN, MINOR_HOLIDAY, { emoji: '🎭️' }));
|
|
4091
|
+
}
|
|
4092
|
+
const nisan27dt = dateYomHaShoah(year);
|
|
4093
|
+
if (nisan27dt) {
|
|
4094
|
+
add(new HolidayEvent(nisan27dt, holidayDesc.YOM_HASHOAH, MODERN_HOLIDAY));
|
|
4095
|
+
}
|
|
4096
|
+
const yomHaZikaronDt = dateYomHaZikaron(year);
|
|
4097
|
+
if (yomHaZikaronDt) {
|
|
4098
|
+
add(new HolidayEvent(yomHaZikaronDt, holidayDesc.YOM_HAZIKARON, MODERN_HOLIDAY, emojiIsraelFlag), new HolidayEvent(yomHaZikaronDt.next(), holidayDesc.YOM_HAATZMA_UT, MODERN_HOLIDAY, emojiIsraelFlag));
|
|
4099
|
+
}
|
|
4100
|
+
for (const h of staticModernHolidays) {
|
|
4101
|
+
if (year >= h.firstYear) {
|
|
4102
|
+
let hd = new HDate(h.dd, h.mm, year);
|
|
4103
|
+
const dow = hd.getDay();
|
|
4104
|
+
if (h.friSatMovetoThu && (dow === FRI || dow === SAT)) {
|
|
4105
|
+
hd = hd.onOrBefore(THU);
|
|
4106
|
+
}
|
|
4107
|
+
else if (h.friPostponeToSun && dow === FRI) {
|
|
4108
|
+
hd = new HDate(hd.abs() + 2);
|
|
4109
|
+
}
|
|
4110
|
+
else if (h.satPostponeToSun && dow === SAT) {
|
|
4111
|
+
hd = hd.next();
|
|
4112
|
+
}
|
|
4113
|
+
const mask = h.chul ? MODERN_HOLIDAY : MODERN_HOLIDAY | IL_ONLY;
|
|
4114
|
+
const ev = new HolidayEvent(hd, h.desc, mask);
|
|
4115
|
+
if (!h.suppressEmoji) {
|
|
4116
|
+
ev.emoji = '🇮🇱';
|
|
4117
|
+
}
|
|
4118
|
+
add(ev);
|
|
4119
|
+
}
|
|
4120
|
+
}
|
|
4121
|
+
let tamuz17 = new HDate(17, TAMUZ, year);
|
|
4122
|
+
let tamuz17attrs;
|
|
4123
|
+
if (tamuz17.getDay() === SAT) {
|
|
4124
|
+
tamuz17 = new HDate(18, TAMUZ, year);
|
|
4125
|
+
tamuz17attrs = { observed: true };
|
|
4126
|
+
}
|
|
4127
|
+
add(new HolidayEvent(tamuz17, holidayDesc.TZOM_TAMMUZ, MINOR_FAST, tamuz17attrs));
|
|
4128
|
+
let av9dt = new HDate(9, AV, year);
|
|
4129
|
+
let av9title = holidayDesc.TISHA_BAV;
|
|
4130
|
+
let av9attrs;
|
|
4131
|
+
if (av9dt.getDay() === SAT) {
|
|
4132
|
+
av9dt = av9dt.next();
|
|
4133
|
+
av9attrs = { observed: true };
|
|
4134
|
+
av9title += ' (observed)';
|
|
4135
|
+
}
|
|
4136
|
+
const av9abs = av9dt.abs();
|
|
4137
|
+
add(new HolidayEvent(new HDate(HDate.dayOnOrBefore(SAT, av9abs)), holidayDesc.SHABBAT_CHAZON, SPECIAL_SHABBAT), new HolidayEvent(av9dt.prev(), holidayDesc.EREV_TISHA_BAV, EREV | MAJOR_FAST, av9attrs), new HolidayEvent(av9dt, av9title, MAJOR_FAST, av9attrs), new HolidayEvent(new HDate(HDate.dayOnOrBefore(SAT, av9abs + 7)), holidayDesc.SHABBAT_NACHAMU, SPECIAL_SHABBAT));
|
|
4138
|
+
const monthsInYear = HDate.monthsInYear(year);
|
|
4139
|
+
for (let month = 1; month <= monthsInYear; month++) {
|
|
4140
|
+
const monthName = HDate.getMonthName(month, year);
|
|
4141
|
+
if ((month === NISAN
|
|
4142
|
+
? HDate.daysInMonth(HDate.monthsInYear(year - 1), year - 1)
|
|
4143
|
+
: HDate.daysInMonth(month - 1, year)) === 30) {
|
|
4144
|
+
add(new RoshChodeshEvent(new HDate(1, month, year), monthName));
|
|
4145
|
+
add(new RoshChodeshEvent(new HDate(30, month - 1, year), monthName));
|
|
4146
|
+
}
|
|
4147
|
+
else if (month !== TISHREI) {
|
|
4148
|
+
add(new RoshChodeshEvent(new HDate(1, month, year), monthName));
|
|
4149
|
+
}
|
|
4150
|
+
}
|
|
4151
|
+
// Begin: Yom Kippur Katan
|
|
4152
|
+
// start at Iyyar because one may not fast during Nisan
|
|
4153
|
+
for (let month = months.IYYAR; month <= monthsInYear; month++) {
|
|
4154
|
+
const nextMonth = month + 1;
|
|
4155
|
+
// Yom Kippur Katan is not observed on the day before Rosh Hashanah.
|
|
4156
|
+
// Not observed prior to Rosh Chodesh Cheshvan because Yom Kippur has just passed.
|
|
4157
|
+
// Not observed before Rosh Chodesh Tevet, because that day is Hanukkah.
|
|
4158
|
+
if (nextMonth === TISHREI ||
|
|
4159
|
+
nextMonth === months.CHESHVAN ||
|
|
4160
|
+
nextMonth === TEVET) {
|
|
4161
|
+
continue;
|
|
4162
|
+
}
|
|
4163
|
+
let ykk = new HDate(29, month, year);
|
|
4164
|
+
const dow = ykk.getDay();
|
|
4165
|
+
if (dow === FRI || dow === SAT) {
|
|
4166
|
+
ykk = ykk.onOrBefore(THU);
|
|
4167
|
+
}
|
|
4168
|
+
const nextMonthName = HDate.getMonthName(nextMonth, year);
|
|
4169
|
+
const ev = new YomKippurKatanEvent(ykk, nextMonthName);
|
|
4170
|
+
add(ev);
|
|
4171
|
+
}
|
|
4172
|
+
const sedra = getSedra(year, false);
|
|
4173
|
+
const beshalachHd = sedra.find(15);
|
|
4174
|
+
add(new HolidayEvent(beshalachHd, holidayDesc.SHABBAT_SHIRAH, SPECIAL_SHABBAT));
|
|
4175
|
+
// Birkat Hachamah appears only once every 28 years
|
|
4176
|
+
const birkatHaChama = getBirkatHaChama(year);
|
|
4177
|
+
if (birkatHaChama) {
|
|
4178
|
+
const hd = new HDate(birkatHaChama);
|
|
4179
|
+
add(new HolidayEvent(hd, holidayDesc.BIRKAT_HACHAMAH, MINOR_HOLIDAY, { emoji: '☀️' }));
|
|
4180
|
+
}
|
|
4181
|
+
yearCache.set(year, map);
|
|
4182
|
+
return map;
|
|
4183
|
+
}
|
|
4184
|
+
/**
|
|
4185
|
+
* Birkat Hachamah appears only once every 28 years.
|
|
4186
|
+
* Although almost always in Nisan, it can occur in Adar II.
|
|
4187
|
+
* - 27 Adar II 5461 (Gregorian year 1701)
|
|
4188
|
+
* - 29 Adar II 5993 (Gregorian year 2233)
|
|
4189
|
+
*
|
|
4190
|
+
* Due to drift, this will eventually slip into Iyyar
|
|
4191
|
+
* - 2 Iyyar 7141 (Gregorian year 3381)
|
|
4192
|
+
* @private
|
|
4193
|
+
*/
|
|
4194
|
+
function getBirkatHaChama(year) {
|
|
4195
|
+
const leap = HDate.isLeapYear(year);
|
|
4196
|
+
const startMonth = leap ? ADAR_II : NISAN;
|
|
4197
|
+
const startDay = leap ? 20 : 1;
|
|
4198
|
+
const baseRd = HDate.hebrew2abs(year, startMonth, startDay);
|
|
4199
|
+
for (let day = 0; day <= 40; day++) {
|
|
4200
|
+
const abs = baseRd + day;
|
|
4201
|
+
const elapsed = abs + 1373429;
|
|
4202
|
+
if (elapsed % 10227 === 172) {
|
|
4203
|
+
return abs;
|
|
4204
|
+
}
|
|
4205
|
+
}
|
|
4206
|
+
return 0;
|
|
4207
|
+
}
|
|
4208
|
+
|
|
4209
|
+
/*! @hebcal/leyning v9.0.1 */
|
|
4210
|
+
|
|
4211
|
+
function aliyotCombine67(aliyot) {
|
|
4212
|
+
const a6 = clone(aliyot['6']);
|
|
4213
|
+
const a7 = aliyot['7'];
|
|
4214
|
+
if (a6.k !== a7.k) {
|
|
4215
|
+
throw new Error('Impossible to combine aliyot 6 & 7: ' + JSON.stringify(aliyot));
|
|
4216
|
+
}
|
|
4217
|
+
delete aliyot['7'];
|
|
4218
|
+
aliyot['6'] = {
|
|
4219
|
+
k: a6.k,
|
|
4220
|
+
b: a6.b,
|
|
4221
|
+
e: a7.e,
|
|
4222
|
+
};
|
|
4223
|
+
if (a6.v && a7.v) {
|
|
4224
|
+
aliyot['6'].v = a6.v + a7.v;
|
|
4225
|
+
}
|
|
4226
|
+
}
|
|
4227
|
+
function mergeAliyotWithSpecial(aliyot, special) {
|
|
4228
|
+
if (special['7']) {
|
|
4229
|
+
aliyotCombine67(aliyot);
|
|
4230
|
+
aliyot['7'] = clone(special['7']);
|
|
4231
|
+
calculateNumVerses(aliyot['7']);
|
|
4232
|
+
}
|
|
4233
|
+
if (special['M']) {
|
|
4234
|
+
aliyot['M'] = clone(special['M']);
|
|
4235
|
+
calculateNumVerses(aliyot['M']);
|
|
4236
|
+
}
|
|
4237
|
+
}
|
|
4238
|
+
/**
|
|
4239
|
+
* Determines if the regular parashat haShavua coincides with an event that requires
|
|
4240
|
+
* a special maftir or Haftara (for example Shabbat HaGadol, Shabbat Chanukah, Rosh
|
|
4241
|
+
* Chodesh or Machar Chodesh, etc.).
|
|
4242
|
+
*
|
|
4243
|
+
* This function does not modify `aliyot`. Instead, it returns a deep copy
|
|
4244
|
+
* with `aliyot['M']` replaced and sets `reason.M`
|
|
4245
|
+
* (and in some cases the 6th and 7th aliyah, setting `reason['7']`).
|
|
4246
|
+
*
|
|
4247
|
+
* If a special Haftarah applies, the result will have a `haft` property
|
|
4248
|
+
* pointing to Haftarah object and sets `reason.haftara`.
|
|
4249
|
+
*/
|
|
4250
|
+
function specialReadings2(parsha, hd, il, aliyot) {
|
|
4251
|
+
let haft;
|
|
4252
|
+
let seph;
|
|
4253
|
+
let specialHaft = false;
|
|
4254
|
+
const reason = {};
|
|
4255
|
+
function handleSpecial(key) {
|
|
4256
|
+
const special = lookupFestival(key);
|
|
4257
|
+
if (!special) {
|
|
4258
|
+
return;
|
|
4259
|
+
}
|
|
4260
|
+
if (typeof special.il === 'boolean' && il !== special.il) {
|
|
4261
|
+
return;
|
|
4262
|
+
}
|
|
4263
|
+
if (special.haft && !specialHaft) {
|
|
4264
|
+
haft = cloneHaftara(special.haft);
|
|
4265
|
+
reason.haftara = key;
|
|
4266
|
+
specialHaft = true;
|
|
4267
|
+
if (special.seph) {
|
|
4268
|
+
seph = cloneHaftara(special.seph);
|
|
4269
|
+
reason.sephardic = key;
|
|
4270
|
+
}
|
|
4271
|
+
}
|
|
4272
|
+
if (special.fullkriyah) {
|
|
4273
|
+
const aliyotMap = clone(aliyot);
|
|
4274
|
+
mergeAliyotWithSpecial(aliyotMap, special.fullkriyah);
|
|
4275
|
+
for (const num of Object.keys(special.fullkriyah)) {
|
|
4276
|
+
reason[num] = key;
|
|
4277
|
+
}
|
|
4278
|
+
aliyot = aliyotMap;
|
|
4279
|
+
}
|
|
4280
|
+
}
|
|
4281
|
+
const parshaName = parshaToString(parsha);
|
|
4282
|
+
const events0 = getHolidaysOnDate(hd, il) || [];
|
|
4283
|
+
const events = events0.filter(ev => !(ev.getFlags() & flags.ROSH_CHODESH));
|
|
4284
|
+
for (const ev of events) {
|
|
4285
|
+
if (ev.getDesc() === 'Shabbat Shuva') {
|
|
4286
|
+
handleSpecial(`Shabbat Shuva (with ${parshaName})`);
|
|
4287
|
+
}
|
|
4288
|
+
else {
|
|
4289
|
+
const key = getLeyningKeyForEvent(ev, il);
|
|
4290
|
+
if (key) {
|
|
4291
|
+
handleSpecial(key);
|
|
4292
|
+
}
|
|
4293
|
+
}
|
|
4294
|
+
}
|
|
4295
|
+
if (!haft) {
|
|
4296
|
+
const day = hd.getDate();
|
|
4297
|
+
if (parshaName === 'Pinchas' && day > 17) {
|
|
4298
|
+
// Pinchas is always read in Tamuz (never another month)
|
|
4299
|
+
// either on the 14, 16, 17 (in Israel), 19, 21, 23, 24
|
|
4300
|
+
handleSpecial('Pinchas occurring after 17 Tammuz');
|
|
4301
|
+
}
|
|
4302
|
+
else if (day === 30 || day === 1) {
|
|
4303
|
+
const key = parshaName === 'Masei' || parshaName === 'Matot-Masei'
|
|
4304
|
+
? `${parshaName} on Shabbat Rosh Chodesh`
|
|
4305
|
+
: 'Shabbat Rosh Chodesh';
|
|
4306
|
+
handleSpecial(key);
|
|
4307
|
+
}
|
|
4308
|
+
else if (parshaName === 'Ki Teitzei' && day === 14) {
|
|
4309
|
+
// Ki Teitzei is always read in Elul on 9, 11, 13 or 14
|
|
4310
|
+
// "Because Shabbat Re’eh was Rosh Ḥodesh, the usual 3rd haftarah of
|
|
4311
|
+
// consolation was not read. Chant the haftarah of Ki tetse and then
|
|
4312
|
+
// the haftarah of Re’eh as a single haftarah.
|
|
4313
|
+
// In the book of Isaiah these two brief passages are adjacent."
|
|
4314
|
+
// Source: Luaḥ Hashanah, Rabbi Miles B. Cohen and Leslie Rubin
|
|
4315
|
+
handleSpecial('Ki Teitzei with 3rd Haftarah of Consolation');
|
|
4316
|
+
}
|
|
4317
|
+
else if (parshaName === 'Kedoshim' &&
|
|
4318
|
+
(day === 26 || day === 28 || day === 6)) {
|
|
4319
|
+
// Kedoshim is read separately from Achrei Mot in ~37% of years.
|
|
4320
|
+
// When this happens, it is will be read on
|
|
4321
|
+
// 26th or 28th of Nisan (Achrei Mot was Shabbat HaGadol, ~10%),
|
|
4322
|
+
// or 1st of Iyyar (Rosh Chodesh, ~10%),
|
|
4323
|
+
// or 6th of Iyyar (~10%, immediately after Shabbat Machar Chodesh)
|
|
4324
|
+
// or 3rd of Iyyar (~6%, "the nominal situation — in which both parashiyyot
|
|
4325
|
+
// are read separately and no overriding occasions coincide")
|
|
4326
|
+
// http://www.scholar.davidesstein.name/Articles/HaftarotOfEtzHayim--Stein.pdf
|
|
4327
|
+
// "The Haftarot of Etz Hayim," David E. S. Stein, Conservative Judaism 54/3 (Spring 2002)
|
|
4328
|
+
handleSpecial('Kedoshim following Special Shabbat');
|
|
4329
|
+
}
|
|
4330
|
+
else if (hd.getMonth() !== months.AV) {
|
|
4331
|
+
// Parashat Re'eh is always read in Av on 25, 27, 29 or 30.
|
|
4332
|
+
// When it coincides with Erev Rosh Chodesh, the Haftarah is
|
|
4333
|
+
// עניה סוערה (Isaiah 54:11-55:5) and not מחר חדש
|
|
4334
|
+
const tommorow = hd.next().getDate();
|
|
4335
|
+
if (tommorow === 30 || tommorow === 1) {
|
|
4336
|
+
handleSpecial('Shabbat Machar Chodesh');
|
|
4337
|
+
}
|
|
4338
|
+
}
|
|
4339
|
+
}
|
|
4340
|
+
return { aliyot, reason, haft, seph };
|
|
4341
|
+
}
|
|
4342
|
+
|
|
4343
|
+
/*! @hebcal/leyning v9.0.1 */
|
|
4344
|
+
|
|
4345
|
+
/**
|
|
4346
|
+
* @private
|
|
4347
|
+
*/
|
|
4348
|
+
function isChapVerseBefore(a, b) {
|
|
4349
|
+
const cv1 = a.split(':').map(x => +x);
|
|
4350
|
+
const cv2 = b.split(':').map(x => +x);
|
|
4351
|
+
return cv1[0] * 100 + cv1[1] < cv2[0] * 100 + cv2[1];
|
|
4352
|
+
}
|
|
4353
|
+
/**
|
|
4354
|
+
* Summarizes an `AliyotMap` by collapsing all adjacent aliyot.
|
|
4355
|
+
* Finds any non-overlapping parts (e.g. special 7th aliyah or maftir)
|
|
4356
|
+
*/
|
|
4357
|
+
function makeLeyningParts(aliyot) {
|
|
4358
|
+
const nums = Object.keys(aliyot).filter(x => {
|
|
4359
|
+
if (x.length === 1) {
|
|
4360
|
+
return true;
|
|
4361
|
+
}
|
|
4362
|
+
const code = x.charCodeAt(0);
|
|
4363
|
+
return code >= 48 && code <= 57;
|
|
4364
|
+
});
|
|
4365
|
+
let start = aliyot[nums[0]];
|
|
4366
|
+
let end = start;
|
|
4367
|
+
const parts = [];
|
|
4368
|
+
for (let i = 0; i < nums.length; i++) {
|
|
4369
|
+
const num = nums[i];
|
|
4370
|
+
const aliyah = aliyot[num];
|
|
4371
|
+
if (i === nums.length - 1 && aliyah.k === end.k && aliyah.e === end.e) {
|
|
4372
|
+
// short-circuit when final aliyah is within the previous (e.g. M inside of 7)
|
|
4373
|
+
continue;
|
|
4374
|
+
}
|
|
4375
|
+
const prevEndChap = +end.e.split(':')[0];
|
|
4376
|
+
const curStartChap = +aliyah.b.split(':')[0];
|
|
4377
|
+
const sameOrNextChap = curStartChap === prevEndChap || curStartChap === prevEndChap + 1;
|
|
4378
|
+
if (i !== 0 &&
|
|
4379
|
+
(aliyah.k !== start.k ||
|
|
4380
|
+
isChapVerseBefore(aliyah.b, start.e) ||
|
|
4381
|
+
!sameOrNextChap)) {
|
|
4382
|
+
parts.push({ k: start.k, b: start.b, e: end.e });
|
|
4383
|
+
start = aliyah;
|
|
4384
|
+
}
|
|
4385
|
+
end = aliyah;
|
|
4386
|
+
}
|
|
4387
|
+
parts.push({ k: start.k, b: start.b, e: end.e });
|
|
4388
|
+
return parts;
|
|
4389
|
+
}
|
|
4390
|
+
/**
|
|
4391
|
+
* Returns a string representation of the leyning parts.
|
|
4392
|
+
* Separate verse ranges read from the same book are separated
|
|
4393
|
+
* by commas, e.g. `Isaiah 6:1-7:6, 9:5-6`.
|
|
4394
|
+
* Verse ranges from different books are separated by semicolons,
|
|
4395
|
+
* e.g. `Genesis 21:1-34; Numbers 29:1-6`.
|
|
4396
|
+
*/
|
|
4397
|
+
function makeSummaryFromParts(parts) {
|
|
4398
|
+
if (!Array.isArray(parts)) {
|
|
4399
|
+
parts = [parts];
|
|
4400
|
+
}
|
|
4401
|
+
let prev = parts[0];
|
|
4402
|
+
let summary = formatAliyahShort(prev, true);
|
|
4403
|
+
for (let i = 1; i < parts.length; i++) {
|
|
4404
|
+
const part = parts[i];
|
|
4405
|
+
if (part.k === prev.k) {
|
|
4406
|
+
summary += ', ';
|
|
4407
|
+
}
|
|
4408
|
+
else {
|
|
4409
|
+
summary += `; ${part.k} `;
|
|
4410
|
+
}
|
|
4411
|
+
summary += formatAliyahShort(part, false);
|
|
4412
|
+
prev = part;
|
|
4413
|
+
}
|
|
4414
|
+
return summary;
|
|
4415
|
+
}
|
|
4416
|
+
|
|
4417
|
+
/*! @hebcal/leyning v9.0.1 */
|
|
4418
|
+
|
|
4419
|
+
const parshiyotObj = parshiyotObj0;
|
|
4420
|
+
/**
|
|
4421
|
+
* on doubled parshiot, read only the second Haftarah
|
|
4422
|
+
* except for Nitzavim-Vayelech and Achrei Mot-Kedoshim
|
|
4423
|
+
* @private
|
|
4424
|
+
*/
|
|
4425
|
+
function getHaftaraKey(parsha) {
|
|
4426
|
+
const first = parsha[0];
|
|
4427
|
+
if (parsha.length === 2 && first === 'Achrei Mot') {
|
|
4428
|
+
return parshaToString(parsha); // 'Achrei Mot-Kedoshim'
|
|
4429
|
+
}
|
|
4430
|
+
if (parsha.length === 1 || first === 'Nitzavim') {
|
|
4431
|
+
return first;
|
|
4432
|
+
}
|
|
4433
|
+
else {
|
|
4434
|
+
return parsha[1];
|
|
4435
|
+
}
|
|
4436
|
+
}
|
|
4437
|
+
/**
|
|
4438
|
+
* Transliterated English and Hebrew names of this parsha
|
|
4439
|
+
* @param parsha untranslated name like ['Pinchas'] or ['Matot','Masei']
|
|
4440
|
+
*/
|
|
4441
|
+
function makeLeyningNames(parsha) {
|
|
4442
|
+
const name = parshaToString(parsha);
|
|
4443
|
+
return {
|
|
4444
|
+
en: name,
|
|
4445
|
+
he: parsha.map(s => Locale.lookupTranslation(s, 'he')).join('־'),
|
|
4446
|
+
};
|
|
4447
|
+
}
|
|
4448
|
+
/**
|
|
4449
|
+
* Looks up regular leyning for a weekly parsha with no special readings
|
|
4450
|
+
* @private
|
|
4451
|
+
* @param parsha untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei']
|
|
4452
|
+
* @returns map of aliyot
|
|
4453
|
+
*/
|
|
4454
|
+
function getLeyningForParshaShabbatOnly(parsha) {
|
|
4455
|
+
const raw = lookupParsha(parsha);
|
|
4456
|
+
const fullkriyah = {};
|
|
4457
|
+
const book = BOOK[raw.book];
|
|
4458
|
+
for (const [num, src] of Object.entries(raw.fullkriyah)) {
|
|
4459
|
+
const aliyah = { k: book, b: src[0], e: src[1] };
|
|
4460
|
+
calculateNumVerses(aliyah);
|
|
4461
|
+
fullkriyah[num] = aliyah;
|
|
4462
|
+
}
|
|
4463
|
+
const name = parshaToString(parsha);
|
|
4464
|
+
const parshaNameArray = raw.combined ? [raw.p1, raw.p2] : [name];
|
|
4465
|
+
const parts = makeLeyningParts(fullkriyah);
|
|
4466
|
+
const summary = makeSummaryFromParts(parts);
|
|
4467
|
+
const result = {
|
|
4468
|
+
name: makeLeyningNames(parshaNameArray),
|
|
4469
|
+
parsha: parshaNameArray,
|
|
4470
|
+
parshaNum: raw.num,
|
|
4471
|
+
summary,
|
|
4472
|
+
fullkriyah: fullkriyah,
|
|
4473
|
+
haftara: '',
|
|
4474
|
+
haft: [],
|
|
4475
|
+
};
|
|
4476
|
+
if (parts.length > 1) {
|
|
4477
|
+
result.summaryParts = parts;
|
|
4478
|
+
}
|
|
4479
|
+
const hkey = getHaftaraKey(parshaNameArray);
|
|
4480
|
+
const haft0 = parshiyotObj[hkey].haft;
|
|
4481
|
+
if (haft0) {
|
|
4482
|
+
const haft = (result.haft = cloneHaftara(haft0));
|
|
4483
|
+
result.haftara = makeSummaryFromParts(haft);
|
|
4484
|
+
result.haftaraNumV = sumVerses(haft);
|
|
4485
|
+
}
|
|
4486
|
+
const seph0 = parshiyotObj[hkey].seph;
|
|
4487
|
+
if (seph0) {
|
|
4488
|
+
const seph = (result.seph = cloneHaftara(seph0));
|
|
4489
|
+
result.sephardic = makeSummaryFromParts(seph);
|
|
4490
|
+
result.sephardicNumV = sumVerses(seph);
|
|
4491
|
+
}
|
|
4492
|
+
return result;
|
|
4493
|
+
}
|
|
4494
|
+
/**
|
|
4495
|
+
* Looks up leyning for a regular Shabbat parsha, including any special
|
|
4496
|
+
* maftir or Haftara.
|
|
4497
|
+
* @param ev the Hebcal event associated with this leyning
|
|
4498
|
+
* @param [il] in Israel
|
|
4499
|
+
* @returns map of aliyot
|
|
4500
|
+
*/
|
|
4501
|
+
function getLeyningForParshaHaShavua(ev, il = false) {
|
|
4502
|
+
if (typeof ev !== 'object' || typeof ev.getFlags !== 'function') {
|
|
4503
|
+
throw new TypeError(`Bad event argument: ${ev}`);
|
|
4504
|
+
}
|
|
4505
|
+
else if (ev.getFlags() !== flags.PARSHA_HASHAVUA) {
|
|
4506
|
+
throw new TypeError(`Event must be parsha hashavua: ${ev.getDesc()}`);
|
|
4507
|
+
}
|
|
4508
|
+
// first, collect the default aliyot and haftara
|
|
4509
|
+
const parsha = ev.parsha;
|
|
4510
|
+
const result = getLeyningForParshaShabbatOnly(parsha);
|
|
4511
|
+
const hd = ev.getDate();
|
|
4512
|
+
// Now, check for special maftir or haftara on same date
|
|
4513
|
+
const special = specialReadings2(parsha, hd, il, result.fullkriyah);
|
|
4514
|
+
const reason = special.reason;
|
|
4515
|
+
if (special.haft) {
|
|
4516
|
+
const haft = (result.haft = cloneHaftara(special.haft));
|
|
4517
|
+
result.haftara = makeSummaryFromParts(haft);
|
|
4518
|
+
result.haftaraNumV = sumVerses(haft);
|
|
4519
|
+
if (special.seph) {
|
|
4520
|
+
const seph = (result.seph = cloneHaftara(special.seph));
|
|
4521
|
+
result.sephardic = makeSummaryFromParts(seph);
|
|
4522
|
+
result.sephardicNumV = sumVerses(seph);
|
|
4523
|
+
}
|
|
4524
|
+
else if (result.seph) {
|
|
4525
|
+
delete result.seph;
|
|
4526
|
+
delete result.sephardic;
|
|
4527
|
+
delete result.sephardicNumV;
|
|
4528
|
+
}
|
|
4529
|
+
}
|
|
4530
|
+
if (reason['7'] || reason['M']) {
|
|
4531
|
+
result.fullkriyah = special.aliyot;
|
|
4532
|
+
const parts = makeLeyningParts(result.fullkriyah);
|
|
4533
|
+
result.summary = makeSummaryFromParts(parts);
|
|
4534
|
+
result.summaryParts = parts;
|
|
4535
|
+
}
|
|
4536
|
+
const reasons = Object.keys(reason);
|
|
4537
|
+
if (reasons.length !== 0) {
|
|
4538
|
+
result.reason = reason;
|
|
4539
|
+
for (const num of reasons) {
|
|
4540
|
+
if (num === 'haftara' || num === 'sephardic') {
|
|
4541
|
+
const haftObj = result[num === 'haftara' ? 'haft' : 'seph'];
|
|
4542
|
+
const hafts = Array.isArray(haftObj) ? haftObj : [haftObj];
|
|
4543
|
+
for (const haft of hafts) {
|
|
4544
|
+
haft.reason = reason[num];
|
|
4545
|
+
}
|
|
4546
|
+
}
|
|
4547
|
+
else {
|
|
4548
|
+
const aliyah = result.fullkriyah[num];
|
|
4549
|
+
if (typeof aliyah === 'object') {
|
|
4550
|
+
aliyah.reason = reason[num];
|
|
4551
|
+
}
|
|
4552
|
+
}
|
|
4553
|
+
}
|
|
4554
|
+
}
|
|
4555
|
+
return result;
|
|
4556
|
+
}
|
|
4557
|
+
/**
|
|
4558
|
+
* Returns the parsha metadata
|
|
4559
|
+
* @param parsha untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei']
|
|
4560
|
+
*/
|
|
4561
|
+
function lookupParsha(parsha) {
|
|
4562
|
+
const name = parshaToString(parsha);
|
|
4563
|
+
const raw = parshiyotObj[name];
|
|
4564
|
+
if (typeof raw !== 'object') {
|
|
4565
|
+
throw new TypeError(`Bad parsha argument: ${parsha}`);
|
|
4566
|
+
}
|
|
4567
|
+
if (raw.combined) {
|
|
4568
|
+
const [p1, p2] = name.split('-');
|
|
4569
|
+
if (!raw.hebrew) {
|
|
4570
|
+
raw.hebrew = Locale.gettext(p1, 'he') + '־' + Locale.gettext(p2, 'he');
|
|
4571
|
+
}
|
|
4572
|
+
if (!raw.haft) {
|
|
4573
|
+
const haftKey = p1 === 'Nitzavim' ? p1 : p2;
|
|
4574
|
+
raw.haft = lookupParsha(haftKey).haft;
|
|
4575
|
+
}
|
|
4576
|
+
}
|
|
4577
|
+
return raw;
|
|
4578
|
+
}
|
|
4579
|
+
|
|
4580
|
+
/*! @hebcal/leyning v9.0.1 */
|
|
4581
|
+
|
|
4582
|
+
/**
|
|
4583
|
+
* Looks up leyning for a given holiday key. Key should be an
|
|
4584
|
+
* (untranslated) string used in holiday-readings.json. Returns some
|
|
4585
|
+
* of full kriyah aliyot, special Maftir, special Haftarah
|
|
4586
|
+
* @param key name from `holiday-readings.json` to find
|
|
4587
|
+
*/
|
|
4588
|
+
function getLeyningForHolidayKey(key, cholHaMoedDay, il) {
|
|
4589
|
+
if (typeof key !== 'string') {
|
|
4590
|
+
return undefined;
|
|
4591
|
+
}
|
|
4592
|
+
const src = lookupFestival(key);
|
|
4593
|
+
if (typeof src === 'undefined') {
|
|
4594
|
+
return undefined;
|
|
4595
|
+
}
|
|
4596
|
+
const israelOnly = src.il;
|
|
4597
|
+
if (typeof israelOnly === 'boolean' &&
|
|
4598
|
+
typeof il === 'boolean' &&
|
|
4599
|
+
il !== israelOnly) {
|
|
4600
|
+
return undefined;
|
|
4601
|
+
}
|
|
4602
|
+
const leyning = {
|
|
4603
|
+
name: {
|
|
4604
|
+
en: key,
|
|
4605
|
+
he: Locale.lookupTranslation(key, 'he'),
|
|
4606
|
+
},
|
|
4607
|
+
};
|
|
4608
|
+
if (src.fullkriyah) {
|
|
4609
|
+
leyning.fullkriyah = clone(src.fullkriyah);
|
|
4610
|
+
if (key === 'Sukkot Shabbat Chol ha-Moed' && cholHaMoedDay) {
|
|
4611
|
+
leyning.fullkriyah['M'] = leyning.fullkriyah[`M-day${cholHaMoedDay}`];
|
|
4612
|
+
for (let day = 1; day <= 5; day++) {
|
|
4613
|
+
delete leyning.fullkriyah[`M-day${day}`];
|
|
4614
|
+
}
|
|
4615
|
+
}
|
|
4616
|
+
if (typeof leyning.fullkriyah['1'] === 'object') {
|
|
4617
|
+
const parts = makeLeyningParts(leyning.fullkriyah);
|
|
4618
|
+
leyning.summary = makeSummaryFromParts(parts);
|
|
4619
|
+
if (parts.length > 1) {
|
|
4620
|
+
leyning.summaryParts = parts;
|
|
4621
|
+
}
|
|
4622
|
+
}
|
|
4623
|
+
Object.values(leyning.fullkriyah).map(aliyah => calculateNumVerses(aliyah));
|
|
4624
|
+
}
|
|
4625
|
+
if (src.haft) {
|
|
4626
|
+
const haft = (leyning.haft = cloneHaftara(src.haft));
|
|
4627
|
+
leyning.haftara = makeSummaryFromParts(haft);
|
|
4628
|
+
leyning.haftaraNumV = sumVerses(haft);
|
|
4629
|
+
}
|
|
4630
|
+
if (src.seph) {
|
|
4631
|
+
const seph = (leyning.seph = cloneHaftara(src.seph));
|
|
4632
|
+
leyning.sephardic = makeSummaryFromParts(seph);
|
|
4633
|
+
leyning.sephardicNumV = sumVerses(seph);
|
|
4634
|
+
}
|
|
4635
|
+
let megillah = src.megillah;
|
|
4636
|
+
if (il && key === 'Pesach I (on Shabbat)')
|
|
4637
|
+
megillah = 'Song of Songs';
|
|
4638
|
+
if (megillah) {
|
|
4639
|
+
const chaps = NUM_VERSES[megillah];
|
|
4640
|
+
const m = {};
|
|
4641
|
+
for (let i = 1; i < chaps.length; i++) {
|
|
4642
|
+
const numv = chaps[i];
|
|
4643
|
+
m[`${i}`] = { k: megillah, b: `${i}:1`, e: `${i}:${numv}`, v: numv };
|
|
4644
|
+
}
|
|
4645
|
+
leyning.megillah = m;
|
|
4646
|
+
}
|
|
4647
|
+
if (src.note) {
|
|
4648
|
+
leyning.note = src.note;
|
|
4649
|
+
}
|
|
4650
|
+
return leyning;
|
|
4651
|
+
}
|
|
4652
|
+
/**
|
|
4653
|
+
* Looks up leyning for a given holiday. Returns some
|
|
4654
|
+
* of full kriyah aliyot, special Maftir, special Haftarah
|
|
4655
|
+
* @param ev the Hebcal event associated with this leyning
|
|
4656
|
+
* @param [il] true if Israel holiday scheme
|
|
4657
|
+
* @returns map of aliyot
|
|
4658
|
+
*/
|
|
4659
|
+
function getLeyningForHoliday(ev, il = false) {
|
|
4660
|
+
if (typeof ev !== 'object' || typeof ev.getFlags !== 'function') {
|
|
4661
|
+
throw new TypeError(`Bad event argument: ${JSON.stringify(ev)}`);
|
|
4662
|
+
}
|
|
4663
|
+
else if (typeof ev.eventTime !== 'undefined') {
|
|
4664
|
+
return undefined;
|
|
4665
|
+
}
|
|
4666
|
+
else if (ev.getFlags() & flags.PARSHA_HASHAVUA) {
|
|
4667
|
+
throw new TypeError(`Event should be a holiday: ${ev.getDesc()}`);
|
|
4668
|
+
}
|
|
4669
|
+
else if (ev.getFlags() & HOLIDAY_IGNORE_MASK$1) {
|
|
4670
|
+
return undefined;
|
|
4671
|
+
}
|
|
4672
|
+
const key = getLeyningKeyForEvent(ev, il);
|
|
4673
|
+
const leyning = getLeyningForHolidayKey(key, ev.cholHaMoedDay, il);
|
|
4674
|
+
return leyning;
|
|
4675
|
+
}
|
|
427
4676
|
|
|
428
4677
|
var holidayDescription0 = {
|
|
429
4678
|
"Asara B'Tevet": "Fast commemorating the siege of Jerusalem",
|
|
@@ -502,7 +4751,8 @@ var holidayDescription0 = {
|
|
|
502
4751
|
* makeAnchor('Rosh Chodesh Adar II') // 'rosh-chodesh-adar-ii'
|
|
503
4752
|
*/
|
|
504
4753
|
function makeAnchor(s) {
|
|
505
|
-
return s
|
|
4754
|
+
return s
|
|
4755
|
+
.toLowerCase()
|
|
506
4756
|
.replace(/'/g, '')
|
|
507
4757
|
.replace(/[^\w]/g, '-')
|
|
508
4758
|
.replace(/-+/g, '-')
|
|
@@ -528,7 +4778,7 @@ const doubled = new Set();
|
|
|
528
4778
|
for (const name of doubledParshiyot) {
|
|
529
4779
|
const anchor = makeAnchor(name);
|
|
530
4780
|
doubled.add(anchor);
|
|
531
|
-
const [p1
|
|
4781
|
+
const [p1] = anchor.split('-');
|
|
532
4782
|
const id = parsha2id.get(p1);
|
|
533
4783
|
parsha2id.set(anchor, id);
|
|
534
4784
|
}
|
|
@@ -586,34 +4836,42 @@ function getEventCategories(ev) {
|
|
|
586
4836
|
* Returns an English language description of the holiday
|
|
587
4837
|
*/
|
|
588
4838
|
function getHolidayDescription(ev, firstSentence = false) {
|
|
589
|
-
const str0 = ev.getFlags() & core.flags.SHABBAT_MEVARCHIM
|
|
590
|
-
holidayDescription['Shabbat Mevarchim Chodesh']
|
|
591
|
-
holidayDescription[ev.getDesc()] ||
|
|
4839
|
+
const str0 = ev.getFlags() & core.flags.SHABBAT_MEVARCHIM
|
|
4840
|
+
? holidayDescription['Shabbat Mevarchim Chodesh']
|
|
4841
|
+
: holidayDescription[ev.getDesc()] ||
|
|
4842
|
+
holidayDescription[ev.basename()] ||
|
|
4843
|
+
'';
|
|
592
4844
|
const str = str0.normalize();
|
|
593
4845
|
if (firstSentence && str) {
|
|
594
4846
|
const dot = str.indexOf('.');
|
|
595
|
-
if (dot
|
|
4847
|
+
if (dot !== -1) {
|
|
596
4848
|
return str.substring(0, dot);
|
|
597
4849
|
}
|
|
598
4850
|
}
|
|
599
4851
|
return str;
|
|
600
4852
|
}
|
|
601
|
-
const HOLIDAY_IGNORE_MASK = core.flags.DAF_YOMI |
|
|
602
|
-
core.flags.
|
|
603
|
-
core.flags.
|
|
604
|
-
core.flags.
|
|
4853
|
+
const HOLIDAY_IGNORE_MASK = core.flags.DAF_YOMI |
|
|
4854
|
+
core.flags.OMER_COUNT |
|
|
4855
|
+
core.flags.SHABBAT_MEVARCHIM |
|
|
4856
|
+
core.flags.MOLAD |
|
|
4857
|
+
core.flags.USER_EVENT |
|
|
4858
|
+
core.flags.NACH_YOMI |
|
|
4859
|
+
core.flags.DAILY_LEARNING |
|
|
4860
|
+
core.flags.HEBREW_DATE |
|
|
4861
|
+
core.flags.YERUSHALMI_YOMI;
|
|
605
4862
|
/**
|
|
606
4863
|
* Makes mulit-line text that summarizes Torah & Haftarah
|
|
607
4864
|
*/
|
|
608
4865
|
function makeTorahMemoText(ev, il) {
|
|
609
4866
|
var _a;
|
|
610
4867
|
const mask = ev.getFlags();
|
|
611
|
-
if (
|
|
4868
|
+
if (mask & HOLIDAY_IGNORE_MASK ||
|
|
4869
|
+
typeof ev.eventTime !== 'undefined') {
|
|
612
4870
|
return '';
|
|
613
4871
|
}
|
|
614
|
-
const reading =
|
|
615
|
-
|
|
616
|
-
|
|
4872
|
+
const reading = mask & core.flags.PARSHA_HASHAVUA
|
|
4873
|
+
? getLeyningForParshaHaShavua(ev, il)
|
|
4874
|
+
: getLeyningForHoliday(ev, il);
|
|
617
4875
|
let memo = '';
|
|
618
4876
|
if (reading && (reading.summary || reading.haftara)) {
|
|
619
4877
|
if (reading.summary) {
|
|
@@ -673,7 +4931,8 @@ function appendIsraelAndTracking(url, il, utmSource, utmMedium, utmCampaign) {
|
|
|
673
4931
|
else if (isSedrot) {
|
|
674
4932
|
shortenSedrotUrl(u);
|
|
675
4933
|
}
|
|
676
|
-
else {
|
|
4934
|
+
else {
|
|
4935
|
+
// isOmer
|
|
677
4936
|
u.pathname = '/o/' + path.substring(6);
|
|
678
4937
|
}
|
|
679
4938
|
{
|
|
@@ -703,12 +4962,14 @@ function shouldRenderBrief(ev) {
|
|
|
703
4962
|
const mask = ev.getFlags();
|
|
704
4963
|
if (mask & core.flags.HEBREW_DATE) {
|
|
705
4964
|
const hd = ev.getDate();
|
|
706
|
-
return
|
|
4965
|
+
return hd.getDate() === 1 ? false : true;
|
|
707
4966
|
}
|
|
708
|
-
else if (mask &
|
|
4967
|
+
else if (mask &
|
|
4968
|
+
(core.flags.DAILY_LEARNING | core.flags.DAF_YOMI | core.flags.YERUSHALMI_YOMI)) {
|
|
709
4969
|
return true;
|
|
710
4970
|
}
|
|
711
|
-
else if (mask & core.flags.MINOR_FAST &&
|
|
4971
|
+
else if (mask & core.flags.MINOR_FAST &&
|
|
4972
|
+
ev.getDesc().substring(0, 16) === 'Yom Kippur Katan') {
|
|
712
4973
|
return true;
|
|
713
4974
|
}
|
|
714
4975
|
else if (mask & core.flags.SHABBAT_MEVARCHIM) {
|
|
@@ -725,15 +4986,16 @@ function shouldRenderBrief(ev) {
|
|
|
725
4986
|
function eventToFullCalendar(ev, tzid, il) {
|
|
726
4987
|
const classes = getEventCategories(ev);
|
|
727
4988
|
const mask = ev.getFlags();
|
|
728
|
-
if (classes[0]
|
|
4989
|
+
if (classes[0] === 'holiday' && mask & core.flags.CHAG) {
|
|
729
4990
|
classes.push('yomtov');
|
|
730
4991
|
}
|
|
731
|
-
const
|
|
4992
|
+
const timedEv = ev;
|
|
4993
|
+
const eventTime = timedEv.eventTime;
|
|
732
4994
|
const timed = Boolean(eventTime);
|
|
733
4995
|
const title = shouldRenderBrief(ev) ? ev.renderBrief() : ev.render();
|
|
734
|
-
const start = timed
|
|
735
|
-
core.Zmanim.formatISOWithTimeZone(tzid, eventTime)
|
|
736
|
-
isoDateString(ev.getDate().greg());
|
|
4996
|
+
const start = timed
|
|
4997
|
+
? core.Zmanim.formatISOWithTimeZone(tzid, eventTime)
|
|
4998
|
+
: isoDateString(ev.getDate().greg());
|
|
737
4999
|
const result = {
|
|
738
5000
|
title,
|
|
739
5001
|
start,
|
|
@@ -755,8 +5017,8 @@ function eventToFullCalendar(ev, tzid, il) {
|
|
|
755
5017
|
if (memo) {
|
|
756
5018
|
result.description = memo;
|
|
757
5019
|
}
|
|
758
|
-
else if (typeof
|
|
759
|
-
result.description =
|
|
5020
|
+
else if (typeof timedEv.linkedEvent !== 'undefined') {
|
|
5021
|
+
result.description = timedEv.linkedEvent.render();
|
|
760
5022
|
}
|
|
761
5023
|
}
|
|
762
5024
|
return result;
|
|
@@ -766,4 +5028,4 @@ exports.eventToFullCalendar = eventToFullCalendar;
|
|
|
766
5028
|
|
|
767
5029
|
return exports;
|
|
768
5030
|
|
|
769
|
-
})({}, hebcal
|
|
5031
|
+
})({}, hebcal);
|