@hebcal/core 6.16.1 → 6.16.3
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 +288 -208
- package/dist/bundle.js.map +1 -1
- package/dist/bundle.min.js +5 -5
- package/dist/bundle.min.js.map +1 -1
- package/dist/esm/DailyLearning.js +1 -1
- package/dist/esm/HebrewDateEvent.js +1 -1
- package/dist/esm/HolidayEvent.js +1 -1
- package/dist/esm/KiddushLevanaEvent.js +3 -4
- package/dist/esm/KiddushLevanaEvent.js.map +1 -1
- package/dist/esm/MevarchimChodeshEvent.js +1 -1
- package/dist/esm/ParshaEvent.js +1 -1
- package/dist/esm/TimedEvent.js +1 -1
- package/dist/esm/YomKippurKatanEvent.js +1 -1
- package/dist/esm/ashkenazi.po.js +1 -1
- package/dist/esm/calendar.js +4 -4
- package/dist/esm/calendar.js.map +1 -1
- package/dist/esm/candles.js +4 -2
- package/dist/esm/candles.js.map +1 -1
- package/dist/esm/cities.json.js +1 -1
- package/dist/esm/event.js +1 -1
- package/dist/esm/getStartAndEnd.js +2 -2
- package/dist/esm/getStartAndEnd.js.map +1 -1
- package/dist/esm/hallel.js +1 -1
- package/dist/esm/he-x-NoNikud.po.js +1 -1
- package/dist/esm/he.po.js +1 -1
- package/dist/esm/hebcal.js +3 -6
- package/dist/esm/hebcal.js.map +1 -1
- package/dist/esm/holidays.d.ts +17 -0
- package/dist/esm/holidays.js +78 -21
- package/dist/esm/holidays.js.map +1 -1
- package/dist/esm/horizon.js +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/isAssurBemlacha.js +7 -23
- package/dist/esm/isAssurBemlacha.js.map +1 -1
- package/dist/esm/isAveilut.js +1 -1
- package/dist/esm/isFastDay.js +1 -1
- package/dist/esm/isYomTov.d.ts +21 -0
- package/dist/esm/isYomTov.js +46 -0
- package/dist/esm/isYomTov.js.map +1 -0
- package/dist/esm/locale.js +1 -1
- package/dist/esm/location.js +3 -3
- package/dist/esm/location.js.map +1 -1
- package/dist/esm/modern.js +1 -1
- package/dist/esm/molad.js +1 -1
- package/dist/esm/moladBase.js +1 -1
- package/dist/esm/moladDate.js +1 -1
- package/dist/esm/omer.js +1 -1
- package/dist/esm/parshaName.js +1 -1
- package/dist/esm/parshaYear.js +1 -1
- package/dist/esm/pkgVersion.d.ts +1 -1
- package/dist/esm/pkgVersion.js +2 -2
- package/dist/esm/pkgVersion.js.map +1 -1
- package/dist/esm/reformatTimeStr.js +2 -2
- package/dist/esm/reformatTimeStr.js.map +1 -1
- package/dist/esm/sedra.js +2 -2
- package/dist/esm/sedra.js.map +1 -1
- package/dist/esm/sefira.json.js +1 -1
- package/dist/esm/staticHolidays.js +1 -1
- package/dist/esm/string.js +1 -1
- package/dist/esm/tachanun.js +1 -1
- package/dist/esm/zenith.js +1 -1
- package/dist/esm/zmanim.js +4 -4
- package/dist/esm/zmanim.js.map +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getStartAndEnd.js","sources":["../../../src/getStartAndEnd.ts"],"sourcesContent":["import {greg2abs, isDate, daysInGregMonth, HDate, months} from '@hebcal/hdate';\nimport {CalOptions} from './CalOptions.js';\n\nconst {TISHREI} = months;\n\n/**\n * Gets the R.D. days for a number, Date, or HDate\n */\nfunction getAbs(d: Date | HDate | number): number {\n if (typeof d === 'number') return d;\n if (isDate(d)) return greg2abs(d);\n if (HDate.isHDate(d)) return d.abs();\n throw new TypeError(`Invalid date type: ${d}`);\n}\n\nfunction getYear(options: CalOptions): number {\n if (options.year !== undefined) {\n return Number(options.year);\n }\n return options.isHebrewYear\n ? new HDate().getFullYear()\n : new Date().getFullYear();\n}\n\nconst MAX_NUM_YEARS = 2000;\n\n/**\n * Parse options object to determine start & end days\n * @internal\n */\nexport function getStartAndEnd(options: CalOptions): number[] {\n const {start: start0, end: end0} = options;\n if ((start0 === undefined) !== (end0 === undefined)) {\n throw new TypeError('options.start requires options.end');\n }\n if (start0 !== undefined && end0 !== undefined) {\n const start = getAbs(start0);\n const end = getAbs(end0);\n if (end - start > 365 * MAX_NUM_YEARS) {\n throw new RangeError(`Date range exceeds ${MAX_NUM_YEARS} years`);\n }\n return [start, end];\n }\n const isHebrewYear = Boolean(options.isHebrewYear);\n const theYear = getYear(options);\n if (Number.isNaN(theYear)) {\n throw new RangeError(`Invalid year ${options.year}`);\n }\n if (isHebrewYear && theYear < 1) {\n throw new RangeError(`Invalid Hebrew year ${theYear}`);\n }\n const theMonth = getMonth(options);\n const numYears = Number(options.numYears) || 1;\n if (numYears > MAX_NUM_YEARS) {\n throw new RangeError(`options.numYears exceeds ${MAX_NUM_YEARS}`);\n }\n if (isHebrewYear) {\n return startEndHebrew(theMonth, theYear, numYears);\n } else {\n return startEndGregorian(theMonth, theYear, numYears);\n }\n}\n\nfunction getMonth(options: CalOptions): number {\n if (options.month) {\n if (options.isHebrewYear) {\n return HDate.monthNum(options.month);\n }\n if (typeof options.month === 'number') {\n return options.month;\n }\n }\n return NaN;\n}\n\nfunction startEndGregorian(\n theMonth: number,\n theYear: number,\n numYears: number\n): number[] {\n const gregMonth = theMonth ? theMonth - 1 : 0;\n const startGreg = new Date(theYear, gregMonth, 1);\n if (theYear < 100) {\n startGreg.setFullYear(theYear);\n }\n const startAbs = greg2abs(startGreg);\n let endAbs: number;\n if (theMonth) {\n endAbs = startAbs + daysInGregMonth(theMonth, theYear) - 1;\n } else {\n const endYear = theYear + numYears;\n const endGreg = new Date(endYear, 0, 1);\n if (endYear < 100) {\n endGreg.setFullYear(endYear);\n }\n endAbs = greg2abs(endGreg) - 1;\n }\n return [startAbs, endAbs];\n}\n\nfunction startEndHebrew(\n theMonth: number,\n theYear: number,\n numYears: number\n): number[] {\n const startDate = new HDate(1, theMonth || TISHREI, theYear);\n let startAbs = startDate.abs();\n const endAbs = theMonth\n ? startAbs + startDate.daysInMonth()\n : new HDate(1, TISHREI, theYear + numYears).abs() - 1;\n // for full Hebrew year, start on Erev Rosh Hashana which\n // is technically in the previous Hebrew year\n // (but conveniently lets us get candle-lighting time for Erev)\n if (!theMonth && theYear > 1) {\n startAbs--;\n }\n return [startAbs, endAbs];\n}\n"],"names":[],"mappings":";;;AAGA,MAAM,EAAC,OAAO,EAAC,GAAG,MAAM;AAExB;;AAEG;AACH,SAAS,MAAM,CAAC,CAAwB,EAAA;IACtC,IAAI,OAAO,CAAC,KAAK,QAAQ;AAAE,QAAA,OAAO,CAAC;IACnC,IAAI,MAAM,CAAC,CAAC,CAAC;AAAE,QAAA,OAAO,QAAQ,CAAC,CAAC,CAAC;AACjC,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAAE,QAAA,OAAO,CAAC,CAAC,GAAG,EAAE;AACpC,IAAA,MAAM,IAAI,SAAS,CAAC,sBAAsB,CAAC,CAAA,CAAE,CAAC;AAChD;AAEA,SAAS,OAAO,CAAC,OAAmB,EAAA;AAClC,IAAA,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE;AAC9B,QAAA,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;IAC7B;IACA,OAAO,OAAO,CAAC;AACb,UAAE,IAAI,KAAK,EAAE,CAAC,WAAW;AACzB,UAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;AAC9B;AAEA,MAAM,aAAa,GAAG,IAAI;AAE1B;;;AAGG;AACG,SAAU,cAAc,CAAC,OAAmB,EAAA;IAChD,MAAM,EAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAC,GAAG,OAAO;AAC1C,IAAA,IAAI,CAAC,MAAM,KAAK,SAAS,OAAO,IAAI,KAAK,SAAS,CAAC,EAAE;AACnD,QAAA,MAAM,IAAI,SAAS,CAAC,oCAAoC,CAAC;IAC3D;IACA,IAAI,MAAM,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS,EAAE;AAC9C,QAAA,MAAM,KAAK,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AAK,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC;QACtC;AACA,QAAA,IAAI,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,EAAE;YACrC,OAAO,OAAO,CAAC,KAAK;QACtB;IACF;
|
|
1
|
+
{"version":3,"file":"getStartAndEnd.js","sources":["../../../src/getStartAndEnd.ts"],"sourcesContent":["import {greg2abs, isDate, daysInGregMonth, HDate, months} from '@hebcal/hdate';\nimport {CalOptions} from './CalOptions.js';\n\nconst {TISHREI} = months;\n\n/**\n * Gets the R.D. days for a number, Date, or HDate\n */\nfunction getAbs(d: Date | HDate | number): number {\n if (typeof d === 'number') return d;\n if (isDate(d)) return greg2abs(d);\n if (HDate.isHDate(d)) return d.abs();\n throw new TypeError(`Invalid date type: ${d}`);\n}\n\nfunction getYear(options: CalOptions): number {\n if (options.year !== undefined) {\n return Number(options.year);\n }\n return options.isHebrewYear\n ? new HDate().getFullYear()\n : new Date().getFullYear();\n}\n\nconst MAX_NUM_YEARS = 2000;\n\n/**\n * Parse options object to determine start & end days\n * @internal\n */\nexport function getStartAndEnd(options: CalOptions): number[] {\n const {start: start0, end: end0} = options;\n if ((start0 === undefined) !== (end0 === undefined)) {\n throw new TypeError('options.start requires options.end');\n }\n if (start0 !== undefined && end0 !== undefined) {\n const start = getAbs(start0);\n const end = getAbs(end0);\n if (end - start > 365 * MAX_NUM_YEARS) {\n throw new RangeError(`Date range exceeds ${MAX_NUM_YEARS} years`);\n }\n return [start, end];\n }\n const isHebrewYear = Boolean(options.isHebrewYear);\n const theYear = getYear(options);\n if (Number.isNaN(theYear)) {\n throw new RangeError(`Invalid year ${options.year}`);\n }\n if (isHebrewYear && theYear < 1) {\n throw new RangeError(`Invalid Hebrew year ${theYear}`);\n }\n const theMonth = getMonth(options);\n const numYears = Number(options.numYears) || 1;\n if (numYears > MAX_NUM_YEARS) {\n throw new RangeError(`options.numYears exceeds ${MAX_NUM_YEARS}`);\n }\n if (isHebrewYear) {\n return startEndHebrew(theMonth, theYear, numYears);\n } else {\n return startEndGregorian(theMonth, theYear, numYears);\n }\n}\n\nfunction getMonth(options: CalOptions): number {\n if (options.month) {\n if (options.isHebrewYear) {\n return HDate.monthNum(options.month);\n }\n if (typeof options.month === 'number') {\n return options.month;\n }\n }\n return Number.NaN;\n}\n\nfunction startEndGregorian(\n theMonth: number,\n theYear: number,\n numYears: number\n): number[] {\n const gregMonth = theMonth ? theMonth - 1 : 0;\n const startGreg = new Date(theYear, gregMonth, 1);\n if (theYear < 100) {\n startGreg.setFullYear(theYear);\n }\n const startAbs = greg2abs(startGreg);\n let endAbs: number;\n if (theMonth) {\n endAbs = startAbs + daysInGregMonth(theMonth, theYear) - 1;\n } else {\n const endYear = theYear + numYears;\n const endGreg = new Date(endYear, 0, 1);\n if (endYear < 100) {\n endGreg.setFullYear(endYear);\n }\n endAbs = greg2abs(endGreg) - 1;\n }\n return [startAbs, endAbs];\n}\n\nfunction startEndHebrew(\n theMonth: number,\n theYear: number,\n numYears: number\n): number[] {\n const startDate = new HDate(1, theMonth || TISHREI, theYear);\n let startAbs = startDate.abs();\n const endAbs = theMonth\n ? startAbs + startDate.daysInMonth()\n : new HDate(1, TISHREI, theYear + numYears).abs() - 1;\n // for full Hebrew year, start on Erev Rosh Hashana which\n // is technically in the previous Hebrew year\n // (but conveniently lets us get candle-lighting time for Erev)\n if (!theMonth && theYear > 1) {\n startAbs--;\n }\n return [startAbs, endAbs];\n}\n"],"names":[],"mappings":";;;AAGA,MAAM,EAAC,OAAO,EAAC,GAAG,MAAM;AAExB;;AAEG;AACH,SAAS,MAAM,CAAC,CAAwB,EAAA;IACtC,IAAI,OAAO,CAAC,KAAK,QAAQ;AAAE,QAAA,OAAO,CAAC;IACnC,IAAI,MAAM,CAAC,CAAC,CAAC;AAAE,QAAA,OAAO,QAAQ,CAAC,CAAC,CAAC;AACjC,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAAE,QAAA,OAAO,CAAC,CAAC,GAA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 or later https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
import { months, HDate } from '@hebcal/hdate';
|
|
3
3
|
import { dateYomHaZikaron } from './modern.js';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v6.16.
|
|
1
|
+
/*! @hebcal/core v6.16.3, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
var noNikudOverride = { "headers": { "plural-forms": "nplurals=2; plural=(n != 1);", "language": "he-x-NoNikud" }, "contexts": { "": { "Korach": ["קורח"], "Chukat": ["חוקת"], "Erev Yom Kippur": ["ערב יום כיפור"], "Yom Kippur": ["יום כיפור"], "Yom Kippur Katan": ["יום כיפור קטן"], "Pesach Shabbat Chol ha-Moed": ["שבת חול המועד פסח"], "Sukkot Shabbat Chol ha-Moed": ["שבת חול המועד סוכות"], "Erev Sukkot": ["ערב סוכות"], "Sukkot": ["סוכות"], "Sukkot I": ["סוכות א׳"], "Sukkot II": ["סוכות ב׳"], "Sukkot II (CH''M)": ["סוכות ב׳ (חוה״מ)"], "Sukkot III (CH''M)": ["סוכות ג׳ (חוה״מ)"], "Sukkot IV (CH''M)": ["סוכות ד׳ (חוה״מ)"], "Sukkot V (CH''M)": ["סוכות ה׳ (חוה״מ)"], "Sukkot VI (CH''M)": ["סוכות ו׳ (חוה״מ)"], "Sukkot VII (Hoshana Raba)": ["סוכות ז׳ (הושענא רבה)"], "Swords of Iron War Memorial Day": ["יום הזיכרון לחללי מלחמת חרבות ברזל"], "Latest Kiddush Levana": ["סוף זמן קידוש לבנה"] } } };
|
|
3
3
|
|
|
4
4
|
export { noNikudOverride as default };
|
package/dist/esm/he.po.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v6.16.
|
|
1
|
+
/*! @hebcal/core v6.16.3, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
var poHe = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);", "language": "he_IL" }, "contexts": { "": { "Shabbat": ["שַׁבָּת"], "Parashat": ["פָּרָשַׁת"], "Achrei Mot": ["אַחֲרֵי מוֹת"], "Balak": ["בָּלָק"], "Bamidbar": ["בְּמִדְבַּר"], "Bechukotai": ["בְּחֻקֹּתַי"], "Beha'alotcha": ["בְּהַעֲלֹתְךָ"], "Behar": ["בְּהַר"], "Bereshit": ["בְּרֵאשִׁית"], "Beshalach": ["בְּשַׁלַּח"], "Bo": ["בֹּא"], "Chayei Sara": ["חַיֵּי שָֹרָה"], "Chukat": ["חֻקַּת"], "Devarim": ["דְּבָרִים"], "Eikev": ["עֵקֶב"], "Emor": ["אֱמוֹר"], "Ha'azinu": ["הַאֲזִינוּ"], "Kedoshim": ["קְדֹשִׁים"], "Ki Tavo": ["כִּי־תָבוֹא"], "Ki Teitzei": ["כִּי־תֵצֵא"], "Ki Tisa": ["כִּי תִשָּׂא"], "Korach": ["קֹרַח"], "Lech-Lecha": ["לֶךְ־לְךָ"], "Masei": ["מַסְעֵי"], "Matot": ["מַטּוֹת"], "Metzora": ["מְצֹרָע"], "Miketz": ["מִקֵּץ"], "Mishpatim": ["מִשְׁפָּטִים"], "Nasso": ["נָשׂא"], "Nitzavim": ["נִצָּבִים"], "Noach": ["נֹחַ"], "Pekudei": ["פְקוּדֵי"], "Pinchas": ["פִּינְחָס"], "Re'eh": ["רְאֵה"], "Sh'lach": ["שְׁלַח־לְךָ"], "Shemot": ["שְׁמוֹת"], "Shmini": ["שְּׁמִינִי"], "Shoftim": ["שׁוֹפְטִים"], "Tazria": ["תַזְרִיעַ"], "Terumah": ["תְּרוּמָה"], "Tetzaveh": ["תְּצַוֶּה"], "Toldot": ["תּוֹלְדוֹת"], "Tzav": ["צַו"], "Vaera": ["וָאֵרָא"], "Vaetchanan": ["וָאֶתְחַנַּן"], "Vayakhel": ["וַיַּקְהֵל"], "Vayechi": ["וַיְחִי"], "Vayeilech": ["וַיֵּלֶךְ"], "Vayera": ["וַיֵּרָא"], "Vayeshev": ["וַיֵּשֶׁב"], "Vayetzei": ["וַיֵּצֵא"], "Vayigash": ["וַיִּגַּשׁ"], "Vayikra": ["וַיִּקְרָא"], "Vayishlach": ["וַיִּשְׁלַח"], "Vezot Haberakhah": ["וְזֹאת הַבְּרָכָה"], "Yitro": ["יִתְרוֹ"], "Asara B'Tevet": ["עֲשָׂרָה בְּטֵבֵת"], "Candle lighting": ["הַדְלָקַת נֵרוֹת"], "Chanukah": ["חֲנוּכָּה"], "Chanukah: 1 Candle": ["חֲנוּכָּה: א׳ נֵר"], "Chanukah: 2 Candles": ["חֲנוּכָּה: ב׳ נֵרוֹת"], "Chanukah: 3 Candles": ["חֲנוּכָּה: ג׳ נֵרוֹת"], "Chanukah: 4 Candles": ["חֲנוּכָּה: ד׳ נֵרוֹת"], "Chanukah: 5 Candles": ["חֲנוּכָּה: ה׳ נֵרוֹת"], "Chanukah: 6 Candles": ["חֲנוּכָּה: ו׳ נֵרוֹת"], "Chanukah: 7 Candles": ["חֲנוּכָּה: ז׳ נֵרוֹת"], "Chanukah: 8 Candles": ["חֲנוּכָּה: ח׳ נֵרוֹת"], "Chanukah: 8th Day": ["חֲנוּכָּה: יוֹם ח׳"], "Days of the Omer": ["סְפִירַת הָעוֹמֶר"], "Omer": ["עוֹמֶר"], "day of the Omer": ["בָּעוֹמֶר"], "Erev Pesach": ["עֶרֶב פֶּסַח"], "Erev Purim": ["עֶרֶב פּוּרִים"], "Erev Rosh Hashana": ["עֶרֶב רֹאשׁ הַשָּׁנָה"], "Erev Shavuot": ["עֶרֶב שָׁבוּעוֹת"], "Erev Simchat Torah": ["עֶרֶב שִׂמְחַת תּוֹרָה"], "Erev Sukkot": ["עֶרֶב סֻכּוֹת"], "Erev Tish'a B'Av": ["עֶרֶב תִּשְׁעָה בְּאָב"], "Erev Yom Kippur": ["עֶרֶב יוֹם כִּפּוּר"], "Havdalah": ["הַבְדָּלָה"], "Lag BaOmer": ["ל״ג בָּעוֹמֶר"], "Leil Selichot": ["סְלִיחוֹת"], "Pesach": ["פֶּסַח"], "Pesach I": ["פֶּסַח א׳"], "Pesach II": ["פֶּסַח ב׳"], "Pesach II (CH''M)": ["פֶּסַח ב׳ (חוה״מ)"], "Pesach III (CH''M)": ["פֶּסַח ג׳ (חוה״מ)"], "Pesach IV (CH''M)": ["פֶּסַח ד׳ (חוה״מ)"], "Pesach Sheni": ["פֶּסַח שֵׁנִי"], "Pesach V (CH''M)": ["פֶּסַח ה׳ (חוה״מ)"], "Pesach VI (CH''M)": ["פֶּסַח ו׳ (חוה״מ)"], "Pesach VII": ["פֶּסַח ז׳"], "Pesach VIII": ["פֶּסַח ח׳"], "Pesach Shabbat Chol ha-Moed": ["שַׁבַּת חֹל הַמּוֹעֵד פֶּסַח"], "Purim": ["פּוּרִים"], "Purim Katan": ["פּוּרִים קָטָן"], "Rosh Chodesh": ["רֹאשׁ חוֹדֶשׁ"], "Rosh Hashana": ["רֹאשׁ הַשָּׁנָה"], "Rosh Hashana I": ["רֹאשׁ הַשָּׁנָה א׳"], "Rosh Hashana II": ["רֹאשׁ הַשָּׁנָה ב׳"], "Shabbat Chazon": ["שַׁבַּת חֲזוֹן"], "Shabbat HaChodesh": ["שַׁבַּת הַחֹדֶשׁ"], "Shabbat HaGadol": ["שַׁבַּת הַגָּדוֹל"], "Shabbat Nachamu": ["שַׁבַּת נַחֲמוּ"], "Shabbat Parah": ["שַׁבַּת פָּרָה"], "Shabbat Shekalim": ["שַׁבַּת שְׁקָלִים"], "Shabbat Shuva": ["שַׁבַּת שׁוּבָה"], "Shabbat Zachor": ["שַׁבַּת זָכוֹר"], "Shavuot": ["שָׁבוּעוֹת"], "Shavuot I": ["שָׁבוּעוֹת א׳"], "Shavuot II": ["שָׁבוּעוֹת ב׳"], "Shmini Atzeret": ["שְׁמִינִי עֲצֶרֶת"], "Shushan Purim": ["שׁוּשָׁן פּוּרִים"], "Sigd": ["חַג הַסִּיגְד"], "Simchat Torah": ["שִׂמְחַת תּוֹרָה"], "Sukkot": ["סֻכּוֹת"], "Sukkot I": ["סֻכּוֹת א׳"], "Sukkot II": ["סֻכּוֹת ב׳"], "Sukkot II (CH''M)": ["סֻכּוֹת ב׳ (חוה״מ)"], "Sukkot III (CH''M)": ["סֻכּוֹת ג׳ (חוה״מ)"], "Sukkot IV (CH''M)": ["סֻכּוֹת ד׳ (חוה״מ)"], "Sukkot V (CH''M)": ["סֻכּוֹת ה׳ (חוה״מ)"], "Sukkot VI (CH''M)": ["סֻכּוֹת ו׳ (חוה״מ)"], "Sukkot VII (Hoshana Raba)": ["סֻכּוֹת ז׳ (הוֹשַׁעְנָא רַבָּה)"], "Sukkot Shabbat Chol ha-Moed": ["שַׁבַּת חֹל הַמּוֹעֵד סֻכּוֹת"], "Ta'anit Bechorot": ["תַּעֲנִית בְּכוֹרוֹת"], "Ta'anit BeHaB": ["תַּעֲנִית בה״ב"], "Ta'anit Esther": ["תַּעֲנִית אֶסְתֵּר"], "Tish'a B'Av": ["תִּשְׁעָה בְּאָב"], "Tu B'Av": ["ט״וּ בְּאָב"], "Tu BiShvat": ["ט״וּ בִּשְׁבָט"], "Tu B'Shvat": ["ט״וּ בִּשְׁבָט"], "Tzom Gedaliah": ["צוֹם גְּדַלְיָה"], "Tzom Tammuz": ["צוֹם י״ז בְּתַמּוּז"], "Yom HaAtzma'ut": ["יוֹם הָעַצְמָאוּת"], "Yom HaShoah": ["יוֹם הַשּׁוֹאָה"], "Yom HaZikaron": ["יוֹם הַזִּכָּרוֹן"], "Yom Kippur": ["יוֹם כִּפּוּר"], "Yom Yerushalayim": ["יוֹם יְרוּשָׁלַיִם"], "Yom HaAliyah": ["יוֹם הַעֲלִיָּה"], "Yom HaAliyah School Observance": ["שְׁמִירָת בֵּית הַסֵפֶר לְיוֹם הַעֲלִיָּה"], "Rosh Chodesh Adar": ["רֹאשׁ חוֹדֶשׁ אֲדָר"], "Rosh Chodesh Adar I": ["רֹאשׁ חוֹדֶשׁ אֲדָר א׳"], "Rosh Chodesh Adar II": ["רֹאשׁ חוֹדֶשׁ אֲדָר ב׳"], "Rosh Chodesh Av": ["רֹאשׁ חוֹדֶשׁ אָב"], "Rosh Chodesh Cheshvan": ["רֹאשׁ חוֹדֶשׁ חֶשְׁוָן"], "Rosh Chodesh Elul": ["רֹאשׁ חוֹדֶשׁ אֱלוּל"], "Rosh Chodesh Iyyar": ["רֹאשׁ חוֹדֶשׁ אִיָּיר"], "Rosh Chodesh Kislev": ["רֹאשׁ חוֹדֶשׁ כִּסְלֵו"], "Rosh Chodesh Nisan": ["רֹאשׁ חוֹדֶשׁ נִיסָן"], "Rosh Chodesh Sh'vat": ["רֹאשׁ חוֹדֶשׁ שְׁבָט"], "Rosh Chodesh Sivan": ["רֹאשׁ חוֹדֶשׁ סִיוָן"], "Rosh Chodesh Tamuz": ["רֹאשׁ חוֹדֶשׁ תַּמּוּז"], "Rosh Chodesh Tammuz": ["רֹאשׁ חוֹדֶשׁ תַּמּוּז"], "Rosh Chodesh Tevet": ["רֹאשׁ חוֹדֶשׁ טֵבֵת"], "min": ["דַּקּוֹת"], "Fast begins": ["תְּחִילַּת הַצוֹם"], "Fast ends": ["סִיּוּם הַצוֹם"], "Rosh Hashana LaBehemot": ["רֹאשׁ הַשָּׁנָה לְמַעְשַׂר בְּהֵמָה"], "Tish'a B'Av (observed)": ["(תִּשְׁעָה בְּאָב (נִדְחָה"], "Shabbat Mevarchim Chodesh": ["שַׁבַּת מְבָרְכִים חוֹדֶשׁ"], "Shabbat Shirah": ["שַׁבַּת שִׁירָה"], "Lovingkindness": ["חֶסֶד"], "Might": ["גְּבוּרָה"], "Beauty": ["תִּפְאֶרֶת"], "Eternity": ["נֶּצַח"], "Splendor": ["הוֹד"], "Foundation": ["יְּסוֹד"], "Majesty": ["מַּלְכוּת"], "day": ["יוֹם"], "Yom Kippur Katan": ["יוֹם כִּפּוּר קָטָן"], "Yizkor": ["יִזְכּוֹר"], "Family Day": ["יוֹם הַמִּשׁפָּחָה"], "Yitzhak Rabin Memorial Day": ["יוֹם הַזִּכָּרוֹן לְיִצְחָק רַבִּין"], "Jabotinsky Day": ["יוֹם זַ׳בּוֹטִינְסְקִי"], "Herzl Day": ["יוֹם הֶרְצְל"], "Ben-Gurion Day": ["יוֹם בֶּן־גּוּרִיּוֹן"], "Hebrew Language Day": ["יוֹם הַשָׂפָה הַעִברִית"], "Birkat Hachamah": ["בִּרְכַּת הַחַמָּה"], "Birkat HaChamah": ["בִּרְכַּת הַחַמָּה"], "Shushan Purim Katan": ["שׁוּשָׁן פּוּרִים קָטָן"], "Purim Meshulash": ["פּוּרִים מְשׁוּלָּשׁ"], "Chag HaBanot": ["חַג הַבָּנוֹת"], "Molad": ["מוֹלָד הָלְּבָנָה"], "chalakim": ["חֲלָקִים"], "Alot HaShachar": ["עֲלוֹת הַשַּׁחַר"], "Misheyakir": ["מִשֶּׁיַּכִּיר"], "Misheyakir Machmir": ["מִשֶּׁיַּכִּיר מַחְמִיר"], "Sunrise": ["נֵץ הַחַמָּה"], "Kriat Shema, sof zeman": ["סוֹף זְמַן קְרִיאַת שְׁמַע"], "Tefilah, sof zeman": ["סוֹף זְמַן תְּפִלָּה"], "Kriat Shema, sof zeman (MGA)": ["סוֹף זְמַן קְרִיאַת שְׁמַע (מג״א)"], "Kriat Shema, sof zeman (GRA)": ["סוֹף זְמַן קְרִיאַת שְׁמַע (גְּרָ״א)"], "Tefilah, sof zeman (MGA)": ["סוֹף זְמַן תְּפִלָּה (מג״א)"], "Tefilah, sof zeman (GRA)": ["סוֹף זְמַן תְּפִלָּה (גְּרָ״א)"], "Chatzot HaLailah": ["חֲצוֹת הַלַּיְלָה"], "Chatzot HaYom": ["חֲצוֹת הַיּוֹם"], "Chatzot hayom": ["חֲצוֹת הַיּוֹם"], "Mincha Gedolah": ["מִנְחָה גְּדוֹלָה"], "Mincha Ketanah": ["מִנְחָה קְטַנָּה"], "Plag HaMincha": ["פְּלַג הַמִּנְחָה"], "Sunset": ["שְׁקִיעַת הַחַמָּה"], "Bein HaShemashot": ["בֵּין הַשְּׁמָשׁוֹת"], "Tzeit HaKochavim": ["צֵאת הַכּוֹכָבִים"], "Biur Chametz": ["בִּעוּר חָמֵץ"], "Finish eating chametz": ["סוֹף זְמַן אֲכִילַת חָמֵץ"], "Swords of Iron War Memorial Day": ["יוֹם הַזִּכָּרוֹן לְחַלְלֵי מִלְחֶמֶת חַרְבוֹת בַּרְזֶל"], "Latest Kiddush Levana": ["סוֹף זְמַן קִדּוּשׁ לְבָנָה"] } } };
|
|
3
3
|
|
|
4
4
|
export { poHe as default };
|
package/dist/esm/hebcal.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
/*! @hebcal/core v6.16.
|
|
1
|
+
/*! @hebcal/core v6.16.3, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
import { birthdayOrAnniversary, yahrzeit, HDate } from '@hebcal/hdate';
|
|
3
3
|
import './locale.js';
|
|
4
4
|
import { version } from './pkgVersion.js';
|
|
5
5
|
import { getSedra } from './sedra.js';
|
|
6
6
|
import { hallel } from './hallel.js';
|
|
7
|
+
import { isYomTov } from './isYomTov.js';
|
|
7
8
|
import { getHolidaysForYear_, getHolidaysForYearArray, getHolidaysOnDate } from './holidays.js';
|
|
8
9
|
import { reformatTimeStr } from './reformatTimeStr.js';
|
|
9
10
|
import { tachanun } from './tachanun.js';
|
|
@@ -220,7 +221,7 @@ class HebrewCalendar {
|
|
|
220
221
|
const today = new HDate(date);
|
|
221
222
|
const friday = today.after(5);
|
|
222
223
|
const tomorrow = today.next();
|
|
223
|
-
return
|
|
224
|
+
return isYomTov(friday, il) && !isYomTov(today, il) && isYomTov(tomorrow, il);
|
|
224
225
|
}
|
|
225
226
|
/**
|
|
226
227
|
* Helper function to format a 24-hour (00:00-23:59) time string in either
|
|
@@ -319,10 +320,6 @@ class HebrewCalendar {
|
|
|
319
320
|
return tachanun(hdate, il);
|
|
320
321
|
}
|
|
321
322
|
}
|
|
322
|
-
function isChag(date, il) {
|
|
323
|
-
const events = getHolidaysOnDate(date, il) ?? [];
|
|
324
|
-
return events.some(ev => ev.hasFlag('CHAG'));
|
|
325
|
-
}
|
|
326
323
|
|
|
327
324
|
export { HebrewCalendar };
|
|
328
325
|
//# sourceMappingURL=hebcal.js.map
|
package/dist/esm/hebcal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hebcal.js","sources":["../../../src/hebcal.ts"],"sourcesContent":["/*\n Hebcal - A Jewish Calendar Generator\n Copyright (c) 1994-2020 Danny Sadinoff\n Portions copyright Eyal Schachter and Michael J. Radwin\n\n https://github.com/hebcal/hebcal-es6\n\n This program is free software; you can redistribute it and/or\n modify it under the terms of the GNU General Public License\n as published by the Free Software Foundation; either version 2\n of the License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport {birthdayOrAnniversary, yahrzeit, HDate} from '@hebcal/hdate';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\nimport {CalOptions} from './CalOptions.js';\nimport {version as pkgVersion} from './pkgVersion.js';\nimport {Event} from './event.js';\nimport {Sedra, getSedra} from './sedra.js';\nimport {hallel} from './hallel.js';\nimport {\n getHolidaysForYear_,\n getHolidaysForYearArray,\n getHolidaysOnDate,\n HolidayYearMap,\n} from './holidays.js';\nimport {HolidayEvent} from './HolidayEvent.js';\nimport {reformatTimeStr} from './reformatTimeStr.js';\nimport {TachanunResult, tachanun} from './tachanun.js';\nimport {calendar} from './calendar.js';\n\n/**\n * HebrewCalendar is the main interface to the `@hebcal/core` library.\n * This namespace is used to calculate holidays, rosh chodesh, candle lighting & havdalah times,\n * Parashat HaShavua, Daf Yomi, days of the omer, and the molad.\n * Event names can be rendered in several languges using the `locale` option.\n */\nexport class HebrewCalendar {\n private constructor() {}\n /**\n * Calculates holidays and other Hebrew calendar events based on {@link CalOptions}.\n *\n * Each holiday is represented by an {@link Event} object which includes a date,\n * a description, flags and optional attributes.\n * If given no options, returns holidays for the Diaspora for the current Gregorian year.\n *\n * This is a convenience wrapper around the standalone {@link calendar} function.\n * See {@link calendar} for the complete list of supported options, the\n * candle-lighting and Havdalah defaults, and notes on locales.\n *\n * @example\n * import {HebrewCalendar, Location} from '@hebcal/core';\n * const options: CalOptions = {\n * year: 1981,\n * isHebrewYear: false,\n * candlelighting: true,\n * location: Location.lookup('San Francisco'),\n * sedrot: true,\n * omer: true,\n * };\n * const events = HebrewCalendar.calendar(options);\n * for (const ev of events) {\n * const hd = ev.getDate();\n * const date = hd.greg();\n * console.log(date.toLocaleDateString(), ev.render('en'), hd.toString());\n * }\n */\n static calendar(options: CalOptions = {}): Event[] {\n return calendar(options);\n }\n\n /**\n * Calculates a birthday or anniversary (non-yahrzeit).\n * Returns `undefined` when `hyear` precedes the original year of `gdate`.\n *\n * When `hyear` is the original year, the original date is returned unchanged —\n * a \"0th birthday\" is a meaningful thing to ask for. This differs from\n * {@link getYahrzeit}, which returns `undefined` for the original year,\n * because a yahrzeit only has meaning from the first anniversary onward.\n *\n * Hebcal uses the algorithm defined in \"Calendrical Calculations\"\n * by Edward M. Reingold and Nachum Dershowitz.\n *\n * The birthday of someone born in Adar of an ordinary year or Adar II of\n * a leap year is also always in the last month of the year, be that Adar\n * or Adar II. The birthday in an ordinary year of someone born during the\n * first 29 days of Adar I in a leap year is on the corresponding day of Adar;\n * in a leap year, the birthday occurs in Adar I, as expected.\n *\n * Someone born on the thirtieth day of Marcheshvan, Kislev, or Adar I\n * has his birthday postponed until the first of the following month in\n * years where that day does not occur. [Calendrical Calculations p. 111]\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'\n * const hd = HebrewCalendar.getBirthdayOrAnniversary(5780, dt); // '1 Nisan 5780'\n * console.log(hd.greg().toLocaleDateString('en-US')); // '3/26/2020'\n * @param hyear Hebrew year\n * @param gdate Gregorian or Hebrew date of event\n * @returns anniversary occurring in `hyear`\n */\n static getBirthdayOrAnniversary(\n hyear: number,\n gdate: Date | HDate\n ): HDate | undefined {\n return birthdayOrAnniversary(hyear, gdate);\n }\n\n /**\n * Calculates yahrzeit.\n * `hyear` must be after original `gdate` of death.\n * Returns `undefined` when requested year preceeds or is same as original year.\n *\n * Hebcal uses the algorithm defined in \"Calendrical Calculations\"\n * by Edward M. Reingold and Nachum Dershowitz.\n *\n * The customary anniversary date of a death is more complicated and depends\n * also on the character of the year in which the first anniversary occurs.\n * There are several cases:\n *\n * * If the date of death is Marcheshvan 30, the anniversary in general depends\n * on the first anniversary; if that first anniversary was not Marcheshvan 30,\n * use the day before Kislev 1.\n * * If the date of death is Kislev 30, the anniversary in general again depends\n * on the first anniversary — if that was not Kislev 30, use the day before\n * Tevet 1.\n * * If the date of death is Adar II, the anniversary is the same day in the\n * last month of the Hebrew year (Adar or Adar II).\n * * If the date of death is Adar I 30, the anniversary in a Hebrew year that\n * is not a leap year (in which Adar only has 29 days) is the last day in\n * Shevat.\n * * In all other cases, use the normal (that is, same month number) anniversary\n * of the date of death. [Calendrical Calculations p. 113]\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'\n * const hd = HebrewCalendar.getYahrzeit(5780, dt); // '30 Sh\\'vat 5780'\n * console.log(hd.greg().toLocaleDateString('en-US')); // '2/25/2020'\n * @param hyear Hebrew year\n * @param gdate Gregorian or Hebrew date of death\n * @returns anniversary occurring in hyear\n */\n static getYahrzeit(hyear: number, gdate: Date | HDate): HDate | undefined {\n return yahrzeit(hyear, gdate);\n }\n\n /**\n * Lower-level holidays interface, which returns a `Map` of `Event`s indexed by\n * `HDate.toString()`. These events are not filtered by Israel vs. Diaspora\n * holiday scheme; use {@link Event.observedIn} to do that.\n *\n * Includes Rosh Chodesh, fasts, Yom Kippur Katan, Special Shabbatot, etc.,\n * but does not generate candle-lighting times, Torah readings, or Omer days.\n * The result is cached in an internal LRU.\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * const map = HebrewCalendar.getHolidaysForYear(5784);\n * for (const [hdStr, events] of map.entries()) {\n * for (const ev of events) {\n * console.log(hdStr, ev.getDesc());\n * }\n * }\n * @param year Hebrew year\n */\n static getHolidaysForYear(year: number): HolidayYearMap {\n return getHolidaysForYear_(year);\n }\n\n /**\n * Returns a sorted array of holidays observed during the given Hebrew year.\n *\n * Events are pre-filtered by Israel vs. Diaspora schedule, so callers do not\n * need to inspect `flags.IL_ONLY` / `flags.CHUL_ONLY` themselves.\n * Includes Rosh Chodesh, fasts, modern holidays, special Shabbatot, etc.,\n * but does not generate candle-lighting times, Torah readings, or Omer days.\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * const events = HebrewCalendar.getHolidaysForYearArray(5784, false);\n * console.log(events[0].getDesc()); // 'Rosh Hashana 5784'\n * @param year Hebrew year\n * @param il use the Israeli schedule for holidays\n */\n static getHolidaysForYearArray(year: number, il: boolean): HolidayEvent[] {\n return getHolidaysForYearArray(year, il);\n }\n\n /**\n * Returns an array of holiday Events that occur on the given date,\n * or `undefined` if no holidays occur that day.\n *\n * When `il` is omitted, both Diaspora-only and Israel-only events are\n * returned; pass `true` or `false` to filter to a single schedule.\n * @example\n * import {HebrewCalendar, HDate, months} from '@hebcal/core';\n * const hd = new HDate(15, months.NISAN, 5784);\n * const events = HebrewCalendar.getHolidaysOnDate(hd, false);\n * console.log(events?.map(ev => ev.getDesc())); // ['Pesach I']\n * @param date Hebrew Date, Gregorian date, or absolute R.D. day number\n * @param [il] use the Israeli schedule for holidays\n */\n static getHolidaysOnDate(\n date: HDate | Date | number,\n il?: boolean\n ): HolidayEvent[] | undefined {\n return getHolidaysOnDate(date, il);\n }\n\n /**\n * Returns `true` if Eruv Tavshilin should be prepared on the given date.\n *\n * Eruv Tavshilin is prepared when a Yom Tov falls on Friday (so cooking\n * for Shabbat that begins Friday night may continue from Yom Tov into\n * Shabbat). This requires the day before to be a weekday (Wednesday or\n * Thursday), the following Friday to be Yom Tov, and the day after Friday\n * (Shabbat) to also be a sacred day.\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * // Wednesday October 16, 2024 is Erev Sukkot 5785. In the Diaspora,\n * // Sukkot I falls on Thursday and Sukkot II on Friday, so Eruv\n * // Tavshilin is prepared on Wednesday:\n * HebrewCalendar.eruvTavshilin(new Date(2024, 9, 16), false); // true\n * // In Israel there is only one day of Yom Tov, so Friday is a weekday:\n * HebrewCalendar.eruvTavshilin(new Date(2024, 9, 16), true); // false\n * @param date Gregorian or Hebrew date to test\n * @param il use the Israeli holiday schedule\n */\n static eruvTavshilin(date: Date | HDate, il: boolean): boolean {\n const dow = date.getDay();\n if (dow < 3 || dow > 4) {\n return false;\n }\n const today = new HDate(date);\n const friday = today.after(5);\n const tomorrow = today.next();\n return isChag(friday, il) && !isChag(today, il) && isChag(tomorrow, il);\n }\n\n /**\n * Helper function to format a 24-hour (00:00-23:59) time string in either\n * 12-hour US format (e.g. `\"8:13pm\"`) or keep it in 24-hour format (e.g.\n * `\"20:13\"`) for any other locale or country.\n *\n * The locale (and therefore default behavior) is derived from\n * `options.location` / `options.locale`. The `options.hour12` override\n * takes precedence: if `false`, locale is ignored and the result is always\n * 24-hour; if `true`, locale is ignored and the result is always 12-hour.\n * @example\n * import {HebrewCalendar, Location} from '@hebcal/core';\n * const opts = {location: Location.lookup('Chicago')};\n * HebrewCalendar.reformatTimeStr('20:30', 'pm', opts); // '8:30pm'\n * HebrewCalendar.reformatTimeStr('20:30', 'pm', {hour12: false}); // '20:30'\n * @param timeStr - original time like \"20:30\"\n * @param suffix - \"p\" or \"pm\" or \" P.M.\". Add leading space if you want it\n * @param options optional; `location`, `locale` and `hour12` are consulted\n */\n static reformatTimeStr(\n timeStr: string,\n suffix: string,\n options?: CalOptions\n ): string {\n return reformatTimeStr(timeStr, suffix, options);\n }\n\n /**\n * Returns the semantic version string of the `@hebcal/core` package\n * (e.g. `\"6.8.2\"`). Useful for logging or feature detection.\n */\n static version(): string {\n return pkgVersion;\n }\n\n /**\n * Convenience function to create an instance of {@link Sedra} or reuse a\n * previously created and cached instance for the same year + schedule.\n *\n * Use this in preference to `new Sedra(...)` when calling repeatedly,\n * since an internal LRU cache (~120 entries) avoids recomputing the\n * keviyah-specific reading pattern.\n * @example\n * import {HebrewCalendar, HDate} from '@hebcal/core';\n * const sedra = HebrewCalendar.getSedra(5784, false);\n * const result = sedra.lookup(new HDate(15, 'Cheshvan', 5784));\n * console.log(result.parsha); // ['Vayera']\n * @param hyear Hebrew year\n * @param il Use Israel sedra schedule (`false` for Diaspora)\n */\n static getSedra(hyear: number, il: boolean): Sedra {\n return getSedra(hyear, il);\n }\n\n /**\n * Determines which form of Hallel (if any) is recited on a given Hebrew date:\n * 0 (none), 1 (half Hallel), or 2 (whole Hallel).\n * See {@link hallel} for details.\n * @example\n * import {HebrewCalendar, HDate, months} from '@hebcal/core';\n * HebrewCalendar.hallel(new HDate(25, months.KISLEV, 5784), false); // 2 (Chanukah)\n * HebrewCalendar.hallel(new HDate(1, months.SHVAT, 5784), false); // 1 (Rosh Chodesh)\n * HebrewCalendar.hallel(new HDate(2, months.SHVAT, 5784), false); // 0\n * @param hdate Hebrew date to test\n * @param il use the Israeli holiday schedule\n * @returns 0 for no Hallel, 1 for half Hallel, 2 for whole Hallel\n */\n static hallel(hdate: HDate, il: boolean): number {\n return hallel(hdate, il);\n }\n\n /**\n * Return details on what Tachanun (or Tzidchatcha on Shabbat) is said on `hdate`.\n *\n * Tachanun is not said on Rosh Chodesh, the month of Nisan, Lag Baomer,\n * Rosh Chodesh Sivan until Isru Chag, Tisha B'av, 15 Av, Erev Rosh Hashanah,\n * Rosh Hashanah, Erev Yom Kippur until after Simchat Torah, Chanukah,\n * Tu B'shvat, Purim and Shushan Purim, and Purim and Shushan Purim Katan.\n *\n * In some congregations Tachanun is not said until from Rosh Chodesh Sivan\n * until 14th Sivan, Sukkot until after Rosh Chodesh Cheshvan, Pesach Sheini,\n * Yom Ha'atzmaut, and Yom Yerushalayim.\n *\n * Tachanun is not said at Mincha on days before it is not said at Shacharit.\n *\n * Tachanun is not said at Shacharit on Shabbat, but is at Mincha, usually.\n * @example\n * import {HebrewCalendar, HDate, months} from '@hebcal/core';\n * // Regular weekday — Tachanun is said at both services\n * HebrewCalendar.tachanun(new HDate(4, months.SHVAT, 5784), false);\n * // => { shacharit: true, mincha: true, allCongs: true }\n *\n * // Friday 2 Sh'vat — said at Shacharit, but not at Mincha (erev Shabbat)\n * HebrewCalendar.tachanun(new HDate(2, months.SHVAT, 5784), false);\n * // => { shacharit: true, mincha: false, allCongs: true }\n *\n * // Rosh Chodesh — no Tachanun\n * HebrewCalendar.tachanun(new HDate(1, months.SHVAT, 5784), false);\n * // => { shacharit: false, mincha: false, allCongs: false }\n * @param hdate Hebrew date to test\n * @param il use the Israeli holiday schedule\n */\n static tachanun(hdate: HDate, il: boolean): TachanunResult {\n return tachanun(hdate, il);\n }\n}\n\nfunction isChag(date: HDate, il: boolean): boolean {\n const events = getHolidaysOnDate(date, il) ?? [];\n return events.some(ev => ev.hasFlag('CHAG'));\n}\n"],"names":["pkgVersion"],"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;AAmBG;AAoBH;;;;;AAKG;MACU,cAAc,CAAA;AACzB,IAAA,WAAA,GAAA,EAAuB;AACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BG;AACH,IAAA,OAAO,QAAQ,CAAC,OAAA,GAAsB,EAAE,EAAA;AACtC,QAAA,OAAO,QAAQ,CAAC,OAAO,CAAC;IAC1B;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BG;AACH,IAAA,OAAO,wBAAwB,CAC7B,KAAa,EACb,KAAmB,EAAA;AAEnB,QAAA,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OAAO,eAAe,CACpB,OAAe,EACf,MAAc,EACd,OAAoB,EAAA;QAEpB,OAAO,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC;IAClD;AAEA;;;AAGG;AACH,IAAA,OAAO,OAAO,GAAA;AACZ,QAAA,OAAOA,OAAU;IACnB;AAEA;;;;;;;;;;;;;;AAcG;AACH,IAAA,OAAO,QAAQ,CAAC,KAAa,EAAE,EAAW,EAAA;AACxC,QAAA,OAAO,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC;IAC5B;AAEA;;;;;;;;;;;;AAYG;AACH,IAAA,OAAO,MAAM,CAAC,KAAY,EAAE,EAAW,EAAA;AACrC,QAAA,OAAO,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC;IAC1B;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;AACH,IAAA,OAAO,QAAQ,CAAC,KAAY,EAAE,EAAW,EAAA;AACvC,QAAA,OAAO,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC;IAC5B;AACD;AAED,SAAS,MAAM,CAAC,IAAW,EAAE,EAAW,EAAA;IACtC,MAAM,MAAM,GAAG,iBAAiB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE;AAChD,IAAA,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAC9C;;"}
|
|
1
|
+
{"version":3,"file":"hebcal.js","sources":["../../../src/hebcal.ts"],"sourcesContent":["/*\n Hebcal - A Jewish Calendar Generator\n Copyright (c) 1994-2020 Danny Sadinoff\n Portions copyright Eyal Schachter and Michael J. Radwin\n\n https://github.com/hebcal/hebcal-es6\n\n This program is free software; you can redistribute it and/or\n modify it under the terms of the GNU General Public License\n as published by the Free Software Foundation; either version 2\n of the License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport {birthdayOrAnniversary, yahrzeit, HDate} from '@hebcal/hdate';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\nimport {CalOptions} from './CalOptions.js';\nimport {version as pkgVersion} from './pkgVersion.js';\nimport {Event} from './event.js';\nimport {Sedra, getSedra} from './sedra.js';\nimport {hallel} from './hallel.js';\nimport {isYomTov} from './isYomTov.js';\nimport {\n getHolidaysForYear_,\n getHolidaysForYearArray,\n getHolidaysOnDate,\n HolidayYearMap,\n} from './holidays.js';\nimport {HolidayEvent} from './HolidayEvent.js';\nimport {reformatTimeStr} from './reformatTimeStr.js';\nimport {TachanunResult, tachanun} from './tachanun.js';\nimport {calendar} from './calendar.js';\n\n/**\n * HebrewCalendar is the main interface to the `@hebcal/core` library.\n * This namespace is used to calculate holidays, rosh chodesh, candle lighting & havdalah times,\n * Parashat HaShavua, Daf Yomi, days of the omer, and the molad.\n * Event names can be rendered in several languges using the `locale` option.\n */\nexport class HebrewCalendar {\n private constructor() {}\n /**\n * Calculates holidays and other Hebrew calendar events based on {@link CalOptions}.\n *\n * Each holiday is represented by an {@link Event} object which includes a date,\n * a description, flags and optional attributes.\n * If given no options, returns holidays for the Diaspora for the current Gregorian year.\n *\n * This is a convenience wrapper around the standalone {@link calendar} function.\n * See {@link calendar} for the complete list of supported options, the\n * candle-lighting and Havdalah defaults, and notes on locales.\n *\n * @example\n * import {HebrewCalendar, Location} from '@hebcal/core';\n * const options: CalOptions = {\n * year: 1981,\n * isHebrewYear: false,\n * candlelighting: true,\n * location: Location.lookup('San Francisco'),\n * sedrot: true,\n * omer: true,\n * };\n * const events = HebrewCalendar.calendar(options);\n * for (const ev of events) {\n * const hd = ev.getDate();\n * const date = hd.greg();\n * console.log(date.toLocaleDateString(), ev.render('en'), hd.toString());\n * }\n */\n static calendar(options: CalOptions = {}): Event[] {\n return calendar(options);\n }\n\n /**\n * Calculates a birthday or anniversary (non-yahrzeit).\n * Returns `undefined` when `hyear` precedes the original year of `gdate`.\n *\n * When `hyear` is the original year, the original date is returned unchanged —\n * a \"0th birthday\" is a meaningful thing to ask for. This differs from\n * {@link getYahrzeit}, which returns `undefined` for the original year,\n * because a yahrzeit only has meaning from the first anniversary onward.\n *\n * Hebcal uses the algorithm defined in \"Calendrical Calculations\"\n * by Edward M. Reingold and Nachum Dershowitz.\n *\n * The birthday of someone born in Adar of an ordinary year or Adar II of\n * a leap year is also always in the last month of the year, be that Adar\n * or Adar II. The birthday in an ordinary year of someone born during the\n * first 29 days of Adar I in a leap year is on the corresponding day of Adar;\n * in a leap year, the birthday occurs in Adar I, as expected.\n *\n * Someone born on the thirtieth day of Marcheshvan, Kislev, or Adar I\n * has his birthday postponed until the first of the following month in\n * years where that day does not occur. [Calendrical Calculations p. 111]\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'\n * const hd = HebrewCalendar.getBirthdayOrAnniversary(5780, dt); // '1 Nisan 5780'\n * console.log(hd.greg().toLocaleDateString('en-US')); // '3/26/2020'\n * @param hyear Hebrew year\n * @param gdate Gregorian or Hebrew date of event\n * @returns anniversary occurring in `hyear`\n */\n static getBirthdayOrAnniversary(\n hyear: number,\n gdate: Date | HDate\n ): HDate | undefined {\n return birthdayOrAnniversary(hyear, gdate);\n }\n\n /**\n * Calculates yahrzeit.\n * `hyear` must be after original `gdate` of death.\n * Returns `undefined` when requested year preceeds or is same as original year.\n *\n * Hebcal uses the algorithm defined in \"Calendrical Calculations\"\n * by Edward M. Reingold and Nachum Dershowitz.\n *\n * The customary anniversary date of a death is more complicated and depends\n * also on the character of the year in which the first anniversary occurs.\n * There are several cases:\n *\n * * If the date of death is Marcheshvan 30, the anniversary in general depends\n * on the first anniversary; if that first anniversary was not Marcheshvan 30,\n * use the day before Kislev 1.\n * * If the date of death is Kislev 30, the anniversary in general again depends\n * on the first anniversary — if that was not Kislev 30, use the day before\n * Tevet 1.\n * * If the date of death is Adar II, the anniversary is the same day in the\n * last month of the Hebrew year (Adar or Adar II).\n * * If the date of death is Adar I 30, the anniversary in a Hebrew year that\n * is not a leap year (in which Adar only has 29 days) is the last day in\n * Shevat.\n * * In all other cases, use the normal (that is, same month number) anniversary\n * of the date of death. [Calendrical Calculations p. 113]\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'\n * const hd = HebrewCalendar.getYahrzeit(5780, dt); // '30 Sh\\'vat 5780'\n * console.log(hd.greg().toLocaleDateString('en-US')); // '2/25/2020'\n * @param hyear Hebrew year\n * @param gdate Gregorian or Hebrew date of death\n * @returns anniversary occurring in hyear\n */\n static getYahrzeit(hyear: number, gdate: Date | HDate): HDate | undefined {\n return yahrzeit(hyear, gdate);\n }\n\n /**\n * Lower-level holidays interface, which returns a `Map` of `Event`s indexed by\n * `HDate.toString()`. These events are not filtered by Israel vs. Diaspora\n * holiday scheme; use {@link Event.observedIn} to do that.\n *\n * Includes Rosh Chodesh, fasts, Yom Kippur Katan, Special Shabbatot, etc.,\n * but does not generate candle-lighting times, Torah readings, or Omer days.\n * The result is cached in an internal LRU.\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * const map = HebrewCalendar.getHolidaysForYear(5784);\n * for (const [hdStr, events] of map.entries()) {\n * for (const ev of events) {\n * console.log(hdStr, ev.getDesc());\n * }\n * }\n * @param year Hebrew year\n */\n static getHolidaysForYear(year: number): HolidayYearMap {\n return getHolidaysForYear_(year);\n }\n\n /**\n * Returns a sorted array of holidays observed during the given Hebrew year.\n *\n * Events are pre-filtered by Israel vs. Diaspora schedule, so callers do not\n * need to inspect `flags.IL_ONLY` / `flags.CHUL_ONLY` themselves.\n * Includes Rosh Chodesh, fasts, modern holidays, special Shabbatot, etc.,\n * but does not generate candle-lighting times, Torah readings, or Omer days.\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * const events = HebrewCalendar.getHolidaysForYearArray(5784, false);\n * console.log(events[0].getDesc()); // 'Rosh Hashana 5784'\n * @param year Hebrew year\n * @param il use the Israeli schedule for holidays\n */\n static getHolidaysForYearArray(year: number, il: boolean): HolidayEvent[] {\n return getHolidaysForYearArray(year, il);\n }\n\n /**\n * Returns an array of holiday Events that occur on the given date,\n * or `undefined` if no holidays occur that day.\n *\n * When `il` is omitted, both Diaspora-only and Israel-only events are\n * returned; pass `true` or `false` to filter to a single schedule.\n * @example\n * import {HebrewCalendar, HDate, months} from '@hebcal/core';\n * const hd = new HDate(15, months.NISAN, 5784);\n * const events = HebrewCalendar.getHolidaysOnDate(hd, false);\n * console.log(events?.map(ev => ev.getDesc())); // ['Pesach I']\n * @param date Hebrew Date, Gregorian date, or absolute R.D. day number\n * @param [il] use the Israeli schedule for holidays\n */\n static getHolidaysOnDate(\n date: HDate | Date | number,\n il?: boolean\n ): HolidayEvent[] | undefined {\n return getHolidaysOnDate(date, il);\n }\n\n /**\n * Returns `true` if Eruv Tavshilin should be prepared on the given date.\n *\n * Eruv Tavshilin is prepared when a Yom Tov falls on Friday (so cooking\n * for Shabbat that begins Friday night may continue from Yom Tov into\n * Shabbat). This requires the day before to be a weekday (Wednesday or\n * Thursday), the following Friday to be Yom Tov, and the day after Friday\n * (Shabbat) to also be a sacred day.\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * // Wednesday October 16, 2024 is Erev Sukkot 5785. In the Diaspora,\n * // Sukkot I falls on Thursday and Sukkot II on Friday, so Eruv\n * // Tavshilin is prepared on Wednesday:\n * HebrewCalendar.eruvTavshilin(new Date(2024, 9, 16), false); // true\n * // In Israel there is only one day of Yom Tov, so Friday is a weekday:\n * HebrewCalendar.eruvTavshilin(new Date(2024, 9, 16), true); // false\n * @param date Gregorian or Hebrew date to test\n * @param il use the Israeli holiday schedule\n */\n static eruvTavshilin(date: Date | HDate, il: boolean): boolean {\n const dow = date.getDay();\n if (dow < 3 || dow > 4) {\n return false;\n }\n const today = new HDate(date);\n const friday = today.after(5);\n const tomorrow = today.next();\n return isYomTov(friday, il) && !isYomTov(today, il) && isYomTov(tomorrow, il);\n }\n\n /**\n * Helper function to format a 24-hour (00:00-23:59) time string in either\n * 12-hour US format (e.g. `\"8:13pm\"`) or keep it in 24-hour format (e.g.\n * `\"20:13\"`) for any other locale or country.\n *\n * The locale (and therefore default behavior) is derived from\n * `options.location` / `options.locale`. The `options.hour12` override\n * takes precedence: if `false`, locale is ignored and the result is always\n * 24-hour; if `true`, locale is ignored and the result is always 12-hour.\n * @example\n * import {HebrewCalendar, Location} from '@hebcal/core';\n * const opts = {location: Location.lookup('Chicago')};\n * HebrewCalendar.reformatTimeStr('20:30', 'pm', opts); // '8:30pm'\n * HebrewCalendar.reformatTimeStr('20:30', 'pm', {hour12: false}); // '20:30'\n * @param timeStr - original time like \"20:30\"\n * @param suffix - \"p\" or \"pm\" or \" P.M.\". Add leading space if you want it\n * @param options optional; `location`, `locale` and `hour12` are consulted\n */\n static reformatTimeStr(\n timeStr: string,\n suffix: string,\n options?: CalOptions\n ): string {\n return reformatTimeStr(timeStr, suffix, options);\n }\n\n /**\n * Returns the semantic version string of the `@hebcal/core` package\n * (e.g. `\"6.8.2\"`). Useful for logging or feature detection.\n */\n static version(): string {\n return pkgVersion;\n }\n\n /**\n * Convenience function to create an instance of {@link Sedra} or reuse a\n * previously created and cached instance for the same year + schedule.\n *\n * Use this in preference to `new Sedra(...)` when calling repeatedly,\n * since an internal LRU cache (~120 entries) avoids recomputing the\n * keviyah-specific reading pattern.\n * @example\n * import {HebrewCalendar, HDate} from '@hebcal/core';\n * const sedra = HebrewCalendar.getSedra(5784, false);\n * const result = sedra.lookup(new HDate(15, 'Cheshvan', 5784));\n * console.log(result.parsha); // ['Vayera']\n * @param hyear Hebrew year\n * @param il Use Israel sedra schedule (`false` for Diaspora)\n */\n static getSedra(hyear: number, il: boolean): Sedra {\n return getSedra(hyear, il);\n }\n\n /**\n * Determines which form of Hallel (if any) is recited on a given Hebrew date:\n * 0 (none), 1 (half Hallel), or 2 (whole Hallel).\n * See {@link hallel} for details.\n * @example\n * import {HebrewCalendar, HDate, months} from '@hebcal/core';\n * HebrewCalendar.hallel(new HDate(25, months.KISLEV, 5784), false); // 2 (Chanukah)\n * HebrewCalendar.hallel(new HDate(1, months.SHVAT, 5784), false); // 1 (Rosh Chodesh)\n * HebrewCalendar.hallel(new HDate(2, months.SHVAT, 5784), false); // 0\n * @param hdate Hebrew date to test\n * @param il use the Israeli holiday schedule\n * @returns 0 for no Hallel, 1 for half Hallel, 2 for whole Hallel\n */\n static hallel(hdate: HDate, il: boolean): number {\n return hallel(hdate, il);\n }\n\n /**\n * Return details on what Tachanun (or Tzidchatcha on Shabbat) is said on `hdate`.\n *\n * Tachanun is not said on Rosh Chodesh, the month of Nisan, Lag Baomer,\n * Rosh Chodesh Sivan until Isru Chag, Tisha B'av, 15 Av, Erev Rosh Hashanah,\n * Rosh Hashanah, Erev Yom Kippur until after Simchat Torah, Chanukah,\n * Tu B'shvat, Purim and Shushan Purim, and Purim and Shushan Purim Katan.\n *\n * In some congregations Tachanun is not said until from Rosh Chodesh Sivan\n * until 14th Sivan, Sukkot until after Rosh Chodesh Cheshvan, Pesach Sheini,\n * Yom Ha'atzmaut, and Yom Yerushalayim.\n *\n * Tachanun is not said at Mincha on days before it is not said at Shacharit.\n *\n * Tachanun is not said at Shacharit on Shabbat, but is at Mincha, usually.\n * @example\n * import {HebrewCalendar, HDate, months} from '@hebcal/core';\n * // Regular weekday — Tachanun is said at both services\n * HebrewCalendar.tachanun(new HDate(4, months.SHVAT, 5784), false);\n * // => { shacharit: true, mincha: true, allCongs: true }\n *\n * // Friday 2 Sh'vat — said at Shacharit, but not at Mincha (erev Shabbat)\n * HebrewCalendar.tachanun(new HDate(2, months.SHVAT, 5784), false);\n * // => { shacharit: true, mincha: false, allCongs: true }\n *\n * // Rosh Chodesh — no Tachanun\n * HebrewCalendar.tachanun(new HDate(1, months.SHVAT, 5784), false);\n * // => { shacharit: false, mincha: false, allCongs: false }\n * @param hdate Hebrew date to test\n * @param il use the Israeli holiday schedule\n */\n static tachanun(hdate: HDate, il: boolean): TachanunResult {\n return tachanun(hdate, il);\n }\n}\n"],"names":["pkgVersion"],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;AAmBG;AAqBH;;;;;AAKG;MACU,cAAc,CAAA;AACzB,IAAA,WAAA,GAAA,EAAuB;AACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BG;AACH,IAAA,OAAO,QAAQ,CAAC,OAAA,GAAsB,EAAE,EAAA;AACtC,QAAA,OAAO,QAAQ,CAAC,OAAO,CAAC;IAC1B;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BG;AACH,IAAA,OAAO,wBAAwB,CAC7B,KAAa,EACb,KAAmB,EAAA;AAEnB,QAAA,OAAO,qBAAqB,CAAC,KAAK,EAAE,KAAK,CAAC;IAC5C;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCG;AACH,IAAA,OAAO,WAAW,CAAC,KAAa,EAAE,KAAmB,EAAA;AACnD,QAAA,OAAO,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IAC/B;AAEA;;;;;;;;;;;;;;;;;AAiBG;IACH,OAAO,kBAAkB,CAAC,IAAY,EAAA;AACpC,QAAA,OAAO,mBAAmB,CAAC,IAAI,CAAC;IAClC;AAEA;;;;;;;;;;;;;AAaG;AACH,IAAA,OAAO,uBAAuB,CAAC,IAAY,EAAE,EAAW,EAAA;AACtD,QAAA,OAAO,uBAAuB,CAAC,IAAI,EAAE,EAAE,CAAC;IAC1C;AAEA;;;;;;;;;;;;;AAaG;AACH,IAAA,OAAO,iBAAiB,CACtB,IAA2B,EAC3B,EAAY,EAAA;AAEZ,QAAA,OAAO,iBAAiB,CAAC,IAAI,EAAE,EAAE,CAAC;IACpC;AAEA;;;;;;;;;;;;;;;;;;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package/dist/esm/holidays.d.ts
CHANGED
|
@@ -25,6 +25,13 @@ export declare function getHolidaysOnDate(date: HDate | Date | number, il?: bool
|
|
|
25
25
|
* by Israel vs. Diaspora — inspect `flags.IL_ONLY` / `flags.CHUL_ONLY`.
|
|
26
26
|
*/
|
|
27
27
|
export type HolidayYearMap = Map<string, HolidayEvent[]>;
|
|
28
|
+
/**
|
|
29
|
+
* Holidays for an entire Hebrew year, indexed by R.D. (Rata Die) day number,
|
|
30
|
+
* i.e. `HDate.abs()`. Like {@link HolidayYearMap}, entries are not filtered by
|
|
31
|
+
* Israel vs. Diaspora. Cached and shared, so must not be modified.
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
export type HolidayYearRdMap = ReadonlyMap<number, readonly HolidayEvent[]>;
|
|
28
35
|
/** @internal */
|
|
29
36
|
export declare const TIME_OF_DAY_DAWN = 0;
|
|
30
37
|
/** @internal */
|
|
@@ -61,10 +68,20 @@ export declare const TIME_OF_DAY_NIGHT = 7;
|
|
|
61
68
|
* @internal
|
|
62
69
|
*/
|
|
63
70
|
export declare function timeOfDay(ev: Event): number;
|
|
71
|
+
/**
|
|
72
|
+
* Holidays for an entire Hebrew year, indexed by R.D. day number
|
|
73
|
+
* (`HDate.abs()`), so that per-day lookups don't have to build a date string.
|
|
74
|
+
* The result is cached in an internal LRU and shared between callers.
|
|
75
|
+
* @internal
|
|
76
|
+
*/
|
|
77
|
+
export declare function getHolidaysForYearByRd(year: number): HolidayYearRdMap;
|
|
64
78
|
/**
|
|
65
79
|
* Lower-level holidays interface, which returns a `Map` of `Event`s indexed by
|
|
66
80
|
* `HDate.toString()`. These events must filtered especially for `flags.IL_ONLY`
|
|
67
81
|
* or `flags.CHUL_ONLY` depending on Israel vs. Diaspora holiday scheme.
|
|
82
|
+
*
|
|
83
|
+
* A string-keyed copy of {@link getHolidaysForYearByRd}, built once per
|
|
84
|
+
* cached year; the event arrays are shared with it.
|
|
68
85
|
* @internal
|
|
69
86
|
*/
|
|
70
87
|
export declare function getHolidaysForYear_(year: number): HolidayYearMap;
|
package/dist/esm/holidays.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v6.16.
|
|
1
|
+
/*! @hebcal/core v6.16.3, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
import { months, HDate } from '@hebcal/hdate';
|
|
3
3
|
import QuickLRU from 'quick-lru';
|
|
4
4
|
import { flags } from './event.js';
|
|
@@ -45,10 +45,24 @@ import { HolidayEvent, RoshHashanaEvent, ChanukahEvent, AsaraBTevetEvent, RoshCh
|
|
|
45
45
|
* @param [il] use the Israeli schedule for holidays
|
|
46
46
|
*/
|
|
47
47
|
function getHolidaysOnDate(date, il) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
|
|
48
|
+
let abs;
|
|
49
|
+
let entry;
|
|
50
|
+
const last = lastEntry;
|
|
51
|
+
if (typeof date === 'number' &&
|
|
52
|
+
last !== undefined &&
|
|
53
|
+
date >= last.startAbs &&
|
|
54
|
+
date <= last.endAbs) {
|
|
55
|
+
// Callers often walk day by day; skip the R.D. → Hebrew date
|
|
56
|
+
// conversion while the date stays within the most recently used year.
|
|
57
|
+
abs = date;
|
|
58
|
+
entry = last;
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
const hd = HDate.isHDate(date) ? date : new HDate(date);
|
|
62
|
+
abs = hd.abs();
|
|
63
|
+
entry = getYearEntry(hd.getFullYear());
|
|
64
|
+
}
|
|
65
|
+
const events = entry.map.get(abs);
|
|
52
66
|
// if il isn't a boolean return both diaspora + IL for day
|
|
53
67
|
if (il === undefined || events === undefined) {
|
|
54
68
|
return events;
|
|
@@ -63,9 +77,12 @@ const FRI = 5;
|
|
|
63
77
|
const SAT = 6;
|
|
64
78
|
const { NISAN, IYYAR, TAMUZ, AV, TISHREI, CHESHVAN, KISLEV, TEVET, ADAR_I, ADAR_II } = months;
|
|
65
79
|
const yearCache = new QuickLRU({ maxSize: 120 });
|
|
80
|
+
/** Most recently used year, so day-by-day callers skip the LRU lookup */
|
|
81
|
+
let lastEntry;
|
|
82
|
+
const stringMapCache = new WeakMap();
|
|
66
83
|
function addToMap(map, ...events) {
|
|
67
84
|
for (const ev of events) {
|
|
68
|
-
const key = ev.date.
|
|
85
|
+
const key = ev.date.abs();
|
|
69
86
|
const arr = map.get(key);
|
|
70
87
|
if (arr !== undefined) {
|
|
71
88
|
arr.push(ev);
|
|
@@ -269,23 +286,52 @@ function addBehab(map, year) {
|
|
|
269
286
|
}
|
|
270
287
|
}
|
|
271
288
|
}
|
|
289
|
+
/**
|
|
290
|
+
* Holidays for an entire Hebrew year, indexed by R.D. day number
|
|
291
|
+
* (`HDate.abs()`), so that per-day lookups don't have to build a date string.
|
|
292
|
+
* The result is cached in an internal LRU and shared between callers.
|
|
293
|
+
* @internal
|
|
294
|
+
*/
|
|
295
|
+
function getHolidaysForYearByRd(year) {
|
|
296
|
+
return getYearEntry(year).map;
|
|
297
|
+
}
|
|
272
298
|
/**
|
|
273
299
|
* Lower-level holidays interface, which returns a `Map` of `Event`s indexed by
|
|
274
300
|
* `HDate.toString()`. These events must filtered especially for `flags.IL_ONLY`
|
|
275
301
|
* or `flags.CHUL_ONLY` depending on Israel vs. Diaspora holiday scheme.
|
|
302
|
+
*
|
|
303
|
+
* A string-keyed copy of {@link getHolidaysForYearByRd}, built once per
|
|
304
|
+
* cached year; the event arrays are shared with it.
|
|
276
305
|
* @internal
|
|
277
306
|
*/
|
|
278
307
|
function getHolidaysForYear_(year) {
|
|
308
|
+
const entry = getYearEntry(year);
|
|
309
|
+
let strMap = stringMapCache.get(entry);
|
|
310
|
+
if (strMap === undefined) {
|
|
311
|
+
strMap = new Map();
|
|
312
|
+
for (const [abs, events] of entry.map) {
|
|
313
|
+
strMap.set(new HDate(abs).toString(), events);
|
|
314
|
+
}
|
|
315
|
+
stringMapCache.set(entry, strMap);
|
|
316
|
+
}
|
|
317
|
+
return strMap;
|
|
318
|
+
}
|
|
319
|
+
function getYearEntry(year) {
|
|
320
|
+
const last = lastEntry;
|
|
321
|
+
if (last?.year === year) {
|
|
322
|
+
return last;
|
|
323
|
+
}
|
|
324
|
+
const entry = yearCache.get(year) ?? makeYearEntry(year);
|
|
325
|
+
lastEntry = entry;
|
|
326
|
+
return entry;
|
|
327
|
+
}
|
|
328
|
+
function makeYearEntry(year) {
|
|
279
329
|
if (typeof year !== 'number') {
|
|
280
330
|
throw new TypeError(`bad Hebrew year: ${year}`);
|
|
281
331
|
}
|
|
282
332
|
if (year < 1 || year > 32658) {
|
|
283
333
|
throw new RangeError(`Hebrew year ${year} out of range 1-32658`);
|
|
284
334
|
}
|
|
285
|
-
const cached = yearCache.get(year);
|
|
286
|
-
if (cached) {
|
|
287
|
-
return cached;
|
|
288
|
-
}
|
|
289
335
|
const RH = new HDate(1, TISHREI, year);
|
|
290
336
|
const pesach = new HDate(15, NISAN, year);
|
|
291
337
|
const map = new Map();
|
|
@@ -315,8 +361,14 @@ function getHolidaysForYear_(year) {
|
|
|
315
361
|
for (const arr of map.values()) {
|
|
316
362
|
arr.sort((a, b) => timeOfDay(a) - timeOfDay(b));
|
|
317
363
|
}
|
|
318
|
-
|
|
319
|
-
|
|
364
|
+
const entry = {
|
|
365
|
+
year,
|
|
366
|
+
map,
|
|
367
|
+
startAbs: RH.abs(),
|
|
368
|
+
endAbs: HDate.hebrew2abs(year + 1, TISHREI, 1) - 1,
|
|
369
|
+
};
|
|
370
|
+
yearCache.set(year, entry);
|
|
371
|
+
return entry;
|
|
320
372
|
}
|
|
321
373
|
/** 28 years of 365.25 days */
|
|
322
374
|
const BIRKAT_HACHAMAH_CYCLE_DAYS = 10227;
|
|
@@ -360,19 +412,24 @@ function getBirkatHaChama(year) {
|
|
|
360
412
|
* @param il use the Israeli schedule for holidays
|
|
361
413
|
*/
|
|
362
414
|
function getHolidaysForYearArray(year, il) {
|
|
363
|
-
const
|
|
364
|
-
const
|
|
365
|
-
const
|
|
415
|
+
const { map, startAbs, endAbs } = getYearEntry(year);
|
|
416
|
+
const days = [];
|
|
417
|
+
for (const abs of map.keys()) {
|
|
418
|
+
if (abs >= startAbs && abs <= endAbs) {
|
|
419
|
+
days.push(abs);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
days.sort((a, b) => a - b);
|
|
366
423
|
const events = [];
|
|
367
|
-
for (
|
|
368
|
-
const
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
424
|
+
for (const abs of days) {
|
|
425
|
+
for (const ev of map.get(abs)) {
|
|
426
|
+
if (ev.observedIn(il)) {
|
|
427
|
+
events.push(ev);
|
|
428
|
+
}
|
|
372
429
|
}
|
|
373
430
|
}
|
|
374
431
|
return events;
|
|
375
432
|
}
|
|
376
433
|
|
|
377
|
-
export { TIME_OF_DAY_DAWN, TIME_OF_DAY_DAY, TIME_OF_DAY_EVENING, TIME_OF_DAY_LEARNING, TIME_OF_DAY_MEVARCHIM, TIME_OF_DAY_MIDDAY, TIME_OF_DAY_MORNING, TIME_OF_DAY_NIGHT, getHolidaysForYearArray, getHolidaysForYear_, getHolidaysOnDate, timeOfDay };
|
|
434
|
+
export { TIME_OF_DAY_DAWN, TIME_OF_DAY_DAY, TIME_OF_DAY_EVENING, TIME_OF_DAY_LEARNING, TIME_OF_DAY_MEVARCHIM, TIME_OF_DAY_MIDDAY, TIME_OF_DAY_MORNING, TIME_OF_DAY_NIGHT, getHolidaysForYearArray, getHolidaysForYearByRd, getHolidaysForYear_, getHolidaysOnDate, timeOfDay };
|
|
378
435
|
//# sourceMappingURL=holidays.js.map
|
package/dist/esm/holidays.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"holidays.js","sources":["../../../src/holidays.ts"],"sourcesContent":["/*\n Hebcal - A Jewish Calendar Generator\n Copyright (c) 1994-2020 Danny Sadinoff\n Portions copyright Eyal Schachter and Michael J. Radwin\n\n https://github.com/hebcal/hebcal-es6\n\n This program is free software; you can redistribute it and/or\n modify it under the terms of the GNU General Public License\n as published by the Free Software Foundation; either version 2\n of the License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {HDate, months} from '@hebcal/hdate';\nimport QuickLRU from 'quick-lru';\nimport {Event, flags} from './event.js';\nimport {modernHolidaysForYear} from './modern.js';\nimport {getSedra} from './sedra.js';\nimport {staticHolidays, holidayDesc as hdesc} from './staticHolidays.js';\nimport {TimedEvent} from './TimedEvent.js';\nimport {YomKippurKatanEvent} from './YomKippurKatanEvent.js';\nimport {\n HolidayEvent,\n ChanukahEvent,\n AsaraBTevetEvent,\n RoshHashanaEvent,\n RoshChodeshEvent,\n} from './HolidayEvent.js';\n\n/**\n * Returns an array of holiday Events that occur on the given date, or\n * `undefined` if no holidays occur that day.\n *\n * When `il` is omitted, both Diaspora-only and Israel-only events are\n * returned (e.g. on the second day of a Yom Tov, both `\"Pesach II\"` for\n * Diaspora and any Israel-only events). Pass `true` or `false` to filter\n * to a single schedule.\n * @example\n * import {getHolidaysOnDate, HDate, months} from '@hebcal/core';\n * const events = getHolidaysOnDate(new HDate(15, months.NISAN, 5784), false);\n * events?.map(ev => ev.getDesc()); // ['Pesach I']\n * @param date Hebrew Date, Gregorian date, or absolute R.D. day number\n * @param [il] use the Israeli schedule for holidays\n */\nexport function getHolidaysOnDate(\n date: HDate | Date | number,\n il?: boolean\n): HolidayEvent[] | undefined {\n const hd = HDate.isHDate(date) ? date : new HDate(date);\n const hdStr = hd.toString();\n const yearMap = getHolidaysForYear_(hd.getFullYear());\n const events = yearMap.get(hdStr);\n // if il isn't a boolean return both diaspora + IL for day\n if (il === undefined || events === undefined) {\n return events;\n }\n return events.filter(ev => ev.observedIn(il));\n}\n\nconst {\n CHAG,\n LIGHT_CANDLES_TZEIS,\n CHANUKAH_CANDLES,\n BEHAB,\n MINOR_FAST,\n SPECIAL_SHABBAT,\n MAJOR_FAST,\n MINOR_HOLIDAY,\n EREV,\n} = flags;\n\nconst SUN = 0;\nconst TUE = 2;\nconst THU = 4;\nconst FRI = 5;\nconst SAT = 6;\n\nconst {NISAN, IYYAR, TAMUZ, AV, TISHREI, CHESHVAN, KISLEV, TEVET, ADAR_I, ADAR_II} =\n months;\n\n/**\n * Holidays for an entire Hebrew year, indexed by `HDate.toString()`\n * (e.g. `'15 Nisan 5784'`). Returned by\n * {@link HebrewCalendar.getHolidaysForYear}. Because a single date can carry\n * more than one event, each key maps to an array. Entries are *not* filtered\n * by Israel vs. Diaspora — inspect `flags.IL_ONLY` / `flags.CHUL_ONLY`.\n */\nexport type HolidayYearMap = Map<string, HolidayEvent[]>;\nconst yearCache = new QuickLRU<number, HolidayYearMap>({maxSize: 120});\n\nfunction addToMap(map: HolidayYearMap, ...events: HolidayEvent[]): void {\n for (const ev of events) {\n const key = ev.date.toString();\n const arr = map.get(key);\n if (arr !== undefined) {\n arr.push(ev);\n } else {\n map.set(key, [ev]);\n }\n }\n}\n\n/** @internal */\nexport const TIME_OF_DAY_DAWN = 0;\n/** @internal */\nexport const TIME_OF_DAY_MORNING = 1;\n/** @internal */\nexport const TIME_OF_DAY_MEVARCHIM = 2;\n/** @internal */\nexport const TIME_OF_DAY_DAY = 3;\n/** @internal */\nexport const TIME_OF_DAY_MIDDAY = 4;\n/** @internal */\nexport const TIME_OF_DAY_LEARNING = 5;\n/** @internal */\nexport const TIME_OF_DAY_EVENING = 6;\n/** @internal */\nexport const TIME_OF_DAY_NIGHT = 7;\n\n/**\n * Approximate time of day of an event, used to order events on the same date.\n * Events of equal rank keep the order in which they were created, and timed\n * events of equal rank are ordered by their time.\n * - Dawn: Fast begins for a minor fast, and a Latest Kiddush Levana before\n * noon (which is never later than _alot hashachar_)\n * - Morning: the parsha, special Shabbatot (tied to the Torah or Haftarah\n * reading), minor fasts (which begin at dawn) and Birkat Hachamah\n * (recited at sunrise)\n * - Molad and Shabbat Mevarchim, announced in synagogue after the Torah\n * reading\n * - Day: everything else, including Yizkor and the Omer count\n * - Midday: the deadlines for eating and burning chametz\n * - Daily learning\n * - Evening: Erev holidays, Chanukah candle-lighting and Leil Selichot\n * - Night: other timed events such as candle-lighting, Havdalah,\n * Fast ends, and a Latest Kiddush Levana after noon\n * @internal\n */\nexport function timeOfDay(ev: Event): number {\n if (ev instanceof TimedEvent) {\n return timedEventTimeOfDay(ev);\n }\n const desc = ev.getDesc();\n if (ev.hasAnyFlag('EREV', 'CHANUKAH_CANDLES') || desc === hdesc.LEIL_SELICHOT) {\n return TIME_OF_DAY_EVENING;\n }\n if (\n ev.hasAnyFlag('PARSHA_HASHAVUA', 'SPECIAL_SHABBAT', 'MINOR_FAST') ||\n desc === hdesc.BIRKAT_HACHAMAH\n ) {\n return TIME_OF_DAY_MORNING;\n }\n if (ev.hasAnyFlag('SHABBAT_MEVARCHIM', 'MOLAD')) {\n return TIME_OF_DAY_MEVARCHIM;\n }\n if (\n ev.hasAnyFlag(\n 'DAILY_LEARNING',\n 'DAF_YOMI',\n 'MISHNA_YOMI',\n 'NACH_YOMI',\n 'YERUSHALMI_YOMI'\n )\n ) {\n return TIME_OF_DAY_LEARNING;\n }\n return TIME_OF_DAY_DAY;\n}\n\nfunction timedEventTimeOfDay(ev: TimedEvent): number {\n const desc = ev.getDesc();\n if (desc === hdesc.SOF_ZMAN_ACHILAT_CHAMETZ || desc === hdesc.BIUR_CHAMETZ) {\n return TIME_OF_DAY_MIDDAY;\n }\n // A minor fast begins at dawn, but Tish'a B'Av at sunset the day before.\n // Latest Kiddush Levana is either before dawn or after nightfall.\n if (desc === hdesc.FAST_BEGINS || ev.hasFlag('KIDDUSH_LEVANA')) {\n // `eventTimeStr` is 24-hour local time; some engines format midnight as 24:00\n const hour = Number.parseInt(ev.eventTimeStr, 10) % 24;\n return hour < 12 ? TIME_OF_DAY_DAWN : TIME_OF_DAY_NIGHT;\n }\n return TIME_OF_DAY_NIGHT;\n}\n\nfunction addStaticHolidays(map: HolidayYearMap, year: number): void {\n for (const h of staticHolidays) {\n const hd = new HDate(h.dd, h.mm, year);\n const attrs: {emoji?: string; cholHaMoedDay?: number} = {};\n if (h.emoji) attrs.emoji = h.emoji;\n if (h.chmDay) attrs.cholHaMoedDay = h.chmDay;\n addToMap(map, new HolidayEvent(hd, h.desc, h.flags, attrs));\n }\n}\n\nfunction addTishreiHolidays(map: HolidayYearMap, year: number, RH: HDate): void {\n // standard holidays that don't shift based on year\n addToMap(map, new RoshHashanaEvent(RH, year, CHAG | LIGHT_CANDLES_TZEIS));\n const tzomGedaliahDay: number = RH.getDay() === THU ? 4 : 3;\n addToMap(\n map,\n new HolidayEvent(\n new HDate(tzomGedaliahDay, TISHREI, year),\n hdesc.TZOM_GEDALIAH,\n MINOR_FAST\n ),\n // first SAT after RH\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, 7 + RH.abs())),\n hdesc.SHABBAT_SHUVA,\n SPECIAL_SHABBAT\n )\n );\n}\n\nfunction addChanukahAndTevet(map: HolidayYearMap, year: number): void {\n const rchTevet = HDate.shortKislev(year)\n ? new HDate(1, TEVET, year)\n : new HDate(30, KISLEV, year);\n addToMap(\n map,\n new HolidayEvent(rchTevet, hdesc.CHAG_HABANOT, MINOR_HOLIDAY),\n new ChanukahEvent(\n new HDate(24, KISLEV, year),\n hdesc.CHANUKAH_1_CANDLE,\n EREV | MINOR_HOLIDAY | CHANUKAH_CANDLES,\n undefined\n )\n );\n // yes, we know Kislev 30-32 are wrong\n // HDate() corrects the month automatically\n for (let candles = 2; candles <= 8; candles++) {\n const hd = new HDate(23 + candles, KISLEV, year);\n addToMap(\n map,\n new ChanukahEvent(\n hd,\n `Chanukah: ${candles} Candles`,\n MINOR_HOLIDAY | CHANUKAH_CANDLES,\n candles - 1\n )\n );\n }\n addToMap(\n map,\n new ChanukahEvent(\n new HDate(32, KISLEV, year),\n hdesc.CHANUKAH_8TH_DAY,\n MINOR_HOLIDAY,\n 8\n ),\n new AsaraBTevetEvent(new HDate(10, TEVET, year), hdesc.ASARA_BTEVET, MINOR_FAST)\n );\n}\n\nfunction addPesachSeasonHolidays(\n map: HolidayYearMap,\n year: number,\n pesach: HDate\n): void {\n const pesachAbs = pesach.abs();\n const haChodeshAbs = HDate.dayOnOrBefore(SAT, pesachAbs - 14);\n addToMap(\n map,\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, pesachAbs - 43)),\n hdesc.SHABBAT_SHEKALIM,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, pesachAbs - 30)),\n hdesc.SHABBAT_ZACHOR,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n new HDate(pesachAbs - (pesach.getDay() === TUE ? 33 : 31)),\n hdesc.TAANIT_ESTHER,\n MINOR_FAST\n ),\n new HolidayEvent(\n new HDate(haChodeshAbs - 7),\n hdesc.SHABBAT_PARAH,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n new HDate(haChodeshAbs),\n hdesc.SHABBAT_HACHODESH,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, pesachAbs - 1)),\n hdesc.SHABBAT_HAGADOL,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n // if the fast falls on Shabbat, move to Thursday\n pesach.prev().getDay() === SAT\n ? pesach.onOrBefore(THU)\n : new HDate(14, NISAN, year),\n hdesc.TAANIT_BECHOROT,\n MINOR_FAST\n )\n );\n}\n\nfunction addLeilSelichot(map: HolidayYearMap, year: number): void {\n addToMap(\n map,\n new HolidayEvent(\n new HDate(\n HDate.dayOnOrBefore(SAT, new HDate(1, TISHREI, year + 1).abs() - 4)\n ),\n hdesc.LEIL_SELICHOT,\n MINOR_HOLIDAY,\n {emoji: '🕍'}\n )\n );\n}\n\nfunction addPurimVariants(map: HolidayYearMap, year: number, pesach: HDate): void {\n if (pesach.getDay() === SUN) {\n addToMap(\n map,\n new HolidayEvent(\n new HDate(16, ADAR_II, year),\n hdesc.PURIM_MESHULASH,\n MINOR_HOLIDAY\n )\n );\n }\n if (HDate.isLeapYear(year)) {\n addToMap(\n map,\n new HolidayEvent(\n new HDate(14, ADAR_I, year),\n hdesc.PURIM_KATAN,\n MINOR_HOLIDAY,\n {emoji: '🎭️'}\n ),\n new HolidayEvent(\n new HDate(15, ADAR_I, year),\n hdesc.SHUSHAN_PURIM_KATAN,\n MINOR_HOLIDAY,\n {emoji: '🎭️'}\n )\n );\n }\n}\n\nfunction addSummerFasts(map: HolidayYearMap, year: number): void {\n let tamuz17 = new HDate(17, TAMUZ, year);\n let tamuz17attrs: {observed: boolean} | undefined;\n if (tamuz17.getDay() === SAT) {\n tamuz17 = new HDate(18, TAMUZ, year);\n tamuz17attrs = {observed: true};\n }\n addToMap(\n map,\n new HolidayEvent(tamuz17, hdesc.TZOM_TAMMUZ, MINOR_FAST, tamuz17attrs)\n );\n\n let av9dt = new HDate(9, AV, year);\n let av9title = hdesc.TISHA_BAV;\n let av9attrs: {observed: boolean} | undefined;\n if (av9dt.getDay() === SAT) {\n av9dt = av9dt.next();\n av9attrs = {observed: true};\n av9title += ' (observed)';\n }\n const av9abs = av9dt.abs();\n addToMap(\n map,\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, av9abs)),\n hdesc.SHABBAT_CHAZON,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n av9dt.prev(),\n hdesc.EREV_TISHA_BAV,\n EREV | MAJOR_FAST,\n av9attrs\n ),\n new HolidayEvent(av9dt, av9title, MAJOR_FAST, av9attrs),\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, av9abs + 7)),\n hdesc.SHABBAT_NACHAMU,\n SPECIAL_SHABBAT\n )\n );\n}\n\nfunction daysInPreviousMonth(month: number, year: number): number {\n return month === NISAN\n ? HDate.daysInMonth(HDate.monthsInYear(year - 1), year - 1)\n : HDate.daysInMonth(month - 1, year);\n}\n\nfunction addRoshChodesh(map: HolidayYearMap, year: number): void {\n const monthsInYear = HDate.monthsInYear(year);\n for (let month = 1; month <= monthsInYear; month++) {\n const monthName = HDate.getMonthName(month, year);\n if (daysInPreviousMonth(month, year) === 30) {\n addToMap(map, new RoshChodeshEvent(new HDate(1, month, year), monthName));\n addToMap(\n map,\n new RoshChodeshEvent(new HDate(30, month - 1, year), monthName)\n );\n } else if (month !== TISHREI) {\n addToMap(map, new RoshChodeshEvent(new HDate(1, month, year), monthName));\n }\n }\n}\n\nfunction addYomKippurKatan(map: HolidayYearMap, year: number): void {\n const monthsInYear = HDate.monthsInYear(year);\n // start at Iyyar because one may not fast during Nisan\n for (let month = IYYAR; month <= monthsInYear; month++) {\n const nextMonth = month + 1;\n // Yom Kippur Katan is not observed on the day before Rosh Hashanah.\n // Not observed prior to Rosh Chodesh Cheshvan because Yom Kippur has just passed.\n // Not observed before Rosh Chodesh Tevet, because that day is Hanukkah.\n if (nextMonth === TISHREI || nextMonth === CHESHVAN || nextMonth === TEVET) {\n continue;\n }\n let ykk = new HDate(29, month, year);\n const dow = ykk.getDay();\n if (dow === FRI || dow === SAT) {\n ykk = ykk.onOrBefore(THU);\n }\n const nextMonthName = HDate.getMonthName(nextMonth, year);\n addToMap(map, new YomKippurKatanEvent(ykk, nextMonthName));\n }\n}\n\nfunction addBehab(map: HolidayYearMap, year: number): void {\n for (const month of [CHESHVAN, IYYAR]) {\n const roshChodesh = new HDate(1, month, year);\n let shabbos = new HDate(HDate.dayOnOrBefore(SAT, roshChodesh.abs() + 6));\n if (shabbos.abs() === roshChodesh.abs()) {\n shabbos = new HDate(shabbos.abs() + 7);\n }\n const fastDays = [2, 5, 9].map(offset => new HDate(shabbos.abs() + offset));\n if (month === IYYAR && fastDays[2].getDate() === 14) {\n fastDays[2] = new HDate(17, IYYAR, year);\n }\n for (const hd of fastDays) {\n addToMap(map, new HolidayEvent(hd, hdesc.TAANIT_BEHAB, MINOR_FAST | BEHAB));\n }\n }\n}\n\n/**\n * Lower-level holidays interface, which returns a `Map` of `Event`s indexed by\n * `HDate.toString()`. These events must filtered especially for `flags.IL_ONLY`\n * or `flags.CHUL_ONLY` depending on Israel vs. Diaspora holiday scheme.\n * @internal\n */\nexport function getHolidaysForYear_(year: number): HolidayYearMap {\n if (typeof year !== 'number') {\n throw new TypeError(`bad Hebrew year: ${year}`);\n }\n if (year < 1 || year > 32658) {\n throw new RangeError(`Hebrew year ${year} out of range 1-32658`);\n }\n const cached = yearCache.get(year);\n if (cached) {\n return cached;\n }\n\n const RH = new HDate(1, TISHREI, year);\n const pesach = new HDate(15, NISAN, year);\n const map: HolidayYearMap = new Map();\n\n addStaticHolidays(map, year);\n addTishreiHolidays(map, year, RH);\n addChanukahAndTevet(map, year);\n addPesachSeasonHolidays(map, year, pesach);\n addLeilSelichot(map, year);\n addPurimVariants(map, year, pesach);\n addToMap(map, ...modernHolidaysForYear(year));\n addSummerFasts(map, year);\n addRoshChodesh(map, year);\n addYomKippurKatan(map, year);\n addBehab(map, year);\n\n const sedra = getSedra(year, false);\n const beshalachHd = sedra.find(15);\n if (beshalachHd === null) {\n throw new Error(`Parashat Beshalach not found in year ${year}`);\n }\n addToMap(\n map,\n new HolidayEvent(beshalachHd, hdesc.SHABBAT_SHIRAH, SPECIAL_SHABBAT)\n );\n\n // Birkat Hachamah appears only once every 28 years\n const birkatHaChama = getBirkatHaChama(year);\n if (birkatHaChama !== undefined) {\n const hd = new HDate(birkatHaChama);\n addToMap(\n map,\n new HolidayEvent(hd, hdesc.BIRKAT_HACHAMAH, MINOR_HOLIDAY, {emoji: '☀️'})\n );\n }\n\n for (const arr of map.values()) {\n arr.sort((a, b) => timeOfDay(a) - timeOfDay(b));\n }\n\n yearCache.set(year, map);\n return map;\n}\n\n/** 28 years of 365.25 days */\nconst BIRKAT_HACHAMAH_CYCLE_DAYS = 10227;\nconst BIRKAT_HACHAMAH_EPOCH_OFFSET = 1373429;\nconst BIRKAT_HACHAMAH_REMAINDER = 172;\n\n/**\n * Birkat Hachamah appears only once every 28 years.\n * Although almost always in Nisan, it can occur in Adar II.\n * - 27 Adar II 5461 (Gregorian year 1701)\n * - 29 Adar II 5993 (Gregorian year 2233)\n *\n * Due to drift, this will eventually slip into Iyyar\n * - 2 Iyyar 7141 (Gregorian year 3381)\n */\nfunction getBirkatHaChama(year: number): number | undefined {\n const leap = HDate.isLeapYear(year);\n const startMonth = leap ? ADAR_II : NISAN;\n const startDay = leap ? 20 : 1;\n const baseRd = HDate.hebrew2abs(year, startMonth, startDay);\n for (let day = 0; day <= 40; day++) {\n const abs = baseRd + day;\n const elapsed = abs + BIRKAT_HACHAMAH_EPOCH_OFFSET;\n if (elapsed % BIRKAT_HACHAMAH_CYCLE_DAYS === BIRKAT_HACHAMAH_REMAINDER) {\n return abs;\n }\n }\n return undefined;\n}\n\n/**\n * Returns a sorted array of holidays observed during the given Hebrew year,\n * filtered by Israel vs. Diaspora schedule.\n *\n * Includes Rosh Chodesh, fasts, special Shabbatot, modern holidays, etc.,\n * but does not generate candle-lighting times, Torah readings, or Omer days.\n * Use {@link calendar} for those.\n * @example\n * import {getHolidaysForYearArray} from '@hebcal/core';\n * const events = getHolidaysForYearArray(5784, false);\n * console.log(events[0].getDesc()); // 'Rosh Hashana 5784'\n * @param year Hebrew year\n * @param il use the Israeli schedule for holidays\n */\nexport function getHolidaysForYearArray(year: number, il: boolean): HolidayEvent[] {\n const yearMap = getHolidaysForYear_(year);\n const startAbs = HDate.hebrew2abs(year, TISHREI, 1);\n const endAbs = HDate.hebrew2abs(year + 1, TISHREI, 1) - 1;\n const events: HolidayEvent[] = [];\n for (let absDt = startAbs; absDt <= endAbs; absDt++) {\n const hd = new HDate(absDt);\n const holidays = yearMap.get(hd.toString());\n if (holidays) {\n events.push(...holidays.filter(ev => ev.observedIn(il)));\n }\n }\n return events;\n}\n"],"names":["hdesc"],"mappings":";;;;;;;;;;;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AAG,GAAG,4BAA4B;AAClD,QAAA,IAAI,OAAO,GAAG,0BAA0B,KAAK,yBAAyB,EAAE;AACtE,YAAA,OAAO,GAAG;QACZ;IACF;AACA,IAAA,OAAO,SAAS;AAClB;AAEA;;;;;;;;;;;;;AAaG;AACG,SAAU,uBAAuB,CAAC,IAAY,EAAE,EAAW,EAAA;AAC/D,IAAA,MAAM,OAAO,GAAG,mBAAmB,CAAC,IAAI,CAAC;AACzC,IAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;AACnD,IAAA,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,GAAG,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC;IACzD,MAAM,MAAM,GAAmB,EAAE;AACjC,IAAA,KAAK,IAAI,KAAK,GAAG,QAAQ,EAAE,KAAK,IAAI,MAAM,EAAE,KAAK,EAAE,EAAE;AACnD,QAAA,MAAM,EAAE,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC;QAC3B,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC;QAC3C,IAAI,QAAQ,EAAE;YACZ,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;QAC1D;IACF;AACA,IAAA,OAAO,MAAM;AACf;;"}
|
|
1
|
+
{"version":3,"file":"holidays.js","sources":["../../../src/holidays.ts"],"sourcesContent":["/*\n Hebcal - A Jewish Calendar Generator\n Copyright (c) 1994-2020 Danny Sadinoff\n Portions copyright Eyal Schachter and Michael J. Radwin\n\n https://github.com/hebcal/hebcal-es6\n\n This program is free software; you can redistribute it and/or\n modify it under the terms of the GNU General Public License\n as published by the Free Software Foundation; either version 2\n of the License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {HDate, months} from '@hebcal/hdate';\nimport QuickLRU from 'quick-lru';\nimport {Event, flags} from './event.js';\nimport {modernHolidaysForYear} from './modern.js';\nimport {getSedra} from './sedra.js';\nimport {staticHolidays, holidayDesc as hdesc} from './staticHolidays.js';\nimport {TimedEvent} from './TimedEvent.js';\nimport {YomKippurKatanEvent} from './YomKippurKatanEvent.js';\nimport {\n HolidayEvent,\n ChanukahEvent,\n AsaraBTevetEvent,\n RoshHashanaEvent,\n RoshChodeshEvent,\n} from './HolidayEvent.js';\n\n/**\n * Returns an array of holiday Events that occur on the given date, or\n * `undefined` if no holidays occur that day.\n *\n * When `il` is omitted, both Diaspora-only and Israel-only events are\n * returned (e.g. on the second day of a Yom Tov, both `\"Pesach II\"` for\n * Diaspora and any Israel-only events). Pass `true` or `false` to filter\n * to a single schedule.\n * @example\n * import {getHolidaysOnDate, HDate, months} from '@hebcal/core';\n * const events = getHolidaysOnDate(new HDate(15, months.NISAN, 5784), false);\n * events?.map(ev => ev.getDesc()); // ['Pesach I']\n * @param date Hebrew Date, Gregorian date, or absolute R.D. day number\n * @param [il] use the Israeli schedule for holidays\n */\nexport function getHolidaysOnDate(\n date: HDate | Date | number,\n il?: boolean\n): HolidayEvent[] | undefined {\n let abs: number;\n let entry: YearEntry | undefined;\n const last = lastEntry;\n if (\n typeof date === 'number' &&\n last !== undefined &&\n date >= last.startAbs &&\n date <= last.endAbs\n ) {\n // Callers often walk day by day; skip the R.D. → Hebrew date\n // conversion while the date stays within the most recently used year.\n abs = date;\n entry = last;\n } else {\n const hd = HDate.isHDate(date) ? date : new HDate(date);\n abs = hd.abs();\n entry = getYearEntry(hd.getFullYear());\n }\n const events = entry.map.get(abs);\n // if il isn't a boolean return both diaspora + IL for day\n if (il === undefined || events === undefined) {\n return events;\n }\n return events.filter(ev => ev.observedIn(il));\n}\n\nconst {\n CHAG,\n LIGHT_CANDLES_TZEIS,\n CHANUKAH_CANDLES,\n BEHAB,\n MINOR_FAST,\n SPECIAL_SHABBAT,\n MAJOR_FAST,\n MINOR_HOLIDAY,\n EREV,\n} = flags;\n\nconst SUN = 0;\nconst TUE = 2;\nconst THU = 4;\nconst FRI = 5;\nconst SAT = 6;\n\nconst {NISAN, IYYAR, TAMUZ, AV, TISHREI, CHESHVAN, KISLEV, TEVET, ADAR_I, ADAR_II} =\n months;\n\n/**\n * Holidays for an entire Hebrew year, indexed by `HDate.toString()`\n * (e.g. `'15 Nisan 5784'`). Returned by\n * {@link HebrewCalendar.getHolidaysForYear}. Because a single date can carry\n * more than one event, each key maps to an array. Entries are *not* filtered\n * by Israel vs. Diaspora — inspect `flags.IL_ONLY` / `flags.CHUL_ONLY`.\n */\nexport type HolidayYearMap = Map<string, HolidayEvent[]>;\n\n/**\n * Holidays for an entire Hebrew year, indexed by R.D. (Rata Die) day number,\n * i.e. `HDate.abs()`. Like {@link HolidayYearMap}, entries are not filtered by\n * Israel vs. Diaspora. Cached and shared, so must not be modified.\n * @internal\n */\nexport type HolidayYearRdMap = ReadonlyMap<number, readonly HolidayEvent[]>;\n\ntype MutableRdMap = Map<number, HolidayEvent[]>;\n\ninterface YearEntry {\n year: number;\n map: MutableRdMap;\n /** R.D. of 1 Tishrei */\n startAbs: number;\n /** R.D. of 29 Elul */\n endAbs: number;\n}\n\nconst yearCache = new QuickLRU<number, YearEntry>({maxSize: 120});\n/** Most recently used year, so day-by-day callers skip the LRU lookup */\nlet lastEntry: YearEntry | undefined;\nconst stringMapCache = new WeakMap<YearEntry, HolidayYearMap>();\n\nfunction addToMap(map: MutableRdMap, ...events: HolidayEvent[]): void {\n for (const ev of events) {\n const key = ev.date.abs();\n const arr = map.get(key);\n if (arr !== undefined) {\n arr.push(ev);\n } else {\n map.set(key, [ev]);\n }\n }\n}\n\n/** @internal */\nexport const TIME_OF_DAY_DAWN = 0;\n/** @internal */\nexport const TIME_OF_DAY_MORNING = 1;\n/** @internal */\nexport const TIME_OF_DAY_MEVARCHIM = 2;\n/** @internal */\nexport const TIME_OF_DAY_DAY = 3;\n/** @internal */\nexport const TIME_OF_DAY_MIDDAY = 4;\n/** @internal */\nexport const TIME_OF_DAY_LEARNING = 5;\n/** @internal */\nexport const TIME_OF_DAY_EVENING = 6;\n/** @internal */\nexport const TIME_OF_DAY_NIGHT = 7;\n\n/**\n * Approximate time of day of an event, used to order events on the same date.\n * Events of equal rank keep the order in which they were created, and timed\n * events of equal rank are ordered by their time.\n * - Dawn: Fast begins for a minor fast, and a Latest Kiddush Levana before\n * noon (which is never later than _alot hashachar_)\n * - Morning: the parsha, special Shabbatot (tied to the Torah or Haftarah\n * reading), minor fasts (which begin at dawn) and Birkat Hachamah\n * (recited at sunrise)\n * - Molad and Shabbat Mevarchim, announced in synagogue after the Torah\n * reading\n * - Day: everything else, including Yizkor and the Omer count\n * - Midday: the deadlines for eating and burning chametz\n * - Daily learning\n * - Evening: Erev holidays, Chanukah candle-lighting and Leil Selichot\n * - Night: other timed events such as candle-lighting, Havdalah,\n * Fast ends, and a Latest Kiddush Levana after noon\n * @internal\n */\nexport function timeOfDay(ev: Event): number {\n if (ev instanceof TimedEvent) {\n return timedEventTimeOfDay(ev);\n }\n const desc = ev.getDesc();\n if (ev.hasAnyFlag('EREV', 'CHANUKAH_CANDLES') || desc === hdesc.LEIL_SELICHOT) {\n return TIME_OF_DAY_EVENING;\n }\n if (\n ev.hasAnyFlag('PARSHA_HASHAVUA', 'SPECIAL_SHABBAT', 'MINOR_FAST') ||\n desc === hdesc.BIRKAT_HACHAMAH\n ) {\n return TIME_OF_DAY_MORNING;\n }\n if (ev.hasAnyFlag('SHABBAT_MEVARCHIM', 'MOLAD')) {\n return TIME_OF_DAY_MEVARCHIM;\n }\n if (\n ev.hasAnyFlag(\n 'DAILY_LEARNING',\n 'DAF_YOMI',\n 'MISHNA_YOMI',\n 'NACH_YOMI',\n 'YERUSHALMI_YOMI'\n )\n ) {\n return TIME_OF_DAY_LEARNING;\n }\n return TIME_OF_DAY_DAY;\n}\n\nfunction timedEventTimeOfDay(ev: TimedEvent): number {\n const desc = ev.getDesc();\n if (desc === hdesc.SOF_ZMAN_ACHILAT_CHAMETZ || desc === hdesc.BIUR_CHAMETZ) {\n return TIME_OF_DAY_MIDDAY;\n }\n // A minor fast begins at dawn, but Tish'a B'Av at sunset the day before.\n // Latest Kiddush Levana is either before dawn or after nightfall.\n if (desc === hdesc.FAST_BEGINS || ev.hasFlag('KIDDUSH_LEVANA')) {\n // `eventTimeStr` is 24-hour local time; some engines format midnight as 24:00\n const hour = Number.parseInt(ev.eventTimeStr, 10) % 24;\n return hour < 12 ? TIME_OF_DAY_DAWN : TIME_OF_DAY_NIGHT;\n }\n return TIME_OF_DAY_NIGHT;\n}\n\nfunction addStaticHolidays(map: MutableRdMap, year: number): void {\n for (const h of staticHolidays) {\n const hd = new HDate(h.dd, h.mm, year);\n const attrs: {emoji?: string; cholHaMoedDay?: number} = {};\n if (h.emoji) attrs.emoji = h.emoji;\n if (h.chmDay) attrs.cholHaMoedDay = h.chmDay;\n addToMap(map, new HolidayEvent(hd, h.desc, h.flags, attrs));\n }\n}\n\nfunction addTishreiHolidays(map: MutableRdMap, year: number, RH: HDate): void {\n // standard holidays that don't shift based on year\n addToMap(map, new RoshHashanaEvent(RH, year, CHAG | LIGHT_CANDLES_TZEIS));\n const tzomGedaliahDay: number = RH.getDay() === THU ? 4 : 3;\n addToMap(\n map,\n new HolidayEvent(\n new HDate(tzomGedaliahDay, TISHREI, year),\n hdesc.TZOM_GEDALIAH,\n MINOR_FAST\n ),\n // first SAT after RH\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, 7 + RH.abs())),\n hdesc.SHABBAT_SHUVA,\n SPECIAL_SHABBAT\n )\n );\n}\n\nfunction addChanukahAndTevet(map: MutableRdMap, year: number): void {\n const rchTevet = HDate.shortKislev(year)\n ? new HDate(1, TEVET, year)\n : new HDate(30, KISLEV, year);\n addToMap(\n map,\n new HolidayEvent(rchTevet, hdesc.CHAG_HABANOT, MINOR_HOLIDAY),\n new ChanukahEvent(\n new HDate(24, KISLEV, year),\n hdesc.CHANUKAH_1_CANDLE,\n EREV | MINOR_HOLIDAY | CHANUKAH_CANDLES,\n undefined\n )\n );\n // yes, we know Kislev 30-32 are wrong\n // HDate() corrects the month automatically\n for (let candles = 2; candles <= 8; candles++) {\n const hd = new HDate(23 + candles, KISLEV, year);\n addToMap(\n map,\n new ChanukahEvent(\n hd,\n `Chanukah: ${candles} Candles`,\n MINOR_HOLIDAY | CHANUKAH_CANDLES,\n candles - 1\n )\n );\n }\n addToMap(\n map,\n new ChanukahEvent(\n new HDate(32, KISLEV, year),\n hdesc.CHANUKAH_8TH_DAY,\n MINOR_HOLIDAY,\n 8\n ),\n new AsaraBTevetEvent(new HDate(10, TEVET, year), hdesc.ASARA_BTEVET, MINOR_FAST)\n );\n}\n\nfunction addPesachSeasonHolidays(\n map: MutableRdMap,\n year: number,\n pesach: HDate\n): void {\n const pesachAbs = pesach.abs();\n const haChodeshAbs = HDate.dayOnOrBefore(SAT, pesachAbs - 14);\n addToMap(\n map,\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, pesachAbs - 43)),\n hdesc.SHABBAT_SHEKALIM,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, pesachAbs - 30)),\n hdesc.SHABBAT_ZACHOR,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n new HDate(pesachAbs - (pesach.getDay() === TUE ? 33 : 31)),\n hdesc.TAANIT_ESTHER,\n MINOR_FAST\n ),\n new HolidayEvent(\n new HDate(haChodeshAbs - 7),\n hdesc.SHABBAT_PARAH,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n new HDate(haChodeshAbs),\n hdesc.SHABBAT_HACHODESH,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, pesachAbs - 1)),\n hdesc.SHABBAT_HAGADOL,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n // if the fast falls on Shabbat, move to Thursday\n pesach.prev().getDay() === SAT\n ? pesach.onOrBefore(THU)\n : new HDate(14, NISAN, year),\n hdesc.TAANIT_BECHOROT,\n MINOR_FAST\n )\n );\n}\n\nfunction addLeilSelichot(map: MutableRdMap, year: number): void {\n addToMap(\n map,\n new HolidayEvent(\n new HDate(\n HDate.dayOnOrBefore(SAT, new HDate(1, TISHREI, year + 1).abs() - 4)\n ),\n hdesc.LEIL_SELICHOT,\n MINOR_HOLIDAY,\n {emoji: '🕍'}\n )\n );\n}\n\nfunction addPurimVariants(map: MutableRdMap, year: number, pesach: HDate): void {\n if (pesach.getDay() === SUN) {\n addToMap(\n map,\n new HolidayEvent(\n new HDate(16, ADAR_II, year),\n hdesc.PURIM_MESHULASH,\n MINOR_HOLIDAY\n )\n );\n }\n if (HDate.isLeapYear(year)) {\n addToMap(\n map,\n new HolidayEvent(\n new HDate(14, ADAR_I, year),\n hdesc.PURIM_KATAN,\n MINOR_HOLIDAY,\n {emoji: '🎭️'}\n ),\n new HolidayEvent(\n new HDate(15, ADAR_I, year),\n hdesc.SHUSHAN_PURIM_KATAN,\n MINOR_HOLIDAY,\n {emoji: '🎭️'}\n )\n );\n }\n}\n\nfunction addSummerFasts(map: MutableRdMap, year: number): void {\n let tamuz17 = new HDate(17, TAMUZ, year);\n let tamuz17attrs: {observed: boolean} | undefined;\n if (tamuz17.getDay() === SAT) {\n tamuz17 = new HDate(18, TAMUZ, year);\n tamuz17attrs = {observed: true};\n }\n addToMap(\n map,\n new HolidayEvent(tamuz17, hdesc.TZOM_TAMMUZ, MINOR_FAST, tamuz17attrs)\n );\n\n let av9dt = new HDate(9, AV, year);\n let av9title = hdesc.TISHA_BAV;\n let av9attrs: {observed: boolean} | undefined;\n if (av9dt.getDay() === SAT) {\n av9dt = av9dt.next();\n av9attrs = {observed: true};\n av9title += ' (observed)';\n }\n const av9abs = av9dt.abs();\n addToMap(\n map,\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, av9abs)),\n hdesc.SHABBAT_CHAZON,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n av9dt.prev(),\n hdesc.EREV_TISHA_BAV,\n EREV | MAJOR_FAST,\n av9attrs\n ),\n new HolidayEvent(av9dt, av9title, MAJOR_FAST, av9attrs),\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, av9abs + 7)),\n hdesc.SHABBAT_NACHAMU,\n SPECIAL_SHABBAT\n )\n );\n}\n\nfunction daysInPreviousMonth(month: number, year: number): number {\n return month === NISAN\n ? HDate.daysInMonth(HDate.monthsInYear(year - 1), year - 1)\n : HDate.daysInMonth(month - 1, year);\n}\n\nfunction addRoshChodesh(map: MutableRdMap, year: number): void {\n const monthsInYear = HDate.monthsInYear(year);\n for (let month = 1; month <= monthsInYear; month++) {\n const monthName = HDate.getMonthName(month, year);\n if (daysInPreviousMonth(month, year) === 30) {\n addToMap(map, new RoshChodeshEvent(new HDate(1, month, year), monthName));\n addToMap(\n map,\n new RoshChodeshEvent(new HDate(30, month - 1, year), monthName)\n );\n } else if (month !== TISHREI) {\n addToMap(map, new RoshChodeshEvent(new HDate(1, month, year), monthName));\n }\n }\n}\n\nfunction addYomKippurKatan(map: MutableRdMap, year: number): void {\n const monthsInYear = HDate.monthsInYear(year);\n // start at Iyyar because one may not fast during Nisan\n for (let month = IYYAR; month <= monthsInYear; month++) {\n const nextMonth = month + 1;\n // Yom Kippur Katan is not observed on the day before Rosh Hashanah.\n // Not observed prior to Rosh Chodesh Cheshvan because Yom Kippur has just passed.\n // Not observed before Rosh Chodesh Tevet, because that day is Hanukkah.\n if (nextMonth === TISHREI || nextMonth === CHESHVAN || nextMonth === TEVET) {\n continue;\n }\n let ykk = new HDate(29, month, year);\n const dow = ykk.getDay();\n if (dow === FRI || dow === SAT) {\n ykk = ykk.onOrBefore(THU);\n }\n const nextMonthName = HDate.getMonthName(nextMonth, year);\n addToMap(map, new YomKippurKatanEvent(ykk, nextMonthName));\n }\n}\n\nfunction addBehab(map: MutableRdMap, year: number): void {\n for (const month of [CHESHVAN, IYYAR]) {\n const roshChodesh = new HDate(1, month, year);\n let shabbos = new HDate(HDate.dayOnOrBefore(SAT, roshChodesh.abs() + 6));\n if (shabbos.abs() === roshChodesh.abs()) {\n shabbos = new HDate(shabbos.abs() + 7);\n }\n const fastDays = [2, 5, 9].map(offset => new HDate(shabbos.abs() + offset));\n if (month === IYYAR && fastDays[2].getDate() === 14) {\n fastDays[2] = new HDate(17, IYYAR, year);\n }\n for (const hd of fastDays) {\n addToMap(map, new HolidayEvent(hd, hdesc.TAANIT_BEHAB, MINOR_FAST | BEHAB));\n }\n }\n}\n\n/**\n * Holidays for an entire Hebrew year, indexed by R.D. day number\n * (`HDate.abs()`), so that per-day lookups don't have to build a date string.\n * The result is cached in an internal LRU and shared between callers.\n * @internal\n */\nexport function getHolidaysForYearByRd(year: number): HolidayYearRdMap {\n return getYearEntry(year).map;\n}\n\n/**\n * Lower-level holidays interface, which returns a `Map` of `Event`s indexed by\n * `HDate.toString()`. These events must filtered especially for `flags.IL_ONLY`\n * or `flags.CHUL_ONLY` depending on Israel vs. Diaspora holiday scheme.\n *\n * A string-keyed copy of {@link getHolidaysForYearByRd}, built once per\n * cached year; the event arrays are shared with it.\n * @internal\n */\nexport function getHolidaysForYear_(year: number): HolidayYearMap {\n const entry = getYearEntry(year);\n let strMap = stringMapCache.get(entry);\n if (strMap === undefined) {\n strMap = new Map();\n for (const [abs, events] of entry.map) {\n strMap.set(new HDate(abs).toString(), events);\n }\n stringMapCache.set(entry, strMap);\n }\n return strMap;\n}\n\nfunction getYearEntry(year: number): YearEntry {\n const last = lastEntry;\n if (last?.year === year) {\n return last;\n }\n const entry = yearCache.get(year) ?? makeYearEntry(year);\n lastEntry = entry;\n return entry;\n}\n\nfunction makeYearEntry(year: number): YearEntry {\n if (typeof year !== 'number') {\n throw new TypeError(`bad Hebrew year: ${year}`);\n }\n if (year < 1 || year > 32658) {\n throw new RangeError(`Hebrew year ${year} out of range 1-32658`);\n }\n\n const RH = new HDate(1, TISHREI, year);\n const pesach = new HDate(15, NISAN, year);\n const map: MutableRdMap = new Map();\n\n addStaticHolidays(map, year);\n addTishreiHolidays(map, year, RH);\n addChanukahAndTevet(map, year);\n addPesachSeasonHolidays(map, year, pesach);\n addLeilSelichot(map, year);\n addPurimVariants(map, year, pesach);\n addToMap(map, ...modernHolidaysForYear(year));\n addSummerFasts(map, year);\n addRoshChodesh(map, year);\n addYomKippurKatan(map, year);\n addBehab(map, year);\n\n const sedra = getSedra(year, false);\n const beshalachHd = sedra.find(15);\n if (beshalachHd === null) {\n throw new Error(`Parashat Beshalach not found in year ${year}`);\n }\n addToMap(\n map,\n new HolidayEvent(beshalachHd, hdesc.SHABBAT_SHIRAH, SPECIAL_SHABBAT)\n );\n\n // Birkat Hachamah appears only once every 28 years\n const birkatHaChama = getBirkatHaChama(year);\n if (birkatHaChama !== undefined) {\n const hd = new HDate(birkatHaChama);\n addToMap(\n map,\n new HolidayEvent(hd, hdesc.BIRKAT_HACHAMAH, MINOR_HOLIDAY, {emoji: '☀️'})\n );\n }\n\n for (const arr of map.values()) {\n arr.sort((a, b) => timeOfDay(a) - timeOfDay(b));\n }\n\n const entry: YearEntry = {\n year,\n map,\n startAbs: RH.abs(),\n endAbs: HDate.hebrew2abs(year + 1, TISHREI, 1) - 1,\n };\n yearCache.set(year, entry);\n return entry;\n}\n\n/** 28 years of 365.25 days */\nconst BIRKAT_HACHAMAH_CYCLE_DAYS = 10227;\nconst BIRKAT_HACHAMAH_EPOCH_OFFSET = 1373429;\nconst BIRKAT_HACHAMAH_REMAINDER = 172;\n\n/**\n * Birkat Hachamah appears only once every 28 years.\n * Although almost always in Nisan, it can occur in Adar II.\n * - 27 Adar II 5461 (Gregorian year 1701)\n * - 29 Adar II 5993 (Gregorian year 2233)\n *\n * Due to drift, this will eventually slip into Iyyar\n * - 2 Iyyar 7141 (Gregorian year 3381)\n */\nfunction getBirkatHaChama(year: number): number | undefined {\n const leap = HDate.isLeapYear(year);\n const startMonth = leap ? ADAR_II : NISAN;\n const startDay = leap ? 20 : 1;\n const baseRd = HDate.hebrew2abs(year, startMonth, startDay);\n for (let day = 0; day <= 40; day++) {\n const abs = baseRd + day;\n const elapsed = abs + BIRKAT_HACHAMAH_EPOCH_OFFSET;\n if (elapsed % BIRKAT_HACHAMAH_CYCLE_DAYS === BIRKAT_HACHAMAH_REMAINDER) {\n return abs;\n }\n }\n return undefined;\n}\n\n/**\n * Returns a sorted array of holidays observed during the given Hebrew year,\n * filtered by Israel vs. Diaspora schedule.\n *\n * Includes Rosh Chodesh, fasts, special Shabbatot, modern holidays, etc.,\n * but does not generate candle-lighting times, Torah readings, or Omer days.\n * Use {@link calendar} for those.\n * @example\n * import {getHolidaysForYearArray} from '@hebcal/core';\n * const events = getHolidaysForYearArray(5784, false);\n * console.log(events[0].getDesc()); // 'Rosh Hashana 5784'\n * @param year Hebrew year\n * @param il use the Israeli schedule for holidays\n */\nexport function getHolidaysForYearArray(year: number, il: boolean): HolidayEvent[] {\n const {map, startAbs, endAbs} = getYearEntry(year);\n const days: number[] = [];\n for (const abs of map.keys()) {\n if (abs >= startAbs && abs <= endAbs) {\n days.push(abs);\n }\n }\n days.sort((a, b) => a - b);\n const events: HolidayEvent[] = [];\n for (const abs of days) {\n for (const ev of map.get(abs)!) {\n if (ev.observedIn(il)) {\n events.push(ev);\n }\n }\n }\n return events;\n}\n"],"names":["hdesc"],"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;AAmBG;AAiBH;;;;;;;;;;;;;;AAcG;AACG,SAAU,iBAAiB,CAC/B,IAA2B,EAC3B,EAAY,EAAA;AAEZ,IAAA,IAAI,GAAW;AACf,IAAA,IAAI,KAA4B;IAChC,MA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4B;AAClD,QAAA,IAAI,OAAO,GAAG,0BAA0B,KAAK,yBAAyB,EAAE;AACtE,YAAA,OAAO,GAAG;QACZ;IACF;AACA,IAAA,OAAO,SAAS;AAClB;AAEA;;;;;;;;;;;;;AAaG;AACG,SAAU,uBAAuB,CAAC,IAAY,EAAE,EAAW,EAAA;AAC/D,IAAA,MAAM,EAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAC,GAAG,YAAY,CAAC,IAAI,CAAC;IAClD,MAAM,IAAI,GAAa,EAAE;IACzB,KAAK,MAAM,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,EAAE;QAC5B,IAAI,GAAG,IAAI,QAAQ,IAAI,GAAG,IAAI,MAAM,EAAE;AACpC,YAAA,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;QAChB;IACF;AACA,IAAA,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC1B,MAAM,MAAM,GAAmB,EAAE;AACjC,IAAA,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;QACtB,KAAK,MAAM,EAAE,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAE,EAAE;AAC9B,YAAA,IAAI,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE;AACrB,gBAAA,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;YACjB;QACF;IACF;AACA,IAAA,OAAO,MAAM;AACf;;"}
|
package/dist/esm/horizon.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v6.16.
|
|
1
|
+
/*! @hebcal/core v6.16.3, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
/**
|
|
3
3
|
* Pure arithmetic for the "visible" sunrise/sunset (_netz ha-nireh_,
|
|
4
4
|
* הנץ הנראה): resolving a caller-supplied terrain horizon profile, atmospheric
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export { Zmanim } from './zmanim.js';
|
|
|
12
12
|
export { isAssurBemlacha } from './isAssurBemlacha.js';
|
|
13
13
|
export { isAveilut } from './isAveilut.js';
|
|
14
14
|
export { isFastDay } from './isFastDay.js';
|
|
15
|
+
export { isYomTov } from './isYomTov.js';
|
|
15
16
|
export { TimedEvent, CandleLightingEvent, HavdalahEvent } from './TimedEvent.js';
|
|
16
17
|
export { FastDayEvent, TimedChanukahEvent } from './candles.js';
|
|
17
18
|
export { type MoladBase, calculateMolad } from './moladBase.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v6.16.
|
|
1
|
+
/*! @hebcal/core v6.16.3, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
export { version } from './pkgVersion.js';
|
|
3
3
|
export { HDate, Locale, gematriya, gematriyaStrToNum, greg, months } from '@hebcal/hdate';
|
|
4
4
|
import './locale.js';
|
|
@@ -10,6 +10,7 @@ export { Zmanim } from './zmanim.js';
|
|
|
10
10
|
export { isAssurBemlacha } from './isAssurBemlacha.js';
|
|
11
11
|
export { isAveilut } from './isAveilut.js';
|
|
12
12
|
export { isFastDay } from './isFastDay.js';
|
|
13
|
+
export { isYomTov } from './isYomTov.js';
|
|
13
14
|
export { CandleLightingEvent, HavdalahEvent, TimedEvent } from './TimedEvent.js';
|
|
14
15
|
export { FastDayEvent, TimedChanukahEvent } from './candles.js';
|
|
15
16
|
export { calculateMolad } from './moladBase.js';
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|