@hebcal/leyning 9.3.0 → 9.4.1
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 +535 -384
- package/dist/bundle.min.js +15 -14
- package/dist/esm/aliyot.json.js +1 -1
- package/dist/esm/ashkenazi.po.js +2 -2
- package/dist/esm/clone.d.ts +2 -1
- package/dist/esm/clone.js +4 -3
- package/dist/esm/common.d.ts +0 -4
- package/dist/esm/common.js +2 -17
- package/dist/esm/csv.js +4 -4
- package/dist/esm/festival.js +6 -8
- package/dist/esm/format.d.ts +6 -0
- package/dist/esm/format.js +40 -0
- package/dist/esm/getLeyningForHoliday.d.ts +6 -2
- package/dist/esm/getLeyningForHoliday.js +19 -11
- package/dist/esm/getLeyningKeyForEvent.js +5 -2
- package/dist/esm/getLeyningOnDate.d.ts +3 -2
- package/dist/esm/getLeyningOnDate.js +13 -5
- package/dist/esm/he.po.d.ts +44 -2
- package/dist/esm/he.po.js +2 -2
- package/dist/esm/holiday-readings.json.js +1 -1
- package/dist/esm/index.d.ts +2 -1
- package/dist/esm/index.js +4 -3
- package/dist/esm/leyning.d.ts +4 -4
- package/dist/esm/leyning.js +26 -16
- package/dist/esm/locale.js +1 -1
- package/dist/esm/numverses.json.js +1 -1
- package/dist/esm/specialReadings.js +6 -6
- package/dist/esm/summary.d.ts +7 -7
- package/dist/esm/summary.js +30 -28
- package/dist/esm/translate.d.ts +35 -0
- package/dist/esm/translate.js +106 -0
- package/package.json +13 -12
package/dist/bundle.js
CHANGED
|
@@ -1,305 +1,17 @@
|
|
|
1
|
-
/*! @hebcal/leyning v9.
|
|
1
|
+
/*! @hebcal/leyning v9.4.1 */
|
|
2
2
|
var hebcal__leyning = (function (exports, locale, event, holidays, sedra, ParshaEvent) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
|
-
var poHe$1 = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);", "language": "he_IL" }, "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
|
|
5
|
+
var poHe$1 = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);", "language": "he_IL" }, "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 VII (on Shabbat)": ["פֶּסַח ז׳ (בְּשַׁבָּת)"], "Pesach VIII (on Shabbat)": ["פֶּסַח ח׳ (בְּשַׁבָּת)"], "Shavuot II (on Shabbat)": ["שָׁבוּעוֹת יוֹם ב׳ (בְּשַׁבָּת)"], "Fast Day (Morning)": ["תַּעֲנִית (שַׁחֲרִית)"], "Fast Day (Afternoon)": ["תַּעֲנִית (מִנְחָה)"], "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 Final Day (Hoshana Raba)": ["סוּכּוֹת ז׳ (הוֹשַׁעְנָא רַבָּה)"], "Shmini Atzeret (on Shabbat)": ["שְׁמִינִי עֲצֶרֶת (בְּשַׁבָּת)"], "Simchat Torah (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": ["שַׁבָּת רֹאשׁ חוֹדֶשׁ חֲנוּכָּה"], "Shushan Purim (on Shabbat)": ["שׁוּשַׁן פּוּרִים (בְּשַׁבָּת)"], "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)": ["צוֹם י״ז בְּתַמּוּז (מִנְחָה)"], "Genesis": ["בְּרֵאשִׁית"], "Exodus": ["שְׁמוֹת"], "Leviticus": ["וַיִּקְרָא"], "Numbers": ["בְּמִדְבַּר"], "Deuteronomy": ["דְּבָרִים"], "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": ["מַלְאָכִי"], "Song of Songs": ["שִׁיר הַשִּׁירִים"], "Ruth": ["רוּת"], "Lamentations": ["אֵיכָה"], "Ecclesiastes": ["קֹהֶלֶת"], "Esther": ["אֶסְתֵּר"], "Pinchas occurring after 17 Tammuz": ["פִּינְחָס מתרחש לאחר יז׳ בְּתַמּוּז"], "Kedoshim following Special Shabbat": ["קְדֹשִׁים לאחר שַׁבָּת מיוחדת"], "Masei on Shabbat Rosh Chodesh": ["מַסְעֵי בְּשַׁבָּת רֹאשׁ חוֹדֶשׁ"], "Matot-Masei on Shabbat Rosh Chodesh": ["מַטּוֹת־מַסְעֵי בְּשַׁבָּת רֹאשׁ חוֹדֶשׁ"], "Ki Teitzei with 3rd Haftarah of Consolation": ["כִּי־תֵצֵא עם הַפְטָרָה שְׁלִישִׁית שֶׁל נֶחָמָה"], "Shabbat HaChodesh (on Rosh Chodesh)": ["שַׁבָּת הַחוֹדֶשׁ (בְּרֹאשׁ חוֹדֶשׁ)"], "Shabbat Shekalim (on Rosh Chodesh)": ["שַׁבָּת שְׁקָלִים (רֹאשׁ חוֹדֶשׁ)"], "Shabbat Shuva (with Vayeilech)": ["שַׁבַּת שׁוּבָה (עם וַיֵּלֶךְ)"], "Shabbat Shuva (with Ha'azinu)": ["שַׁבַּת שׁוּבָה (עם הַאֲזִינוּ)"] } } };
|
|
6
6
|
|
|
7
|
-
var poAshkenazi$1 = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);", "language": "en_CA@ashkenazi" }, "contexts": { "": { "Shabbat Machar Chodesh": ["Shabbos Machar Chodesh"], "Shabbat Rosh Chodesh": ["Shabbos Rosh Chodesh"], "Pesach I (on Shabbat)": ["Pesach I (on Shabbos)"], "Pesach Shabbat Chol ha-Moed": ["Pesach Shabbos Chol ha-Moed"], "Pesach VII (on Shabbat)": ["Pesach VII (on Shabbos)"], "Pesach VIII (on Shabbat)": ["Pesach VIII (on Shabbos)"], "Shavuot II (on Shabbat)": ["Shavuos II (on Shabbos)"], "Rosh Hashana I (on Shabbat)": ["Rosh Hashana I (on Shabbos)"], "Yom Kippur (on Shabbat)": ["Yom Kippur (on Shabbos)"], "Sukkot I (on Shabbat)": ["Sukkos I (on Shabbos)"], "Sukkot Chol ha-Moed Day 1": ["Sukkos Chol ha-Moed Day 1"], "Sukkot Chol ha-Moed Day 2": ["Sukkos Chol ha-Moed Day 2"], "Sukkot Chol ha-Moed Day 3": ["Sukkos Chol ha-Moed Day 3"], "Sukkot Chol ha-Moed Day 4": ["Sukkos Chol ha-Moed Day 4"], "Sukkot Chol ha-Moed Day 5": ["Sukkos Chol ha-Moed Day 5"], "Sukkot Shabbat Chol ha-Moed": ["Sukkos Shabbos Chol ha-Moed"], "Sukkot Final Day (Hoshana Raba)": ["Sukkos Final Day (Hoshana Raba)"], "Shmini Atzeret (on Shabbat)": ["Shmini Atzeres (on Shabbos)"], "Chanukah Day 1 (on Shabbat)": ["Chanukah Day 1 (on Shabbos)"], "Chanukah Day 2 (on Shabbat)": ["Chanukah Day 2 (on Shabbos)"], "Chanukah Day 3 (on Shabbat)": ["Chanukah Day 3 (on Shabbos)"], "Chanukah Day 4 (on Shabbat)": ["Chanukah Day 4 (on Shabbos)"], "Chanukah Day 5 (on Shabbat)": ["Chanukah Day 5 (on Shabbos)"], "Chanukah Day 7 (on Shabbat)": ["Chanukah Day 7 (on Shabbos)"], "Chanukah Day 8 (on Shabbat)": ["Chanukah Day 8 (on Shabbos)"], "Shabbat Rosh Chodesh Chanukah": ["Shabbos Rosh Chodesh Chanukah"], "Asara B'Tevet (Mincha)": ["Asara B’Teves (Mincha)"], "Ta'anit Bechorot (Mincha)": ["Ta’anis
|
|
7
|
+
var poAshkenazi$1 = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);", "language": "en_CA@ashkenazi" }, "contexts": { "": { "Shabbat Machar Chodesh": ["Shabbos Machar Chodesh"], "Shabbat Rosh Chodesh": ["Shabbos Rosh Chodesh"], "Pesach I (on Shabbat)": ["Pesach I (on Shabbos)"], "Pesach Shabbat Chol ha-Moed": ["Pesach Shabbos Chol ha-Moed"], "Pesach VII (on Shabbat)": ["Pesach VII (on Shabbos)"], "Pesach VIII (on Shabbat)": ["Pesach VIII (on Shabbos)"], "Shavuot II (on Shabbat)": ["Shavuos II (on Shabbos)"], "Rosh Hashana I (on Shabbat)": ["Rosh Hashana I (on Shabbos)"], "Yom Kippur (on Shabbat)": ["Yom Kippur (on Shabbos)"], "Sukkot I (on Shabbat)": ["Sukkos I (on Shabbos)"], "Sukkot Chol ha-Moed Day 1": ["Sukkos Chol ha-Moed Day 1"], "Sukkot Chol ha-Moed Day 2": ["Sukkos Chol ha-Moed Day 2"], "Sukkot Chol ha-Moed Day 3": ["Sukkos Chol ha-Moed Day 3"], "Sukkot Chol ha-Moed Day 4": ["Sukkos Chol ha-Moed Day 4"], "Sukkot Chol ha-Moed Day 5": ["Sukkos Chol ha-Moed Day 5"], "Sukkot Shabbat Chol ha-Moed": ["Sukkos Shabbos Chol ha-Moed"], "Sukkot Final Day (Hoshana Raba)": ["Sukkos Final Day (Hoshana Raba)"], "Shmini Atzeret (on Shabbat)": ["Shmini Atzeres (on Shabbos)"], "Chanukah Day 1 (on Shabbat)": ["Chanukah Day 1 (on Shabbos)"], "Chanukah Day 2 (on Shabbat)": ["Chanukah Day 2 (on Shabbos)"], "Chanukah Day 3 (on Shabbat)": ["Chanukah Day 3 (on Shabbos)"], "Chanukah Day 4 (on Shabbat)": ["Chanukah Day 4 (on Shabbos)"], "Chanukah Day 5 (on Shabbat)": ["Chanukah Day 5 (on Shabbos)"], "Chanukah Day 7 (on Shabbat)": ["Chanukah Day 7 (on Shabbos)"], "Chanukah Day 8 (on Shabbat)": ["Chanukah Day 8 (on Shabbos)"], "Shabbat Rosh Chodesh Chanukah": ["Shabbos Rosh Chodesh Chanukah"], "Asara B'Tevet (Mincha)": ["Asara B’Teves (Mincha)"], "Ta'anit Bechorot (Mincha)": ["Ta’anis Bechoros (Mincha)"], "Ta'anit Esther (Mincha)": ["Ta’anis Esther (Mincha)"] } } };
|
|
8
8
|
|
|
9
9
|
locale.Locale.addTranslations('ashkenazi', poAshkenazi$1);
|
|
10
10
|
locale.Locale.addTranslations('he', poHe$1);
|
|
11
11
|
const poHeNoNikud$1 = locale.Locale.copyLocaleNoNikud(poHe$1);
|
|
12
12
|
locale.Locale.addTranslations('he-x-NoNikud', poHeNoNikud$1);
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Names of the books of the Torah.
|
|
18
|
-
*
|
|
19
|
-
* `BOOK[1] === 'Genesis'`
|
|
20
|
-
* @readonly
|
|
21
|
-
*/
|
|
22
|
-
const BOOK = [
|
|
23
|
-
'',
|
|
24
|
-
'Genesis',
|
|
25
|
-
'Exodus',
|
|
26
|
-
'Leviticus',
|
|
27
|
-
'Numbers',
|
|
28
|
-
'Deuteronomy',
|
|
29
|
-
];
|
|
30
|
-
/**
|
|
31
|
-
* The number of verses in each book of the Tanakh.
|
|
32
|
-
* Indexed by English transliterated name of book,
|
|
33
|
-
* and arrays are 1-based.
|
|
34
|
-
*
|
|
35
|
-
* There are 51 chapters in Genesis, so
|
|
36
|
-
* `NUM_VERSES['Genesis'].length === 51`.
|
|
37
|
-
*
|
|
38
|
-
* There are 26 verses in Genesis chapter 4,
|
|
39
|
-
* so `NUM_VERSES['Genesis'][4] === 26`.
|
|
40
|
-
* @readonly
|
|
41
|
-
*/
|
|
42
|
-
const NUM_VERSES = numverses;
|
|
43
|
-
/**
|
|
44
|
-
* Formats parsha as a string
|
|
45
|
-
* @param parsha untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei']
|
|
46
|
-
*/
|
|
47
|
-
function parshaToString(parsha) {
|
|
48
|
-
if (typeof parsha === 'string') {
|
|
49
|
-
return parsha;
|
|
50
|
-
}
|
|
51
|
-
else if (!Array.isArray(parsha) ||
|
|
52
|
-
parsha.length === 0 ||
|
|
53
|
-
parsha.length > 2) {
|
|
54
|
-
throw new TypeError(`Bad parsha argument: ${parsha}`);
|
|
55
|
-
}
|
|
56
|
-
let s = parsha[0];
|
|
57
|
-
if (parsha.length === 2) {
|
|
58
|
-
s += '-' + parsha[1];
|
|
59
|
-
}
|
|
60
|
-
return s;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Calculates the number of verses in an aliyah or haftara based on
|
|
64
|
-
* the `b` (begin verse), `e` (end verse) and `k` (book).
|
|
65
|
-
* Modifies `aliyah` by setting the `v` field.
|
|
66
|
-
*/
|
|
67
|
-
function calculateNumVerses(aliyah) {
|
|
68
|
-
if (aliyah.v) {
|
|
69
|
-
return aliyah.v;
|
|
70
|
-
}
|
|
71
|
-
aliyah.v = subtractVerses(aliyah.k, aliyah.b, aliyah.e) + 1;
|
|
72
|
-
return aliyah.v;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Finds the number of verses between two locations in the same book.
|
|
76
|
-
* @param book The English name of the book (e.g. "Numbers")
|
|
77
|
-
* @param from The starting verse (e.g. "28:9")
|
|
78
|
-
* @param to The ending verse (e.g. "28:15")
|
|
79
|
-
* @returns The number of verses between the two locations, excluding the `to` verse.
|
|
80
|
-
*/
|
|
81
|
-
function subtractVerses(book, from, to) {
|
|
82
|
-
const chapVerseBegin = from.split(':');
|
|
83
|
-
const chapVerseEnd = to.split(':');
|
|
84
|
-
const c1 = parseInt(chapVerseBegin[0], 10);
|
|
85
|
-
const c2 = parseInt(chapVerseEnd[0], 10);
|
|
86
|
-
const v1 = parseInt(chapVerseBegin[1], 10);
|
|
87
|
-
const v2 = parseInt(chapVerseEnd[1], 10);
|
|
88
|
-
let result = 0;
|
|
89
|
-
if (c1 === c2) {
|
|
90
|
-
return v2 - v1;
|
|
91
|
-
}
|
|
92
|
-
const numv = NUM_VERSES[book];
|
|
93
|
-
if (typeof numv !== 'object' || !numv.length) {
|
|
94
|
-
throw new ReferenceError(`Can't find numverses for ${book}`);
|
|
95
|
-
}
|
|
96
|
-
let total = numv[c1] - v1;
|
|
97
|
-
for (let chap = c1 + 1; chap < c2; chap++) {
|
|
98
|
-
total += numv[chap];
|
|
99
|
-
}
|
|
100
|
-
total += v2;
|
|
101
|
-
result = total;
|
|
102
|
-
return result;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Calculates the next verse after adding a number of verses to a given location.
|
|
106
|
-
* @param book The English name of the book (e.g. "Numbers")
|
|
107
|
-
* @param from The starting verse (e.g. "28:9")
|
|
108
|
-
* @param numVerses The number of verses to add; must be nonnegative.
|
|
109
|
-
* @returns The next verse after adding the specified number of verses,
|
|
110
|
-
* or null if the resulting verse exceeds the number of verses
|
|
111
|
-
* in the book.
|
|
112
|
-
*/
|
|
113
|
-
function addVerses(book, from, numVerses) {
|
|
114
|
-
const chapVerseBegin = from.split(':');
|
|
115
|
-
const c1 = parseInt(chapVerseBegin[0], 10);
|
|
116
|
-
const v1 = parseInt(chapVerseBegin[1], 10);
|
|
117
|
-
const numv = NUM_VERSES[book];
|
|
118
|
-
if (typeof numv !== 'object' || !numv.length) {
|
|
119
|
-
throw new ReferenceError(`Can't find numverses for ${book}`);
|
|
120
|
-
}
|
|
121
|
-
let total = v1 + numVerses;
|
|
122
|
-
let c2 = c1;
|
|
123
|
-
while (total > numv[c2]) {
|
|
124
|
-
total -= numv[c2];
|
|
125
|
-
c2++;
|
|
126
|
-
if (!numv[c2])
|
|
127
|
-
return null;
|
|
128
|
-
}
|
|
129
|
-
return `${c2}:${total}`;
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Formats an aliyah object like "Numbers 28:9-28:15"
|
|
133
|
-
*/
|
|
134
|
-
function formatAliyahWithBook(a) {
|
|
135
|
-
return `${a.k} ${a.b}-${a.e}`;
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Formats an aliyah object like "Numbers 28:9-15"
|
|
139
|
-
*/
|
|
140
|
-
function formatAliyahShort(aliyah, showBook) {
|
|
141
|
-
const begin = aliyah.b;
|
|
142
|
-
const end0 = aliyah.e;
|
|
143
|
-
const prefix = showBook ? aliyah.k + ' ' : '';
|
|
144
|
-
if (begin === end0) {
|
|
145
|
-
return `${prefix}${begin}`;
|
|
146
|
-
}
|
|
147
|
-
const cv1 = begin.split(':');
|
|
148
|
-
const cv2 = end0.split(':');
|
|
149
|
-
const end = cv1[0] === cv2[0] ? cv2[1] : end0;
|
|
150
|
-
return `${prefix}${begin}-${end}`;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* @private
|
|
155
|
-
*/
|
|
156
|
-
function isChapVerseBefore(a, b) {
|
|
157
|
-
const cv1 = a.split(':').map(x => +x);
|
|
158
|
-
const cv2 = b.split(':').map(x => +x);
|
|
159
|
-
return cv1[0] * 100 + cv1[1] < cv2[0] * 100 + cv2[1];
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Summarizes an `AliyotMap` by collapsing all adjacent aliyot.
|
|
163
|
-
* Finds any non-overlapping parts (e.g. special 7th aliyah or maftir)
|
|
164
|
-
*/
|
|
165
|
-
function makeLeyningParts(aliyot) {
|
|
166
|
-
const nums = Object.keys(aliyot).filter(x => {
|
|
167
|
-
if (x.length === 1) {
|
|
168
|
-
return true;
|
|
169
|
-
}
|
|
170
|
-
const code = x.charCodeAt(0);
|
|
171
|
-
return code >= 48 && code <= 57;
|
|
172
|
-
});
|
|
173
|
-
let start = aliyot[nums[0]];
|
|
174
|
-
let end = start;
|
|
175
|
-
const parts = [];
|
|
176
|
-
for (let i = 0; i < nums.length; i++) {
|
|
177
|
-
const num = nums[i];
|
|
178
|
-
const aliyah = aliyot[num];
|
|
179
|
-
if (i === nums.length - 1 && aliyah.k === end.k && aliyah.e === end.e) {
|
|
180
|
-
// short-circuit when final aliyah is within the previous (e.g. M inside of 7)
|
|
181
|
-
continue;
|
|
182
|
-
}
|
|
183
|
-
const prevEndChap = +end.e.split(':')[0];
|
|
184
|
-
const curStartChap = +aliyah.b.split(':')[0];
|
|
185
|
-
const sameOrNextChap = curStartChap === prevEndChap || curStartChap === prevEndChap + 1;
|
|
186
|
-
if (i !== 0 &&
|
|
187
|
-
(aliyah.k !== start.k ||
|
|
188
|
-
isChapVerseBefore(aliyah.b, start.e) ||
|
|
189
|
-
!sameOrNextChap)) {
|
|
190
|
-
parts.push({ k: start.k, b: start.b, e: end.e });
|
|
191
|
-
start = aliyah;
|
|
192
|
-
}
|
|
193
|
-
end = aliyah;
|
|
194
|
-
}
|
|
195
|
-
parts.push({ k: start.k, b: start.b, e: end.e });
|
|
196
|
-
return parts;
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* Returns a string representation of the leyning parts.
|
|
200
|
-
* Separate verse ranges read from the same book are separated
|
|
201
|
-
* by commas, e.g. `Isaiah 6:1-7:6, 9:5-6`.
|
|
202
|
-
* Verse ranges from different books are separated by semicolons,
|
|
203
|
-
* e.g. `Genesis 21:1-34; Numbers 29:1-6`.
|
|
204
|
-
*/
|
|
205
|
-
function makeSummaryFromParts(parts) {
|
|
206
|
-
if (!Array.isArray(parts)) {
|
|
207
|
-
parts = [parts];
|
|
208
|
-
}
|
|
209
|
-
let prev = parts[0];
|
|
210
|
-
let summary = formatAliyahShort(prev, true);
|
|
211
|
-
for (let i = 1; i < parts.length; i++) {
|
|
212
|
-
const part = parts[i];
|
|
213
|
-
if (part.k === prev.k) {
|
|
214
|
-
summary += ', ';
|
|
215
|
-
}
|
|
216
|
-
else {
|
|
217
|
-
summary += `; ${part.k} `;
|
|
218
|
-
}
|
|
219
|
-
summary += formatAliyahShort(part, false);
|
|
220
|
-
prev = part;
|
|
221
|
-
}
|
|
222
|
-
return summary;
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
225
|
-
* Makes a summary of the leyning, like "Genesis 6:9-11:32"
|
|
226
|
-
*/
|
|
227
|
-
function makeLeyningSummary(aliyot) {
|
|
228
|
-
const parts = makeLeyningParts(aliyot);
|
|
229
|
-
return makeSummaryFromParts(parts);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* Makes a deep copy of the src object using JSON stringify and parse
|
|
234
|
-
*/
|
|
235
|
-
function clone(src) {
|
|
236
|
-
return JSON.parse(JSON.stringify(src));
|
|
237
|
-
}
|
|
238
|
-
function cloneHaftara(haft) {
|
|
239
|
-
if (!haft) {
|
|
240
|
-
return haft;
|
|
241
|
-
}
|
|
242
|
-
const dest = clone(haft);
|
|
243
|
-
if (Array.isArray(dest)) {
|
|
244
|
-
dest.forEach(calculateNumVerses);
|
|
245
|
-
}
|
|
246
|
-
else {
|
|
247
|
-
calculateNumVerses(dest);
|
|
248
|
-
}
|
|
249
|
-
return dest;
|
|
250
|
-
}
|
|
251
|
-
/**
|
|
252
|
-
* Returns the total number of verses in an array of Aliyah (or haftarah) objects
|
|
253
|
-
*/
|
|
254
|
-
function sumVerses(aliyot) {
|
|
255
|
-
return Array.isArray(aliyot)
|
|
256
|
-
? aliyot.reduce((prev, cur) => prev + cur.v, 0)
|
|
257
|
-
: aliyot.v;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
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"}},megillah:"Lamentations"},"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"}},alt:{"1":{p:47,k:5,b:"14:22",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:"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"}}};
|
|
261
|
-
|
|
262
|
-
const festivals = festivals0;
|
|
263
|
-
/**
|
|
264
|
-
* Is there a special festival Torah Reading for `holiday`?
|
|
265
|
-
*/
|
|
266
|
-
function hasFestival(holiday) {
|
|
267
|
-
return typeof festivals[holiday] === 'object';
|
|
268
|
-
}
|
|
269
|
-
function aliyotBookNumToStr(aliyot) {
|
|
270
|
-
if (aliyot) {
|
|
271
|
-
for (const aliyah of Object.values(aliyot)) {
|
|
272
|
-
if (typeof aliyah.k === 'number') {
|
|
273
|
-
aliyah.k = BOOK[aliyah.k];
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
/**
|
|
279
|
-
* Returns the raw metadata for festival reading for `holiday`
|
|
280
|
-
*/
|
|
281
|
-
function lookupFestival(holiday) {
|
|
282
|
-
let src = festivals[holiday];
|
|
283
|
-
if (typeof src === 'undefined') {
|
|
284
|
-
return undefined;
|
|
285
|
-
}
|
|
286
|
-
if (src.alias) {
|
|
287
|
-
const tmp = festivals[src.key];
|
|
288
|
-
if (typeof tmp === 'undefined') {
|
|
289
|
-
throw new Error(`Leyning alias ${holiday} => ${src.key} not found`);
|
|
290
|
-
}
|
|
291
|
-
src = tmp;
|
|
292
|
-
}
|
|
293
|
-
const result = src.fullkriyah ? clone(src) : src;
|
|
294
|
-
aliyotBookNumToStr(result.fullkriyah);
|
|
295
|
-
aliyotBookNumToStr(result.alt);
|
|
296
|
-
if (src.note) {
|
|
297
|
-
result.note = src.note;
|
|
298
|
-
}
|
|
299
|
-
return result;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
/*! @hebcal/hdate v0.21.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
14
|
+
/*! @hebcal/hdate v0.21.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
303
15
|
/* eslint-disable @typescript-eslint/no-namespace, no-inner-declarations */
|
|
304
16
|
/** @private */
|
|
305
17
|
const lengths = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
@@ -440,7 +152,7 @@ function abs2greg(abs) {
|
|
|
440
152
|
return dt;
|
|
441
153
|
}
|
|
442
154
|
|
|
443
|
-
/*! @hebcal/hdate v0.21.
|
|
155
|
+
/*! @hebcal/hdate v0.21.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
444
156
|
|
|
445
157
|
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-namespace */
|
|
446
158
|
/**
|
|
@@ -455,7 +167,7 @@ greg.greg2abs = greg2abs;
|
|
|
455
167
|
greg.isDate = isDate;
|
|
456
168
|
greg.isLeapYear = isGregLeapYear;
|
|
457
169
|
|
|
458
|
-
/*! @hebcal/hdate v0.21.
|
|
170
|
+
/*! @hebcal/hdate v0.21.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
459
171
|
/**
|
|
460
172
|
* Removes niqqud from Hebrew string
|
|
461
173
|
*/
|
|
@@ -465,7 +177,7 @@ function hebrewStripNikkud(str) {
|
|
|
465
177
|
return a.replace(/[\u0590-\u05bd]/g, '').replace(/[\u05bf-\u05c7]/g, '');
|
|
466
178
|
}
|
|
467
179
|
|
|
468
|
-
/*! @hebcal/hdate v0.21.
|
|
180
|
+
/*! @hebcal/hdate v0.21.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
469
181
|
|
|
470
182
|
/*
|
|
471
183
|
* More minimal HDate
|
|
@@ -834,7 +546,7 @@ function monthFromName(monthName) {
|
|
|
834
546
|
throw new RangeError(`bad monthName: ${monthName}`);
|
|
835
547
|
}
|
|
836
548
|
|
|
837
|
-
/*! @hebcal/hdate v0.21.
|
|
549
|
+
/*! @hebcal/hdate v0.21.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
838
550
|
const GERESH = '׳';
|
|
839
551
|
const GERSHAYIM = '״';
|
|
840
552
|
const heb2num = {
|
|
@@ -947,13 +659,13 @@ function gematriyaStrToNum(str) {
|
|
|
947
659
|
return num;
|
|
948
660
|
}
|
|
949
661
|
|
|
950
|
-
/*! @hebcal/hdate v0.21.
|
|
662
|
+
/*! @hebcal/hdate v0.21.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
951
663
|
var poAshkenazi = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);", "language": "en_CA@ashkenazi" }, "contexts": { "": { "Tevet": ["Teves"] } } };
|
|
952
664
|
|
|
953
|
-
/*! @hebcal/hdate v0.21.
|
|
665
|
+
/*! @hebcal/hdate v0.21.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
954
666
|
var poHe = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);", "language": "he" }, "contexts": { "": { "Adar": ["אֲדָר"], "Adar I": ["אֲדָר א׳"], "Adar II": ["אֲדָר ב׳"], "Av": ["אָב"], "Cheshvan": ["חֶשְׁוָן"], "Elul": ["אֱלוּל"], "Iyyar": ["אִיָּיר"], "Kislev": ["כִּסְלֵו"], "Nisan": ["נִיסָן"], "Sh'vat": ["שְׁבָט"], "Sivan": ["סִיוָן"], "Tamuz": ["תַּמּוּז"], "Tevet": ["טֵבֵת"], "Tishrei": ["תִּשְׁרֵי"] } } };
|
|
955
667
|
|
|
956
|
-
/*! @hebcal/hdate v0.21.
|
|
668
|
+
/*! @hebcal/hdate v0.21.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
957
669
|
|
|
958
670
|
const noopLocale = {
|
|
959
671
|
headers: { 'plural-forms': 'nplurals=2; plural=(n!=1);' },
|
|
@@ -1145,7 +857,7 @@ Locale.addLocale('he', poHe);
|
|
|
1145
857
|
const poHeNoNikud = Locale.copyLocaleNoNikud(poHe);
|
|
1146
858
|
Locale.addLocale('he-x-NoNikud', poHeNoNikud);
|
|
1147
859
|
|
|
1148
|
-
/*! @hebcal/hdate v0.21.
|
|
860
|
+
/*! @hebcal/hdate v0.21.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
1149
861
|
|
|
1150
862
|
/*
|
|
1151
863
|
Hebcal - A Jewish Calendar Generator
|
|
@@ -1435,18 +1147,25 @@ class HDate {
|
|
|
1435
1147
|
}
|
|
1436
1148
|
/**
|
|
1437
1149
|
* Renders this Hebrew date in Hebrew gematriya, regardless of locale.
|
|
1150
|
+
* @param suppressNikud - suppress nekudot (default false)
|
|
1151
|
+
* @param suppressYear - suppress Hebrew year (default false)
|
|
1438
1152
|
* @example
|
|
1439
1153
|
* import {HDate, months} from '@hebcal/hdate';
|
|
1440
1154
|
* const hd = new HDate(15, months.CHESHVAN, 5769);
|
|
1441
1155
|
* hd.renderGematriya(); // 'ט״ו חֶשְׁוָן תשס״ט'
|
|
1442
1156
|
* hd.renderGematriya(true); // 'ט״ו חשון תשס״ט'
|
|
1157
|
+
* hd.renderGematriya(false, true); // 'ט״ו חֶשְׁוָן'
|
|
1443
1158
|
*/
|
|
1444
|
-
renderGematriya(suppressNikud = false) {
|
|
1159
|
+
renderGematriya(suppressNikud = false, suppressYear = false) {
|
|
1445
1160
|
const d = this.getDate();
|
|
1446
1161
|
const locale = suppressNikud ? 'he-x-NoNikud' : 'he';
|
|
1447
1162
|
const m = Locale.gettext(this.getMonthName(), locale);
|
|
1163
|
+
const prefix = gematriya(d) + ' ' + m;
|
|
1164
|
+
if (suppressYear) {
|
|
1165
|
+
return prefix;
|
|
1166
|
+
}
|
|
1448
1167
|
const y = this.getFullYear();
|
|
1449
|
-
return
|
|
1168
|
+
return prefix + ' ' + gematriya(y);
|
|
1450
1169
|
}
|
|
1451
1170
|
/**
|
|
1452
1171
|
* Returns an `HDate` corresponding to the specified day of week
|
|
@@ -1819,77 +1538,355 @@ function getDayOfTranslation(locale) {
|
|
|
1819
1538
|
case 'ashkenazi':
|
|
1820
1539
|
return ' of';
|
|
1821
1540
|
}
|
|
1822
|
-
const ofStr = Locale.lookupTranslation('of', locale);
|
|
1823
|
-
if (ofStr) {
|
|
1824
|
-
return ' ' + ofStr;
|
|
1541
|
+
const ofStr = Locale.lookupTranslation('of', locale);
|
|
1542
|
+
if (ofStr) {
|
|
1543
|
+
return ' ' + ofStr;
|
|
1544
|
+
}
|
|
1545
|
+
if (locale.startsWith('ashkenazi')) {
|
|
1546
|
+
return ' of';
|
|
1547
|
+
}
|
|
1548
|
+
return '';
|
|
1549
|
+
}
|
|
1550
|
+
/**
|
|
1551
|
+
* Sets the day of the month of the date. Returns the object it was called upon
|
|
1552
|
+
* @private
|
|
1553
|
+
* @param month A number, or Hebrew month name string
|
|
1554
|
+
*/
|
|
1555
|
+
function setMonth(hd, month) {
|
|
1556
|
+
hd.mm = HDate.monthNum(month);
|
|
1557
|
+
fix(hd);
|
|
1558
|
+
return hd;
|
|
1559
|
+
}
|
|
1560
|
+
function setDate(hd, date) {
|
|
1561
|
+
hd.dd = date;
|
|
1562
|
+
fix(hd);
|
|
1563
|
+
return hd;
|
|
1564
|
+
}
|
|
1565
|
+
function fix(hd) {
|
|
1566
|
+
fixMonth(hd);
|
|
1567
|
+
fixDate(hd);
|
|
1568
|
+
}
|
|
1569
|
+
function fixDate(hd) {
|
|
1570
|
+
if (hd.dd < 1) {
|
|
1571
|
+
if (hd.mm === months.TISHREI) {
|
|
1572
|
+
hd.yy -= 1;
|
|
1573
|
+
}
|
|
1574
|
+
hd.dd += daysInMonth(hd.mm, hd.yy);
|
|
1575
|
+
hd.mm -= 1;
|
|
1576
|
+
fix(hd);
|
|
1577
|
+
}
|
|
1578
|
+
if (hd.dd > daysInMonth(hd.mm, hd.yy)) {
|
|
1579
|
+
if (hd.mm === months.ELUL) {
|
|
1580
|
+
hd.yy += 1;
|
|
1581
|
+
}
|
|
1582
|
+
hd.dd -= daysInMonth(hd.mm, hd.yy);
|
|
1583
|
+
if (hd.mm === monthsInYear(hd.yy)) {
|
|
1584
|
+
hd.mm = 1; // rollover to NISAN
|
|
1585
|
+
}
|
|
1586
|
+
else {
|
|
1587
|
+
hd.mm += 1;
|
|
1588
|
+
}
|
|
1589
|
+
fix(hd);
|
|
1590
|
+
}
|
|
1591
|
+
fixMonth(hd);
|
|
1592
|
+
}
|
|
1593
|
+
function fixMonth(hd) {
|
|
1594
|
+
if (hd.mm === months.ADAR_II && !hd.isLeapYear()) {
|
|
1595
|
+
hd.mm -= 1; // to Adar I
|
|
1596
|
+
fix(hd);
|
|
1597
|
+
}
|
|
1598
|
+
else if (hd.mm < 1) {
|
|
1599
|
+
hd.mm += monthsInYear(hd.yy);
|
|
1600
|
+
hd.yy -= 1;
|
|
1601
|
+
fix(hd);
|
|
1602
|
+
}
|
|
1603
|
+
else if (hd.mm > monthsInYear(hd.yy)) {
|
|
1604
|
+
hd.mm -= monthsInYear(hd.yy);
|
|
1605
|
+
hd.yy += 1;
|
|
1606
|
+
fix(hd);
|
|
1607
|
+
}
|
|
1608
|
+
delete hd.rd;
|
|
1609
|
+
}
|
|
1610
|
+
function onOrBefore(day, t, offset) {
|
|
1611
|
+
return new HDate(HDate.dayOnOrBefore(day, t.abs() + offset));
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
function gematriya2(num) {
|
|
1615
|
+
const str = gematriya(num);
|
|
1616
|
+
return str.replaceAll(/[׳״]/g, '');
|
|
1617
|
+
}
|
|
1618
|
+
function formatVerseToHebrew(chapVerse) {
|
|
1619
|
+
if (chapVerse === undefined || chapVerse === null) {
|
|
1620
|
+
return '';
|
|
1621
|
+
}
|
|
1622
|
+
const cv = chapVerse.split(':');
|
|
1623
|
+
const chapter = parseInt(cv[0], 10);
|
|
1624
|
+
const verse = parseInt(cv[1], 10);
|
|
1625
|
+
// if not number return empty string
|
|
1626
|
+
if (isNaN(chapter) || isNaN(verse)) {
|
|
1627
|
+
return chapVerse;
|
|
1628
|
+
}
|
|
1629
|
+
return `${gematriya2(chapter)}:${gematriya2(verse)}`;
|
|
1630
|
+
}
|
|
1631
|
+
/**
|
|
1632
|
+
* Formats an aliyah object like "Numbers 28:9-15"
|
|
1633
|
+
*/
|
|
1634
|
+
function formatAliyahShort(aliyah, showBook, language = 'en') {
|
|
1635
|
+
const isEnglish = language === 'en';
|
|
1636
|
+
const begin = isEnglish ? aliyah.b : formatVerseToHebrew(aliyah.b);
|
|
1637
|
+
const end0 = isEnglish ? aliyah.e : formatVerseToHebrew(aliyah.e);
|
|
1638
|
+
const prefix = showBook ? locale.Locale.gettext(aliyah.k, language) + ' ' : '';
|
|
1639
|
+
if (begin === end0) {
|
|
1640
|
+
return `${prefix}${begin}`;
|
|
1641
|
+
}
|
|
1642
|
+
const cv1 = begin.split(':');
|
|
1643
|
+
const cv2 = end0.split(':');
|
|
1644
|
+
const end = cv1[0] === cv2[0] ? cv2[1] : end0;
|
|
1645
|
+
return `${prefix}${begin}-${end}`;
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
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,23,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 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,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};
|
|
1649
|
+
|
|
1650
|
+
/**
|
|
1651
|
+
* Names of the books of the Torah.
|
|
1652
|
+
*
|
|
1653
|
+
* `BOOK[1] === 'Genesis'`
|
|
1654
|
+
* @readonly
|
|
1655
|
+
*/
|
|
1656
|
+
const BOOK = [
|
|
1657
|
+
'',
|
|
1658
|
+
'Genesis',
|
|
1659
|
+
'Exodus',
|
|
1660
|
+
'Leviticus',
|
|
1661
|
+
'Numbers',
|
|
1662
|
+
'Deuteronomy',
|
|
1663
|
+
];
|
|
1664
|
+
/**
|
|
1665
|
+
* The number of verses in each book of the Tanakh.
|
|
1666
|
+
* Indexed by English transliterated name of book,
|
|
1667
|
+
* and arrays are 1-based.
|
|
1668
|
+
*
|
|
1669
|
+
* There are 51 chapters in Genesis, so
|
|
1670
|
+
* `NUM_VERSES['Genesis'].length === 51`.
|
|
1671
|
+
*
|
|
1672
|
+
* There are 26 verses in Genesis chapter 4,
|
|
1673
|
+
* so `NUM_VERSES['Genesis'][4] === 26`.
|
|
1674
|
+
* @readonly
|
|
1675
|
+
*/
|
|
1676
|
+
const NUM_VERSES = numverses;
|
|
1677
|
+
/**
|
|
1678
|
+
* Formats parsha as a string
|
|
1679
|
+
* @param parsha untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei']
|
|
1680
|
+
*/
|
|
1681
|
+
function parshaToString(parsha) {
|
|
1682
|
+
if (typeof parsha === 'string') {
|
|
1683
|
+
return parsha;
|
|
1684
|
+
}
|
|
1685
|
+
else if (!Array.isArray(parsha) ||
|
|
1686
|
+
parsha.length === 0 ||
|
|
1687
|
+
parsha.length > 2) {
|
|
1688
|
+
throw new TypeError(`Bad parsha argument: ${parsha}`);
|
|
1689
|
+
}
|
|
1690
|
+
let s = parsha[0];
|
|
1691
|
+
if (parsha.length === 2) {
|
|
1692
|
+
s += '-' + parsha[1];
|
|
1693
|
+
}
|
|
1694
|
+
return s;
|
|
1695
|
+
}
|
|
1696
|
+
/**
|
|
1697
|
+
* Calculates the number of verses in an aliyah or haftara based on
|
|
1698
|
+
* the `b` (begin verse), `e` (end verse) and `k` (book).
|
|
1699
|
+
* Modifies `aliyah` by setting the `v` field.
|
|
1700
|
+
*/
|
|
1701
|
+
function calculateNumVerses(aliyah) {
|
|
1702
|
+
if (aliyah.v) {
|
|
1703
|
+
return aliyah.v;
|
|
1704
|
+
}
|
|
1705
|
+
aliyah.v = subtractVerses(aliyah.k, aliyah.b, aliyah.e) + 1;
|
|
1706
|
+
return aliyah.v;
|
|
1707
|
+
}
|
|
1708
|
+
/**
|
|
1709
|
+
* Finds the number of verses between two locations in the same book.
|
|
1710
|
+
* @param book The English name of the book (e.g. "Numbers")
|
|
1711
|
+
* @param from The starting verse (e.g. "28:9")
|
|
1712
|
+
* @param to The ending verse (e.g. "28:15")
|
|
1713
|
+
* @returns The number of verses between the two locations, excluding the `to` verse.
|
|
1714
|
+
*/
|
|
1715
|
+
function subtractVerses(book, from, to) {
|
|
1716
|
+
const chapVerseBegin = from.split(':');
|
|
1717
|
+
const chapVerseEnd = to.split(':');
|
|
1718
|
+
const c1 = parseInt(chapVerseBegin[0], 10);
|
|
1719
|
+
const c2 = parseInt(chapVerseEnd[0], 10);
|
|
1720
|
+
const v1 = parseInt(chapVerseBegin[1], 10);
|
|
1721
|
+
const v2 = parseInt(chapVerseEnd[1], 10);
|
|
1722
|
+
let result = 0;
|
|
1723
|
+
if (c1 === c2) {
|
|
1724
|
+
return v2 - v1;
|
|
1725
|
+
}
|
|
1726
|
+
const numv = NUM_VERSES[book];
|
|
1727
|
+
if (typeof numv !== 'object' || !numv.length) {
|
|
1728
|
+
throw new ReferenceError(`Can't find numverses for ${book}`);
|
|
1825
1729
|
}
|
|
1826
|
-
|
|
1827
|
-
|
|
1730
|
+
let total = numv[c1] - v1;
|
|
1731
|
+
for (let chap = c1 + 1; chap < c2; chap++) {
|
|
1732
|
+
total += numv[chap];
|
|
1828
1733
|
}
|
|
1829
|
-
|
|
1734
|
+
total += v2;
|
|
1735
|
+
result = total;
|
|
1736
|
+
return result;
|
|
1830
1737
|
}
|
|
1831
1738
|
/**
|
|
1832
|
-
*
|
|
1833
|
-
* @
|
|
1834
|
-
* @param
|
|
1739
|
+
* Calculates the next verse after adding a number of verses to a given location.
|
|
1740
|
+
* @param book The English name of the book (e.g. "Numbers")
|
|
1741
|
+
* @param from The starting verse (e.g. "28:9")
|
|
1742
|
+
* @param numVerses The number of verses to add; must be nonnegative.
|
|
1743
|
+
* @returns The next verse after adding the specified number of verses,
|
|
1744
|
+
* or null if the resulting verse exceeds the number of verses
|
|
1745
|
+
* in the book.
|
|
1835
1746
|
*/
|
|
1836
|
-
function
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1747
|
+
function addVerses(book, from, numVerses) {
|
|
1748
|
+
const chapVerseBegin = from.split(':');
|
|
1749
|
+
const c1 = parseInt(chapVerseBegin[0], 10);
|
|
1750
|
+
const v1 = parseInt(chapVerseBegin[1], 10);
|
|
1751
|
+
const numv = NUM_VERSES[book];
|
|
1752
|
+
if (typeof numv !== 'object' || !numv.length) {
|
|
1753
|
+
throw new ReferenceError(`Can't find numverses for ${book}`);
|
|
1754
|
+
}
|
|
1755
|
+
let total = v1 + numVerses;
|
|
1756
|
+
let c2 = c1;
|
|
1757
|
+
while (total > numv[c2]) {
|
|
1758
|
+
total -= numv[c2];
|
|
1759
|
+
c2++;
|
|
1760
|
+
if (!numv[c2])
|
|
1761
|
+
return null;
|
|
1762
|
+
}
|
|
1763
|
+
return `${c2}:${total}`;
|
|
1840
1764
|
}
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1765
|
+
/**
|
|
1766
|
+
* Formats an aliyah object like "Numbers 28:9-28:15"
|
|
1767
|
+
*/
|
|
1768
|
+
function formatAliyahWithBook(a) {
|
|
1769
|
+
return `${a.k} ${a.b}-${a.e}`;
|
|
1845
1770
|
}
|
|
1846
|
-
|
|
1847
|
-
fixMonth(hd);
|
|
1848
|
-
|
|
1771
|
+
|
|
1772
|
+
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"}},megillah:"Lamentations"},"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"}},alt:{"1":{p:47,k:5,b:"14:22",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:"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"}}};
|
|
1773
|
+
|
|
1774
|
+
const festivals = festivals0;
|
|
1775
|
+
/**
|
|
1776
|
+
* Is there a special festival Torah Reading for `holiday`?
|
|
1777
|
+
*/
|
|
1778
|
+
function hasFestival(holiday) {
|
|
1779
|
+
return typeof festivals[holiday] === 'object';
|
|
1849
1780
|
}
|
|
1850
|
-
function
|
|
1851
|
-
if (
|
|
1852
|
-
|
|
1853
|
-
|
|
1781
|
+
function aliyotBookNumToStr(aliyot) {
|
|
1782
|
+
if (aliyot) {
|
|
1783
|
+
for (const aliyah of Object.values(aliyot)) {
|
|
1784
|
+
if (typeof aliyah.k === 'number') {
|
|
1785
|
+
aliyah.k = BOOK[aliyah.k];
|
|
1786
|
+
}
|
|
1854
1787
|
}
|
|
1855
|
-
hd.dd += daysInMonth(hd.mm, hd.yy);
|
|
1856
|
-
hd.mm -= 1;
|
|
1857
|
-
fix(hd);
|
|
1858
1788
|
}
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1789
|
+
}
|
|
1790
|
+
/**
|
|
1791
|
+
* Returns the raw metadata for festival reading for `holiday`
|
|
1792
|
+
*/
|
|
1793
|
+
function lookupFestival(holiday) {
|
|
1794
|
+
let src = festivals[holiday];
|
|
1795
|
+
if (!src) {
|
|
1796
|
+
return undefined;
|
|
1797
|
+
}
|
|
1798
|
+
if (src.alias) {
|
|
1799
|
+
const tmp = festivals[src.key];
|
|
1800
|
+
if (!tmp) {
|
|
1801
|
+
throw new Error(`Leyning alias ${holiday} => ${src.key} not found`);
|
|
1862
1802
|
}
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1803
|
+
src = tmp;
|
|
1804
|
+
}
|
|
1805
|
+
const result = src.fullkriyah
|
|
1806
|
+
? structuredClone(src)
|
|
1807
|
+
: src;
|
|
1808
|
+
aliyotBookNumToStr(result.fullkriyah);
|
|
1809
|
+
aliyotBookNumToStr(result.alt);
|
|
1810
|
+
return result;
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1813
|
+
/**
|
|
1814
|
+
* @private
|
|
1815
|
+
*/
|
|
1816
|
+
function isChapVerseBefore(a, b) {
|
|
1817
|
+
const cv1 = a.split(':').map(x => +x);
|
|
1818
|
+
const cv2 = b.split(':').map(x => +x);
|
|
1819
|
+
return cv1[0] * 100 + cv1[1] < cv2[0] * 100 + cv2[1];
|
|
1820
|
+
}
|
|
1821
|
+
/**
|
|
1822
|
+
* Returns a string representation of the leyning parts.
|
|
1823
|
+
* Separate verse ranges read from the same book are separated
|
|
1824
|
+
* by commas, e.g. `Isaiah 6:1-7:6, 9:5-6`.
|
|
1825
|
+
* Verse ranges from different books are separated by semicolons,
|
|
1826
|
+
* e.g. `Genesis 21:1-34; Numbers 29:1-6`.
|
|
1827
|
+
*/
|
|
1828
|
+
function makeSummaryFromParts(parts, language = 'en') {
|
|
1829
|
+
if (!Array.isArray(parts)) {
|
|
1830
|
+
parts = [parts];
|
|
1831
|
+
}
|
|
1832
|
+
let prev = parts[0];
|
|
1833
|
+
let summary = formatAliyahShort(prev, true, language);
|
|
1834
|
+
for (let i = 1; i < parts.length; i++) {
|
|
1835
|
+
const part = parts[i];
|
|
1836
|
+
if (part.k === prev.k) {
|
|
1837
|
+
summary += ', ';
|
|
1866
1838
|
}
|
|
1867
1839
|
else {
|
|
1868
|
-
|
|
1840
|
+
summary += `; ${locale.Locale.gettext(part.k, language)} `;
|
|
1869
1841
|
}
|
|
1870
|
-
|
|
1842
|
+
summary += formatAliyahShort(part, false, language);
|
|
1843
|
+
prev = part;
|
|
1871
1844
|
}
|
|
1872
|
-
|
|
1845
|
+
return summary;
|
|
1873
1846
|
}
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1847
|
+
/**
|
|
1848
|
+
* Summarizes an `AliyotMap` by collapsing all adjacent aliyot.
|
|
1849
|
+
* Finds any non-overlapping parts (e.g. special 7th aliyah or maftir)
|
|
1850
|
+
*/
|
|
1851
|
+
function makeLeyningParts(aliyot) {
|
|
1852
|
+
const nums = Object.keys(aliyot).filter(x => {
|
|
1853
|
+
if (x.length === 1) {
|
|
1854
|
+
return true;
|
|
1855
|
+
}
|
|
1856
|
+
const code = x.charCodeAt(0);
|
|
1857
|
+
return code >= 48 && code <= 57;
|
|
1858
|
+
});
|
|
1859
|
+
let start = aliyot[nums[0]];
|
|
1860
|
+
let end = start;
|
|
1861
|
+
const parts = [];
|
|
1862
|
+
for (let i = 0; i < nums.length; i++) {
|
|
1863
|
+
const num = nums[i];
|
|
1864
|
+
const aliyah = aliyot[num];
|
|
1865
|
+
if (i === nums.length - 1 && aliyah.k === end.k && aliyah.e === end.e) {
|
|
1866
|
+
// short-circuit when final aliyah is within the previous (e.g. M inside of 7)
|
|
1867
|
+
continue;
|
|
1868
|
+
}
|
|
1869
|
+
const prevEndChap = +end.e.split(':')[0];
|
|
1870
|
+
const curStartChap = +aliyah.b.split(':')[0];
|
|
1871
|
+
const sameOrNextChap = curStartChap === prevEndChap || curStartChap === prevEndChap + 1;
|
|
1872
|
+
if (i !== 0 &&
|
|
1873
|
+
(aliyah.k !== start.k ||
|
|
1874
|
+
isChapVerseBefore(aliyah.b, start.e) ||
|
|
1875
|
+
!sameOrNextChap)) {
|
|
1876
|
+
parts.push({ k: start.k, b: start.b, e: end.e });
|
|
1877
|
+
start = aliyah;
|
|
1878
|
+
}
|
|
1879
|
+
end = aliyah;
|
|
1888
1880
|
}
|
|
1889
|
-
|
|
1881
|
+
parts.push({ k: start.k, b: start.b, e: end.e });
|
|
1882
|
+
return parts;
|
|
1890
1883
|
}
|
|
1891
|
-
|
|
1892
|
-
|
|
1884
|
+
/**
|
|
1885
|
+
* Makes a summary of the leyning, like "Genesis 6:9-11:32"
|
|
1886
|
+
*/
|
|
1887
|
+
function makeLeyningSummary(aliyot) {
|
|
1888
|
+
const parts = makeLeyningParts(aliyot);
|
|
1889
|
+
return makeSummaryFromParts(parts);
|
|
1893
1890
|
}
|
|
1894
1891
|
|
|
1895
1892
|
const HOLIDAY_IGNORE_MASK = event.flags.DAF_YOMI |
|
|
@@ -1908,7 +1905,8 @@ const HOLIDAY_IGNORE_MASK = event.flags.DAF_YOMI |
|
|
|
1908
1905
|
* @returns key to look up in holiday-reading.json
|
|
1909
1906
|
*/
|
|
1910
1907
|
function getLeyningKeyForEvent(ev, il = false) {
|
|
1911
|
-
|
|
1908
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1909
|
+
if (ev.eventTime !== undefined) {
|
|
1912
1910
|
return undefined;
|
|
1913
1911
|
}
|
|
1914
1912
|
const mask = ev.getFlags();
|
|
@@ -1939,6 +1937,7 @@ function getLeyningKeyForEvent(ev, il = false) {
|
|
|
1939
1937
|
if (day === 1 && month === months.TISHREI) {
|
|
1940
1938
|
return isShabbat ? 'Rosh Hashana I (on Shabbat)' : 'Rosh Hashana I';
|
|
1941
1939
|
}
|
|
1940
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1942
1941
|
const cholHaMoedDay = ev.cholHaMoedDay;
|
|
1943
1942
|
if (typeof cholHaMoedDay === 'number') {
|
|
1944
1943
|
// Sukkot or Pesach
|
|
@@ -1958,6 +1957,7 @@ function getLeyningKeyForEvent(ev, il = false) {
|
|
|
1958
1957
|
}
|
|
1959
1958
|
return `${holiday} Chol ha-Moed Day ${cholHaMoedDay}`;
|
|
1960
1959
|
}
|
|
1960
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1961
1961
|
const chanukahDay = ev.chanukahDay;
|
|
1962
1962
|
if (typeof chanukahDay === 'number') {
|
|
1963
1963
|
if (isShabbat && isRoshChodesh) {
|
|
@@ -2027,8 +2027,37 @@ function getLeyningKeyForEvent(ev, il = false) {
|
|
|
2027
2027
|
return undefined;
|
|
2028
2028
|
}
|
|
2029
2029
|
|
|
2030
|
+
/**
|
|
2031
|
+
* Makes a deep copy of the src object using JSON stringify and parse
|
|
2032
|
+
* @deprecated Use structuredClone instead
|
|
2033
|
+
*/
|
|
2034
|
+
function clone(src) {
|
|
2035
|
+
return structuredClone(src);
|
|
2036
|
+
}
|
|
2037
|
+
function cloneHaftara(haft) {
|
|
2038
|
+
if (!haft) {
|
|
2039
|
+
return haft;
|
|
2040
|
+
}
|
|
2041
|
+
const dest = structuredClone(haft);
|
|
2042
|
+
if (Array.isArray(dest)) {
|
|
2043
|
+
dest.forEach(calculateNumVerses);
|
|
2044
|
+
}
|
|
2045
|
+
else {
|
|
2046
|
+
calculateNumVerses(dest);
|
|
2047
|
+
}
|
|
2048
|
+
return dest;
|
|
2049
|
+
}
|
|
2050
|
+
/**
|
|
2051
|
+
* Returns the total number of verses in an array of Aliyah (or haftarah) objects
|
|
2052
|
+
*/
|
|
2053
|
+
function sumVerses(aliyot) {
|
|
2054
|
+
return Array.isArray(aliyot)
|
|
2055
|
+
? aliyot.reduce((prev, cur) => prev + cur.v, 0)
|
|
2056
|
+
: aliyot.v;
|
|
2057
|
+
}
|
|
2058
|
+
|
|
2030
2059
|
function aliyotCombine67(aliyot) {
|
|
2031
|
-
const a6 =
|
|
2060
|
+
const a6 = structuredClone(aliyot['6']);
|
|
2032
2061
|
const a7 = aliyot['7'];
|
|
2033
2062
|
if (a6.k !== a7.k) {
|
|
2034
2063
|
throw new Error('Impossible to combine aliyot 6 & 7: ' + JSON.stringify(aliyot));
|
|
@@ -2046,11 +2075,11 @@ function aliyotCombine67(aliyot) {
|
|
|
2046
2075
|
function mergeAliyotWithSpecial(aliyot, special) {
|
|
2047
2076
|
if (special['7']) {
|
|
2048
2077
|
aliyotCombine67(aliyot);
|
|
2049
|
-
aliyot['7'] =
|
|
2078
|
+
aliyot['7'] = structuredClone(special['7']);
|
|
2050
2079
|
calculateNumVerses(aliyot['7']);
|
|
2051
2080
|
}
|
|
2052
2081
|
if (special['M']) {
|
|
2053
|
-
aliyot['M'] =
|
|
2082
|
+
aliyot['M'] = structuredClone(special['M']);
|
|
2054
2083
|
calculateNumVerses(aliyot['M']);
|
|
2055
2084
|
}
|
|
2056
2085
|
}
|
|
@@ -2089,7 +2118,7 @@ function specialReadings2(parsha, hd, il, aliyot) {
|
|
|
2089
2118
|
}
|
|
2090
2119
|
}
|
|
2091
2120
|
if (special.fullkriyah) {
|
|
2092
|
-
const aliyotMap =
|
|
2121
|
+
const aliyotMap = structuredClone(aliyot);
|
|
2093
2122
|
mergeAliyotWithSpecial(aliyotMap, special.fullkriyah);
|
|
2094
2123
|
for (const num of Object.keys(special.fullkriyah)) {
|
|
2095
2124
|
reason[num] = key;
|
|
@@ -2159,18 +2188,120 @@ function specialReadings2(parsha, hd, il, aliyot) {
|
|
|
2159
2188
|
return { aliyot, reason, haft, seph };
|
|
2160
2189
|
}
|
|
2161
2190
|
|
|
2191
|
+
/**
|
|
2192
|
+
* Translates an aliyah's book name and verse numbers to the target language.
|
|
2193
|
+
* Modifies the aliyah object in place.
|
|
2194
|
+
* @param aliyah - The aliyah object to translate
|
|
2195
|
+
* @param language - The target language code (e.g., 'he' for Hebrew)
|
|
2196
|
+
* @param translateBook - Whether to translate the book name (default true)
|
|
2197
|
+
*/
|
|
2198
|
+
function translateAliyah(aliyah, language) {
|
|
2199
|
+
if (language === 'he') {
|
|
2200
|
+
aliyah.k = locale.Locale.gettext(aliyah.k, language);
|
|
2201
|
+
aliyah.b = formatVerseToHebrew(aliyah.b);
|
|
2202
|
+
aliyah.e = formatVerseToHebrew(aliyah.e);
|
|
2203
|
+
}
|
|
2204
|
+
return aliyah;
|
|
2205
|
+
}
|
|
2206
|
+
/**
|
|
2207
|
+
* Translates aliyah(s) - handles single Aliyah, arrays, and AliyotMap.
|
|
2208
|
+
* For non-English languages, translates book names and converts verse numbers to Hebrew numerals.
|
|
2209
|
+
* Returns a new translated copy, leaving the original unchanged.
|
|
2210
|
+
* @param aliyahOrArray - Single Aliyah, array of Aliyah objects, AliyotMap, or undefined
|
|
2211
|
+
* @param language - The target language code (e.g., 'he' for Hebrew)
|
|
2212
|
+
* @param translateBook - Whether to translate the book name (default true)
|
|
2213
|
+
* @returns Translated copy of the input, or undefined if input was undefined
|
|
2214
|
+
*/
|
|
2215
|
+
function translateAliyahOrArray(aliyahOrArray, language = 'en') {
|
|
2216
|
+
// Handle array of Aliyah objects
|
|
2217
|
+
if (Array.isArray(aliyahOrArray)) {
|
|
2218
|
+
const result = aliyahOrArray.map(aliyah => {
|
|
2219
|
+
const copy = Object.assign({}, aliyah);
|
|
2220
|
+
return translateAliyah(copy, language);
|
|
2221
|
+
});
|
|
2222
|
+
return result;
|
|
2223
|
+
}
|
|
2224
|
+
// Handle single Aliyah object (has 'k' or 'b' property)
|
|
2225
|
+
if ('k' in aliyahOrArray || 'b' in aliyahOrArray) {
|
|
2226
|
+
const copy = Object.assign({}, aliyahOrArray);
|
|
2227
|
+
return translateAliyah(copy, language);
|
|
2228
|
+
}
|
|
2229
|
+
// Handle AliyotMap (Record<string, Aliyah>)
|
|
2230
|
+
const result = {};
|
|
2231
|
+
for (const [key, aliyah] of Object.entries(aliyahOrArray)) {
|
|
2232
|
+
const copy = Object.assign({}, aliyah);
|
|
2233
|
+
result[key] = translateAliyah(copy, language);
|
|
2234
|
+
}
|
|
2235
|
+
return result;
|
|
2236
|
+
}
|
|
2237
|
+
/**
|
|
2238
|
+
* Translates a Leyning object to the target language.
|
|
2239
|
+
* @param leyning - The Leyning object to translate
|
|
2240
|
+
* @param language - The target language code (e.g., 'he' for Hebrew)
|
|
2241
|
+
* @returns The translated Leyning object
|
|
2242
|
+
* @example
|
|
2243
|
+
* const leyning: Leyning = {
|
|
2244
|
+
* seph: [{k: 'Genesis', b: '1:1', e: '1:5'}],
|
|
2245
|
+
* haft: [{k: 'Genesis', b: '1:6', e: '1:10'}],
|
|
2246
|
+
* megillah: [{k: 'Genesis', b: '1:11', e: '1:15'}],
|
|
2247
|
+
* fullkriyah: [{k: 'Genesis', b: '1:16', e: '1:20'}],
|
|
2248
|
+
* };
|
|
2249
|
+
* const translatedLeyning = translateLeyning(leyning, 'he');
|
|
2250
|
+
* @todo add reason translation
|
|
2251
|
+
*/
|
|
2252
|
+
function translateLeyning(leyning, language) {
|
|
2253
|
+
if (language === 'en') {
|
|
2254
|
+
return leyning;
|
|
2255
|
+
}
|
|
2256
|
+
if (leyning.seph) {
|
|
2257
|
+
leyning.sephardic = makeSummaryFromParts(leyning.seph, language);
|
|
2258
|
+
leyning.seph = translateAliyahOrArray(leyning.seph, language);
|
|
2259
|
+
}
|
|
2260
|
+
if (leyning.haft) {
|
|
2261
|
+
leyning.haftara = makeSummaryFromParts(leyning.haft, language);
|
|
2262
|
+
leyning.haft = translateAliyahOrArray(leyning.haft, language);
|
|
2263
|
+
}
|
|
2264
|
+
if (leyning.megillah) {
|
|
2265
|
+
const parts = makeLeyningParts(leyning.megillah);
|
|
2266
|
+
const megillahSummary = makeSummaryFromParts(parts, language);
|
|
2267
|
+
leyning.megillah = translateAliyahOrArray(leyning.megillah, language);
|
|
2268
|
+
leyning.summary = megillahSummary;
|
|
2269
|
+
}
|
|
2270
|
+
if (leyning.fullkriyah) {
|
|
2271
|
+
const parts = makeLeyningParts(leyning.fullkriyah);
|
|
2272
|
+
// TODO: add check for summary in those cases getLeyningForHolidayKey
|
|
2273
|
+
if (typeof leyning.fullkriyah['1'] === 'object') {
|
|
2274
|
+
leyning.summary = makeSummaryFromParts(parts, language);
|
|
2275
|
+
}
|
|
2276
|
+
leyning.fullkriyah = translateAliyahOrArray(leyning.fullkriyah, language);
|
|
2277
|
+
if (leyning.summaryParts) {
|
|
2278
|
+
leyning.summaryParts = translateAliyahOrArray(leyning.summaryParts, language);
|
|
2279
|
+
leyning.summary = makeSummaryFromParts(leyning.summaryParts, language);
|
|
2280
|
+
}
|
|
2281
|
+
}
|
|
2282
|
+
if (leyning.weekday) {
|
|
2283
|
+
const parts = makeLeyningParts(leyning.weekday);
|
|
2284
|
+
leyning.weekday = translateAliyahOrArray(leyning.weekday, language);
|
|
2285
|
+
leyning.summary = makeSummaryFromParts(parts, language);
|
|
2286
|
+
}
|
|
2287
|
+
return leyning;
|
|
2288
|
+
}
|
|
2289
|
+
|
|
2162
2290
|
/**
|
|
2163
2291
|
* Looks up leyning for a given holiday key. Key should be an
|
|
2164
2292
|
* (untranslated) string used in holiday-readings.json. Returns some
|
|
2165
2293
|
* of full kriyah aliyot, special Maftir, special Haftarah
|
|
2166
2294
|
* @param key name from `holiday-readings.json` to find
|
|
2295
|
+
* @param cholHaMoedDay
|
|
2296
|
+
* @param il true if Israel holiday scheme
|
|
2297
|
+
* @param language language for summary (default 'en')
|
|
2167
2298
|
*/
|
|
2168
|
-
function getLeyningForHolidayKey(key, cholHaMoedDay, il) {
|
|
2299
|
+
function getLeyningForHolidayKey(key, cholHaMoedDay, il, language = 'en') {
|
|
2169
2300
|
if (typeof key !== 'string') {
|
|
2170
2301
|
return undefined;
|
|
2171
2302
|
}
|
|
2172
2303
|
const src = lookupFestival(key);
|
|
2173
|
-
if (
|
|
2304
|
+
if (!src) {
|
|
2174
2305
|
return undefined;
|
|
2175
2306
|
}
|
|
2176
2307
|
const israelOnly = src.il;
|
|
@@ -2187,7 +2318,7 @@ function getLeyningForHolidayKey(key, cholHaMoedDay, il) {
|
|
|
2187
2318
|
type: 'holiday',
|
|
2188
2319
|
};
|
|
2189
2320
|
if (src.fullkriyah) {
|
|
2190
|
-
leyning.fullkriyah =
|
|
2321
|
+
leyning.fullkriyah = structuredClone(src.fullkriyah);
|
|
2191
2322
|
if (key === 'Sukkot Shabbat Chol ha-Moed' && cholHaMoedDay) {
|
|
2192
2323
|
leyning.fullkriyah['M'] = leyning.fullkriyah[`M-day${cholHaMoedDay}`];
|
|
2193
2324
|
for (let day = 1; day <= 5; day++) {
|
|
@@ -2201,7 +2332,7 @@ function getLeyningForHolidayKey(key, cholHaMoedDay, il) {
|
|
|
2201
2332
|
}
|
|
2202
2333
|
Object.values(leyning.fullkriyah).forEach(aliyah => calculateNumVerses(aliyah));
|
|
2203
2334
|
if (src.alt) {
|
|
2204
|
-
leyning.alt =
|
|
2335
|
+
leyning.alt = structuredClone(src.alt);
|
|
2205
2336
|
for (const aliyah of Object.values(leyning.alt)) {
|
|
2206
2337
|
calculateNumVerses(aliyah);
|
|
2207
2338
|
}
|
|
@@ -2240,20 +2371,23 @@ function getLeyningForHolidayKey(key, cholHaMoedDay, il) {
|
|
|
2240
2371
|
if (src.note) {
|
|
2241
2372
|
leyning.note = src.note;
|
|
2242
2373
|
}
|
|
2243
|
-
return leyning;
|
|
2374
|
+
return translateLeyning(leyning, language);
|
|
2244
2375
|
}
|
|
2245
2376
|
/**
|
|
2246
2377
|
* Looks up leyning for a given holiday. Returns some
|
|
2247
2378
|
* of full kriyah aliyot, special Maftir, special Haftarah
|
|
2248
2379
|
* @param ev the Hebcal event associated with this leyning
|
|
2249
2380
|
* @param [il] true if Israel holiday scheme
|
|
2381
|
+
* @param [language] language for summary (default 'en')
|
|
2250
2382
|
* @returns map of aliyot
|
|
2251
2383
|
*/
|
|
2252
|
-
function getLeyningForHoliday(ev, il = false) {
|
|
2384
|
+
function getLeyningForHoliday(ev, il = false, language = 'en') {
|
|
2253
2385
|
if (typeof ev !== 'object' || typeof ev.getFlags !== 'function') {
|
|
2254
2386
|
throw new TypeError(`Bad event argument: ${JSON.stringify(ev)}`);
|
|
2387
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2255
2388
|
}
|
|
2256
|
-
else if (
|
|
2389
|
+
else if (ev.eventTime !== undefined) {
|
|
2390
|
+
// Events with eventTime are not supported for leyning lookup
|
|
2257
2391
|
return undefined;
|
|
2258
2392
|
}
|
|
2259
2393
|
else if (ev.getFlags() & event.flags.PARSHA_HASHAVUA) {
|
|
@@ -2263,7 +2397,8 @@ function getLeyningForHoliday(ev, il = false) {
|
|
|
2263
2397
|
return undefined;
|
|
2264
2398
|
}
|
|
2265
2399
|
const key = getLeyningKeyForEvent(ev, il);
|
|
2266
|
-
const leyning = getLeyningForHolidayKey(key, ev.cholHaMoedDay,
|
|
2400
|
+
const leyning = getLeyningForHolidayKey(key, ev.cholHaMoedDay, // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
2401
|
+
il, language);
|
|
2267
2402
|
return leyning;
|
|
2268
2403
|
}
|
|
2269
2404
|
|
|
@@ -2304,7 +2439,7 @@ function makeLeyningNames(parsha) {
|
|
|
2304
2439
|
* @param parsha untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei']
|
|
2305
2440
|
* @returns map of aliyot
|
|
2306
2441
|
*/
|
|
2307
|
-
function getLeyningForParshaShabbatOnly(parsha) {
|
|
2442
|
+
function getLeyningForParshaShabbatOnly(parsha, language = 'en') {
|
|
2308
2443
|
const raw = lookupParsha(parsha);
|
|
2309
2444
|
const fullkriyah = {};
|
|
2310
2445
|
const book = BOOK[raw.book];
|
|
@@ -2346,13 +2481,13 @@ function getLeyningForParshaShabbatOnly(parsha) {
|
|
|
2346
2481
|
result.sephardic = makeSummaryFromParts(seph);
|
|
2347
2482
|
result.sephardicNumV = sumVerses(seph);
|
|
2348
2483
|
}
|
|
2349
|
-
return result;
|
|
2484
|
+
return translateLeyning(result, language);
|
|
2350
2485
|
}
|
|
2351
2486
|
/**
|
|
2352
2487
|
* Looks up Monday/Thursday aliyot for a regular parsha
|
|
2353
2488
|
* @param parsha untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei']
|
|
2354
2489
|
*/
|
|
2355
|
-
function getWeekdayReading(parsha) {
|
|
2490
|
+
function getWeekdayReading(parsha, language = 'en') {
|
|
2356
2491
|
const raw = lookupParsha(parsha);
|
|
2357
2492
|
const parshaMeta = raw.combined ? lookupParsha(raw.p1) : raw;
|
|
2358
2493
|
const aliyot = parshaMeta.weekday;
|
|
@@ -2368,14 +2503,14 @@ function getWeekdayReading(parsha) {
|
|
|
2368
2503
|
calculateNumVerses(aliyah);
|
|
2369
2504
|
weekday[num] = aliyah;
|
|
2370
2505
|
}
|
|
2371
|
-
return weekday;
|
|
2506
|
+
return translateAliyahOrArray(weekday, language);
|
|
2372
2507
|
}
|
|
2373
2508
|
/**
|
|
2374
2509
|
* Looks up regular leyning for a weekly parsha with no special readings
|
|
2375
2510
|
* @param parsha untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei']
|
|
2376
2511
|
*/
|
|
2377
|
-
function getLeyningForParsha(parsha) {
|
|
2378
|
-
const result = getLeyningForParshaShabbatOnly(parsha);
|
|
2512
|
+
function getLeyningForParsha(parsha, language = 'en') {
|
|
2513
|
+
const result = getLeyningForParshaShabbatOnly(parsha, language);
|
|
2379
2514
|
result.weekday = getWeekdayReading(parsha);
|
|
2380
2515
|
return result;
|
|
2381
2516
|
}
|
|
@@ -2386,7 +2521,7 @@ function getLeyningForParsha(parsha) {
|
|
|
2386
2521
|
* @param [il] in Israel
|
|
2387
2522
|
* @returns map of aliyot
|
|
2388
2523
|
*/
|
|
2389
|
-
function getLeyningForParshaHaShavua(ev, il = false) {
|
|
2524
|
+
function getLeyningForParshaHaShavua(ev, il = false, language = 'en') {
|
|
2390
2525
|
if (typeof ev !== 'object' || typeof ev.getFlags !== 'function') {
|
|
2391
2526
|
throw new TypeError(`Bad event argument: ${ev}`);
|
|
2392
2527
|
}
|
|
@@ -2423,30 +2558,35 @@ function getLeyningForParshaHaShavua(ev, il = false) {
|
|
|
2423
2558
|
}
|
|
2424
2559
|
const reasons = Object.keys(reason);
|
|
2425
2560
|
if (reasons.length !== 0) {
|
|
2426
|
-
|
|
2561
|
+
// Translate reason strings to target language if not English
|
|
2562
|
+
const translatedReason = {};
|
|
2563
|
+
for (const [key, val] of Object.entries(reason)) {
|
|
2564
|
+
translatedReason[key] = locale.Locale.gettext(val, language);
|
|
2565
|
+
}
|
|
2566
|
+
result.reason = translatedReason;
|
|
2427
2567
|
for (const num of reasons) {
|
|
2428
2568
|
if (num === 'haftara' || num === 'sephardic') {
|
|
2429
2569
|
const haftObj = result[num === 'haftara' ? 'haft' : 'seph'];
|
|
2430
2570
|
const hafts = Array.isArray(haftObj) ? haftObj : [haftObj];
|
|
2431
2571
|
for (const haft of hafts) {
|
|
2432
|
-
haft.reason =
|
|
2572
|
+
haft.reason = translatedReason[num];
|
|
2433
2573
|
}
|
|
2434
2574
|
}
|
|
2435
2575
|
else {
|
|
2436
2576
|
const aliyah = result.fullkriyah[num];
|
|
2437
2577
|
if (typeof aliyah === 'object') {
|
|
2438
|
-
aliyah.reason =
|
|
2578
|
+
aliyah.reason = translatedReason[num];
|
|
2439
2579
|
}
|
|
2440
2580
|
}
|
|
2441
2581
|
}
|
|
2442
2582
|
}
|
|
2443
|
-
return result;
|
|
2583
|
+
return translateLeyning(result, language);
|
|
2444
2584
|
}
|
|
2445
2585
|
/**
|
|
2446
2586
|
* Returns the parsha metadata
|
|
2447
2587
|
* @param parsha untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei']
|
|
2448
2588
|
*/
|
|
2449
|
-
function lookupParsha(parsha) {
|
|
2589
|
+
function lookupParsha(parsha, language = 'en') {
|
|
2450
2590
|
const name = parshaToString(parsha);
|
|
2451
2591
|
const raw = parshiyotObj[name];
|
|
2452
2592
|
if (typeof raw !== 'object') {
|
|
@@ -2459,12 +2599,16 @@ function lookupParsha(parsha) {
|
|
|
2459
2599
|
}
|
|
2460
2600
|
if (!raw.haft) {
|
|
2461
2601
|
const haftKey = p1 === 'Nitzavim' ? p1 : p2;
|
|
2462
|
-
raw.haft = lookupParsha(haftKey).haft;
|
|
2602
|
+
raw.haft = lookupParsha(haftKey, language).haft;
|
|
2463
2603
|
}
|
|
2464
2604
|
}
|
|
2465
2605
|
else {
|
|
2466
2606
|
raw.hebrew = locale.Locale.gettext(name, 'he');
|
|
2467
2607
|
}
|
|
2608
|
+
raw.haft = translateAliyahOrArray(raw.haft, language);
|
|
2609
|
+
if (raw.seph) {
|
|
2610
|
+
raw.seph = translateAliyahOrArray(raw.seph, language);
|
|
2611
|
+
}
|
|
2468
2612
|
return raw;
|
|
2469
2613
|
}
|
|
2470
2614
|
|
|
@@ -2505,7 +2649,7 @@ function findParshaHaShavua(saturday, il) {
|
|
|
2505
2649
|
/* NOTREACHED */
|
|
2506
2650
|
throw new Error(`can't findParshaHaShavua for ${saturday}/${il}`);
|
|
2507
2651
|
}
|
|
2508
|
-
function getLeyningOnDate(hdate, il, wantarray = false) {
|
|
2652
|
+
function getLeyningOnDate(hdate, il, wantarray = false, language = 'en') {
|
|
2509
2653
|
const dow = hdate.getDay();
|
|
2510
2654
|
const arr = [];
|
|
2511
2655
|
let hasParshaHaShavua = false;
|
|
@@ -2515,7 +2659,7 @@ function getLeyningOnDate(hdate, il, wantarray = false) {
|
|
|
2515
2659
|
const parsha = sedra$1.lookup(hdate);
|
|
2516
2660
|
if (!parsha.chag) {
|
|
2517
2661
|
const parshaEvent = new ParshaEvent.ParshaEvent(parsha);
|
|
2518
|
-
const reading = getLeyningForParshaHaShavua(parshaEvent, il);
|
|
2662
|
+
const reading = getLeyningForParshaHaShavua(parshaEvent, il, language);
|
|
2519
2663
|
if (wantarray) {
|
|
2520
2664
|
hasParshaHaShavua = true;
|
|
2521
2665
|
arr.push(reading);
|
|
@@ -2573,7 +2717,14 @@ function getLeyningOnDate(hdate, il, wantarray = false) {
|
|
|
2573
2717
|
};
|
|
2574
2718
|
arr.unshift(reading);
|
|
2575
2719
|
}
|
|
2576
|
-
|
|
2720
|
+
// call translateLeyning on arr or arr[0]
|
|
2721
|
+
if (arr.length === 0) {
|
|
2722
|
+
return wantarray ? arr : arr[0];
|
|
2723
|
+
}
|
|
2724
|
+
if (wantarray) {
|
|
2725
|
+
return arr.map(reading => translateLeyning(reading, language));
|
|
2726
|
+
}
|
|
2727
|
+
return translateLeyning(arr[0], language);
|
|
2577
2728
|
}
|
|
2578
2729
|
const minchaSuffix = ' (Mincha)';
|
|
2579
2730
|
function getMincha(ev, il) {
|