@hebcal/core 6.5.1 → 6.5.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 +5930 -5385
- package/dist/bundle.js.map +1 -1
- package/dist/bundle.min.js +17 -17
- package/dist/bundle.min.js.map +1 -1
- package/dist/eslint.config.mjs +1 -0
- package/dist/esm/CalOptions.d.ts +3 -4
- package/dist/esm/DailyLearning.d.ts +44 -7
- package/dist/esm/DailyLearning.js +45 -8
- package/dist/esm/DailyLearning.js.map +1 -1
- package/dist/esm/HebrewDateEvent.js +1 -1
- package/dist/esm/HolidayEvent.d.ts +34 -1
- package/dist/esm/HolidayEvent.js +35 -2
- package/dist/esm/HolidayEvent.js.map +1 -1
- package/dist/esm/MevarchimChodeshEvent.js +1 -1
- package/dist/esm/ParshaEvent.js +1 -1
- package/dist/esm/TimedEvent.d.ts +32 -3
- package/dist/esm/TimedEvent.js +33 -4
- package/dist/esm/TimedEvent.js.map +1 -1
- package/dist/esm/YomKippurKatanEvent.js +1 -1
- package/dist/esm/ashkenazi.po.d.ts +1 -0
- package/dist/esm/ashkenazi.po.js +2 -2
- package/dist/esm/ashkenazi.po.js.map +1 -1
- package/dist/esm/calendar.js +1 -1
- package/dist/esm/candles.d.ts +14 -1
- package/dist/esm/candles.js +15 -2
- package/dist/esm/candles.js.map +1 -1
- package/dist/esm/cities.json.js +1 -1
- package/dist/esm/event.d.ts +56 -13
- package/dist/esm/event.js +57 -14
- package/dist/esm/event.js.map +1 -1
- package/dist/esm/getStartAndEnd.js +10 -2
- package/dist/esm/getStartAndEnd.js.map +1 -1
- package/dist/esm/hallel.js +20 -28
- package/dist/esm/hallel.js.map +1 -1
- package/dist/esm/he-x-NoNikud.po.js +1 -1
- package/dist/esm/he.po.js +1 -1
- package/dist/esm/hebcal.d.ts +97 -19
- package/dist/esm/hebcal.js +102 -21
- package/dist/esm/hebcal.js.map +1 -1
- package/dist/esm/holidays.d.ts +21 -2
- package/dist/esm/holidays.js +22 -3
- package/dist/esm/holidays.js.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/isAssurBemlacha.d.ts +24 -4
- package/dist/esm/isAssurBemlacha.js +25 -5
- package/dist/esm/isAssurBemlacha.js.map +1 -1
- package/dist/esm/isAveilut.d.ts +14 -3
- package/dist/esm/isAveilut.js +15 -4
- package/dist/esm/isAveilut.js.map +1 -1
- package/dist/esm/isFastDay.d.ts +13 -1
- package/dist/esm/isFastDay.js +14 -2
- package/dist/esm/isFastDay.js.map +1 -1
- package/dist/esm/locale.js +1 -1
- package/dist/esm/location.d.ts +96 -8
- package/dist/esm/location.js +101 -10
- package/dist/esm/location.js.map +1 -1
- package/dist/esm/modern.js +1 -1
- package/dist/esm/molad.d.ts +39 -7
- package/dist/esm/molad.js +40 -8
- package/dist/esm/molad.js.map +1 -1
- package/dist/esm/moladBase.js +1 -1
- package/dist/esm/moladDate.js +1 -1
- package/dist/esm/omer.d.ts +32 -4
- package/dist/esm/omer.js +33 -5
- package/dist/esm/omer.js.map +1 -1
- package/dist/esm/parshaName.js +1 -1
- package/dist/esm/parshaYear.d.ts +12 -1
- package/dist/esm/parshaYear.js +13 -2
- package/dist/esm/parshaYear.js.map +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 +1 -1
- package/dist/esm/sedra.d.ts +94 -14
- package/dist/esm/sedra.js +95 -15
- 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/tachanun.js +1 -1
- package/dist/esm/temporal-shim.js +1 -1
- package/dist/esm/zmanim.js +1 -1
- package/dist/src/CalOptions.d.ts +3 -4
- package/dist/src/DailyLearning.d.ts +44 -7
- package/dist/src/DailyLearning.js +44 -7
- package/dist/src/HolidayEvent.d.ts +34 -1
- package/dist/src/HolidayEvent.js +34 -1
- package/dist/src/TimedEvent.d.ts +32 -3
- package/dist/src/TimedEvent.js +32 -3
- package/dist/src/ashkenazi.po.d.ts +1 -0
- package/dist/src/ashkenazi.po.js +1 -1
- package/dist/src/candles.d.ts +14 -1
- package/dist/src/candles.js +14 -1
- package/dist/src/event.d.ts +56 -13
- package/dist/src/event.js +56 -13
- package/dist/src/getStartAndEnd.js +9 -1
- package/dist/src/hallel.js +19 -27
- package/dist/src/hebcal.d.ts +97 -19
- package/dist/src/hebcal.js +101 -20
- package/dist/src/holidays.d.ts +21 -2
- package/dist/src/holidays.js +21 -2
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/isAssurBemlacha.d.ts +24 -4
- package/dist/src/isAssurBemlacha.js +24 -4
- package/dist/src/isAveilut.d.ts +14 -3
- package/dist/src/isAveilut.js +14 -3
- package/dist/src/isFastDay.d.ts +13 -1
- package/dist/src/isFastDay.js +13 -1
- package/dist/src/location.d.ts +96 -8
- package/dist/src/location.js +100 -9
- package/dist/src/molad.d.ts +39 -7
- package/dist/src/molad.js +39 -7
- package/dist/src/omer.d.ts +32 -4
- package/dist/src/omer.js +32 -4
- package/dist/src/parshaYear.d.ts +12 -1
- package/dist/src/parshaYear.js +12 -1
- package/dist/src/pkgVersion.d.ts +1 -1
- package/dist/src/pkgVersion.js +1 -1
- package/dist/src/sedra.d.ts +94 -14
- package/dist/src/sedra.js +94 -14
- package/package.json +11 -7
- package/po/ashkenazi.po +240 -0
- package/po/he-x-NoNikud.po +58 -0
- package/po/he.po +650 -0
package/dist/esm/sedra.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sedra.js","sources":["../../../src/sedra.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\n/*\n * Many of the following algorithms were taken from hebrew calendar\n * routines by Maimonedes, from his Mishneh Torah, and implemented by\n * Nachum Dershowitz Department of Computer Science\n * (217) 333-4219 University of Illinois at Urbana-Champaign\n * nachum@cs.uiuedu 1304 West Springfield Avenue\n * Urbana, Illinois 61801\n *\n * The routines were included in the emacs 19 distribution.\n *\n */\nimport {HDate, months} from '@hebcal/hdate';\nimport QuickLRU from 'quick-lru';\nimport './locale'; // Adds Hebrew and Ashkenazic translations\n\nconst INCOMPLETE = 0;\nconst REGULAR = 1;\nconst COMPLETE = 2;\n\nfunction yearType(hyear: number): number {\n const longC = HDate.longCheshvan(hyear);\n const shortK = HDate.shortKislev(hyear);\n if (longC && !shortK) {\n return COMPLETE;\n } else if (!longC && shortK) {\n return INCOMPLETE;\n } else {\n return REGULAR;\n }\n}\n\n/** The result from `Sedra.lookup()` */\nexport type SedraResult = {\n /**\n * Name of the parsha (or parshiyot) read on\n * Hebrew date, e.g. `['Noach']` or `['Matot', 'Masei']`\n */\n parsha: string[];\n /**\n * False if this is a regular parashat HaShavua reading.\n * True if it's a special holiday reading.\n */\n chag: boolean;\n /**\n * The parsha number (or numbers) using 1-indexing.\n * A `number` for a regular (single) parsha, and a `number[]`\n * for a doubled parsha.\n * For Parashat *Bereshit*, `num` would be equal to `1`, and for\n * *Matot-Masei* it would be `[42, 43]`\n * For a chag (holiday) reading, `num` will be `0`.\n */\n num: number | number[];\n /** The date of the Shabbat this parsha is read */\n hdate: HDate;\n /** true if Israel, false for Diaspora */\n il: boolean;\n};\n\n/**\n * Represents Parashah HaShavua for an entire Hebrew year\n */\nexport class Sedra {\n private readonly year: number;\n private readonly il: boolean;\n private readonly rh: number;\n private readonly firstSaturday: number;\n private readonly theSedraArray: readonly NumberOrString[];\n private readonly yearKey: string;\n /**\n * Caculates the Parashah HaShavua for an entire Hebrew year\n * @param hyear - Hebrew year (e.g. 5749)\n * @param il - Use Israel sedra schedule (false for Diaspora)\n */\n constructor(hyear: number, il: boolean) {\n hyear = +hyear;\n this.year = hyear;\n\n const rh0 = new HDate(1, months.TISHREI, hyear);\n const rh = (this.rh = rh0.abs());\n const rhDay = rh0.getDay() + 1;\n\n // find the first Saturday on or after Rosh Hashana\n this.firstSaturday = HDate.dayOnOrBefore(6, rh + 6);\n const leap = +HDate.isLeapYear(hyear);\n this.il = Boolean(il);\n\n const type = yearType(hyear);\n let key = `${leap}${rhDay}${type}`;\n if (types[key]) {\n this.theSedraArray = types[key];\n this.yearKey = key;\n } else {\n key = key + +this.il; // cast to num, then concat\n this.theSedraArray = types[key];\n this.yearKey = key;\n }\n\n if (!this.theSedraArray) {\n throw new Error(\n `improper sedra year type ${key} calculated for ${hyear}`\n );\n }\n }\n\n /**\n * Returns the date that a parsha occurs\n * or `null` if the parsha doesn't occur this year\n * @param parsha if a `string`, specified with Sephardic transliterations\n * like `'Noach'` or `'Matot-Masei'`. If an array, must be a 1- or 2-element\n * array such as `['Noach']` or `['Matot', 'Masei']`. If a `number`, should\n * be a 0-based parsha index (`0` for Bereshit, `1` for Noach) or a negative\n * number for a doubled parsha (e.g. `-21` for Vayakhel-Pekudei)\n */\n find(parsha: number | string | string[]): HDate | null {\n if (typeof parsha === 'number') {\n if (parsha >= parshiot.length || (parsha < 0 && !isValidDouble(parsha))) {\n throw new RangeError(`Invalid parsha number: ${parsha}`);\n }\n return this.findInternal(parsha);\n } else if (typeof parsha === 'string') {\n const num = parsha2id.get(parsha);\n if (typeof num === 'number') {\n return this.find(num);\n } else if (parsha.includes('-')) {\n if (parsha === CHMPESACH || parsha === CHMSUKOT) {\n return this.findInternal(parsha);\n }\n return this.find(parsha.split('-'));\n } else {\n // try to find Saturday holiday like 'Yom Kippur'\n return this.findInternal(parsha);\n }\n } else if (Array.isArray(parsha)) {\n const plen = parsha.length;\n if ((plen !== 1 && plen !== 2) || typeof parsha[0] !== 'string') {\n throw new TypeError(\n `Invalid parsha argument: ${JSON.stringify(parsha)}`\n );\n }\n if (plen === 1) {\n return this.find(parsha[0]);\n }\n const p1 = parsha[0];\n const p2 = parsha[1];\n const num1 = parsha2id.get(p1);\n const num2 = parsha2id.get(p2);\n if (\n typeof num1 !== 'number' ||\n typeof num2 !== 'number' ||\n num2 !== num1 + 1 ||\n !isValidDouble(-num1)\n ) {\n throw new RangeError(`Unrecognized parsha name: ${p1}-${p2}`);\n }\n return this.find(-num1);\n }\n return null; /* NOTREACHED */\n }\n\n private findInternal(parsha: NumberOrString): HDate | null {\n const idx = this.theSedraArray.indexOf(parsha);\n if (idx === -1) {\n return null; // doesn't occur this year\n }\n return new HDate(this.firstSaturday + idx * 7);\n }\n\n /**\n * Returns the date that a parsha (or its doubled or undoubled counterpart)\n * occurs, or `null` if the parsha doesn't occur this year\n */\n findContaining(parsha: number | string): HDate | null {\n const hdate = this.find(parsha);\n if (hdate) {\n return hdate;\n }\n if (typeof parsha === 'number') {\n // a valid negative number (double parsha in a year where they are\n // combined) would've been found above, and a invalid negative number\n // would've thrown an error, so this parsha must be a positive number\n // representing either p1 or p2\n const p1 = -parsha;\n if (isValidDouble(p1)) {\n return this.find(p1);\n } else {\n // this must be the second individual parsha of a doubled pair\n // for example 29 for Kedoshim, so check for -28 for Achrei Mot-Kedoshim\n return this.find(p1 + 1);\n }\n } else {\n const num = parsha2id.get(parsha);\n if (num) {\n // parsha is either the first or second individual parsha of\n // a pair that is doubled this year\n const p1 = -num;\n if (isValidDouble(p1)) {\n return this.find(p1);\n } else {\n return this.find(p1 + 1);\n }\n } else {\n // this was indeed a doubled parsha, so return date of the first half\n const [p1] = parsha.split('-');\n return this.find(p1);\n }\n }\n }\n\n /**\n * Returns the underlying annual sedra schedule.\n * Used by `@hebcal/triennial`\n */\n getSedraArray(): readonly NumberOrString[] {\n return this.theSedraArray;\n }\n\n /**\n * R.D. date of the first Saturday on or after Rosh Hashana\n */\n getFirstSaturday(): number {\n return this.firstSaturday;\n }\n\n getYear(): number {\n return this.year;\n }\n\n /**\n * Returns an object describing the parsha on the first Saturday on or after `hd`\n * @param hd Hebrew date or R.D. days\n */\n lookup(hd: HDate | number): SedraResult {\n const abs =\n typeof hd === 'number' ? hd : HDate.isHDate(hd) ? hd.abs() : NaN;\n\n if (isNaN(abs)) {\n throw new TypeError(`Bad date argument: ${hd}`);\n } else if (abs < this.rh) {\n throw new RangeError(\n `Date ${hd} before start of Hebrew year ${this.year}`\n );\n }\n\n // find the first saturday on or after today's date\n const saturday = HDate.dayOnOrBefore(6, abs + 6);\n\n const weekNum = (saturday - this.firstSaturday) / 7;\n const index = this.theSedraArray[weekNum];\n\n if (index === undefined) {\n const sedra = getSedra(this.year + 1, this.il);\n return sedra.lookup(saturday); // must be next year\n }\n const hdate = new HDate(saturday);\n if (typeof index === 'string') {\n // Shabbat has a chag. Return a description\n return {parsha: [index], chag: true, hdate, il: this.il, num: 0};\n }\n if (index >= 0) {\n return {\n parsha: [parshiot[index]],\n chag: false,\n num: index + 1,\n hdate,\n il: this.il,\n };\n }\n\n const p1 = D(index); // undouble the parsha\n return {\n parsha: [parshiot[p1], parshiot[p1 + 1]],\n chag: false,\n num: [p1 + 1, p1 + 2],\n hdate,\n il: this.il,\n };\n }\n}\n\n/**\n * The 54 parshiyot of the Torah as transilterated strings.\n * * parshiot[0] == `Bereshit`\n * * parshiot[1] == `Noach`\n * * parshiot[52] == `Ha'azinu`\n * * parshiot[53] == `Vezot Haberakhah`\n * @readonly\n * @type {string[]}\n */\nexport const parshiot: readonly string[] = [\n 'Bereshit',\n 'Noach',\n 'Lech-Lecha',\n 'Vayera',\n 'Chayei Sara',\n 'Toldot',\n 'Vayetzei',\n 'Vayishlach',\n 'Vayeshev',\n 'Miketz',\n 'Vayigash',\n 'Vayechi',\n 'Shemot',\n 'Vaera',\n 'Bo',\n 'Beshalach',\n 'Yitro',\n 'Mishpatim',\n 'Terumah',\n 'Tetzaveh',\n 'Ki Tisa',\n 'Vayakhel',\n 'Pekudei',\n 'Vayikra',\n 'Tzav',\n 'Shmini',\n 'Tazria',\n 'Metzora',\n 'Achrei Mot',\n 'Kedoshim',\n 'Emor',\n 'Behar',\n 'Bechukotai',\n 'Bamidbar',\n 'Nasso',\n \"Beha'alotcha\",\n \"Sh'lach\",\n 'Korach',\n 'Chukat',\n 'Balak',\n 'Pinchas',\n 'Matot',\n 'Masei',\n 'Devarim',\n 'Vaetchanan',\n 'Eikev',\n \"Re'eh\",\n 'Shoftim',\n 'Ki Teitzei',\n 'Ki Tavo',\n 'Nitzavim',\n 'Vayeilech',\n \"Ha'azinu\",\n 'Vezot Haberakhah',\n] as const;\n\n// 0-based parsha IDs\nconst parsha2id = new Map<string, number>();\nfor (let id = 0; id < parshiot.length; id++) {\n const name = parshiot[id];\n parsha2id.set(name, id);\n}\n\n// 0-based parsha IDs\nconst doubles = new Set([\n 21, // Vayakhel-Pekudei\n 26, // Tazria-Metzora\n 28, // Achrei Mot-Kedoshim\n 31, // Behar-Bechukotai\n 38, // Chukat-Balak\n 41, // Matot-Masei\n 50, // Nitzavim-Vayeilech\n]);\n\n/**\n * @private\n * @param id a negative number\n */\nfunction isValidDouble(id: number): boolean {\n return doubles.has(-id);\n}\n\n/**\n * parsha doubler/undoubler\n * @private\n * @param p\n */\nfunction D(p: number): number {\n return -p;\n}\n\nconst RH = 'Rosh Hashana'; // 0\nconst YK = 'Yom Kippur'; // 1\n\nconst SUKKOT = 'Sukkot'; // 0\nconst CHMSUKOT = 'Sukkot Shabbat Chol ha-Moed'; // 0\nconst SHMINI = 'Shmini Atzeret'; // 0\n\nconst PESACH = 'Pesach'; // 25\nconst PESACH1 = 'Pesach I';\nconst CHMPESACH = 'Pesach Shabbat Chol ha-Moed'; // 25\nconst PESACH7 = 'Pesach VII'; // 25\nconst PESACH8 = 'Pesach VIII';\nconst SHAVUOT = 'Shavuot'; // 33\n\n/**\n * Returns an array from start to end\n * @private\n * @param start beginning number, inclusive\n * @param stop ending number, inclusive\n */\nfunction range(start: number, stop: number): readonly number[] {\n return Array.from({length: stop - start + 1}, (v, k) => k + start);\n}\n\ntype NumberOrString = number | string;\n\nconst yearStartVayeilech: readonly NumberOrString[] = [51, 52, CHMSUKOT];\nconst yearStartHaazinu: readonly NumberOrString[] = [52, YK, CHMSUKOT];\nconst yearStartRH: readonly NumberOrString[] = [RH, 52, SUKKOT, SHMINI];\nconst r020 = range(0, 20);\nconst r027 = range(0, 27);\nconst r3340 = range(33, 40);\nconst r4349 = range(43, 49);\nconst r4350 = range(43, 50);\n\n/**\n * The ordinary year types (keviot)\n * names are leap/nonleap - day - incomplete/regular/complete - diaspora/Israel\n * @private\n * @readonly\n */\nconst types: Record<string, readonly NumberOrString[]> = {\n /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Tuesday. */\n // e.g. 5753\n '020': yearStartVayeilech.concat(\n r020,\n D(21),\n 23,\n 24,\n CHMPESACH,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\n // e.g. 5756\n '0220': yearStartVayeilech.concat(\n r020,\n D(21),\n 23,\n 24,\n CHMPESACH,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n 33,\n SHAVUOT,\n range(34, 37),\n D(38),\n 40,\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\n // e.g. 5701\n '0510': yearStartHaazinu.concat(\n r020,\n D(21),\n 23,\n 24,\n PESACH1,\n PESACH8,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\n // e.g. 5745\n '0511': yearStartHaazinu.concat(\n r020,\n D(21),\n 23,\n 24,\n PESACH,\n 25,\n D(26),\n D(28),\n range(30, 40),\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Thursday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Sunday. */\n // e.g. 5754\n '052': yearStartHaazinu.concat(\n range(0, 24),\n PESACH7,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and Kislev\n * each have 29 days), and has Passover start on Sunday. */\n // e.g. 5761\n '070': yearStartRH.concat(\n r020,\n D(21),\n 23,\n 24,\n PESACH7,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Saturday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Tuesday. */\n // e.g. 5716\n '072': yearStartRH.concat(\n r020,\n D(21),\n 23,\n 24,\n CHMPESACH,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4349,\n D(50)\n ),\n\n /* -- The leap year types (keviot) -- */\n /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Thursday. */\n // e.g. 5746\n '1200': yearStartVayeilech.concat(\n r027,\n CHMPESACH,\n range(28, 33),\n SHAVUOT,\n range(34, 37),\n D(38),\n 40,\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Thursday. */\n // e.g. 5746\n '1201': yearStartVayeilech.concat(\n r027,\n CHMPESACH,\n range(28, 40),\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Saturday. */\n // e.g.5752\n '1220': yearStartVayeilech.concat(\n r027,\n PESACH1,\n PESACH8,\n range(28, 40),\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Saturday. */\n // e.g.5752\n '1221': yearStartVayeilech.concat(r027, PESACH, range(28, 50)),\n\n /* Hebrew year that starts on Thursday, is `incomplete' (Heshvan and\n * Kislev both have 29 days), and has Passover start on Sunday. */\n // e.g. 5768\n '150': yearStartHaazinu.concat(range(0, 28), PESACH7, range(29, 50)),\n\n /* Hebrew year that starts on Thursday, is `complete' (Heshvan and\n * Kislev both have 30 days), and has Passover start on Tuesday. */\n // eg. 5771\n '152': yearStartHaazinu.concat(range(0, 28), CHMPESACH, range(29, 49), D(50)),\n\n /* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Tuesday. */\n // e.g.5757\n '170': yearStartRH.concat(\n r027,\n CHMPESACH,\n range(28, 40),\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Saturday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\n '1720': yearStartRH.concat(\n r027,\n CHMPESACH,\n range(28, 33),\n SHAVUOT,\n range(34, 37),\n D(38),\n 40,\n D(41),\n r4349,\n D(50)\n ),\n} as const;\n\n/* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\ntypes['0221'] = types['020'];\n\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Thursday. */\n// e.g. 5715\ntypes['0310'] = types['0220'];\n\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Thursday. */\ntypes['0311'] = types['020'];\n\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\n// e.g. 5715\ntypes['1310'] = types['1220'];\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\ntypes['1311'] = types['1221'];\n\n/* Hebrew year that starts on Saturday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\ntypes['1721'] = types['170'];\n\nconst sedraCache = new QuickLRU<string, Sedra>({maxSize: 120});\n\n/**\n * Convenience function to create an instance of `Sedra` or reuse a previously\n * created and cached instance.\n * @param hyear\n * @param il\n */\nexport function getSedra(hyear: number, il: boolean): Sedra {\n const cacheKey = `${hyear}-${il ? 1 : 0}`;\n let sedra = sedraCache.get(cacheKey);\n if (!sedra) {\n sedra = new Sedra(hyear, il);\n sedraCache.set(cacheKey, sedra);\n }\n return sedra;\n}\n"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;;;;;;;;;;;AAmBG;AAEH;;;;;;;;;;AAUG;AAKH,MAAM,UAAU,GAAG,CAAC;AACpB,MAAM,OAAO,GAAG,CAAC;AACjB,MAAM,QAAQ,GAAG,CAAC;AAElB,SAAS,QAAQ,CAAC,KAAa,EAAA;IAC7B,MAAM,KAAK,GAAG,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC;IACvC,MAAM,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC;AACvC,IAAA,IAAI,KAAK,IAAI,CAAC,MAAM,EAAE;AACpB,QAAA,OAAO,QAAQ;IACjB;AAAO,SAAA,IAAI,CAAC,KAAK,IAAI,MAAM,EAAE;AAC3B,QAAA,OAAO,UAAU;IACnB;SAAO;AACL,QAAA,OAAO,OAAO;IAChB;AACF;AA6BA;;AAEG;MACU,KAAK,CAAA;AACC,IAAA,IAAI;AACJ,IAAA,EAAE;AACF,IAAA,EAAE;AACF,IAAA,aAAa;AACb,IAAA,aAAa;AACb,IAAA,OAAO;AACxB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Q,EAAE,KAAK,CAAC;IACjC;AACA,IAAA,OAAO,KAAK;AACd;;;;"}
|
|
1
|
+
{"version":3,"file":"sedra.js","sources":["../../../src/sedra.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\n/*\n * Many of the following algorithms were taken from hebrew calendar\n * routines by Maimonedes, from his Mishneh Torah, and implemented by\n * Nachum Dershowitz Department of Computer Science\n * (217) 333-4219 University of Illinois at Urbana-Champaign\n * nachum@cs.uiuedu 1304 West Springfield Avenue\n * Urbana, Illinois 61801\n *\n * The routines were included in the emacs 19 distribution.\n *\n */\nimport {HDate, months} from '@hebcal/hdate';\nimport QuickLRU from 'quick-lru';\nimport './locale'; // Adds Hebrew and Ashkenazic translations\n\nconst INCOMPLETE = 0;\nconst REGULAR = 1;\nconst COMPLETE = 2;\n\nfunction yearType(hyear: number): number {\n const longC = HDate.longCheshvan(hyear);\n const shortK = HDate.shortKislev(hyear);\n if (longC && !shortK) {\n return COMPLETE;\n } else if (!longC && shortK) {\n return INCOMPLETE;\n } else {\n return REGULAR;\n }\n}\n\n/** The result from `Sedra.lookup()` */\nexport type SedraResult = {\n /**\n * Name of the parsha (or parshiyot) read on\n * Hebrew date, e.g. `['Noach']` or `['Matot', 'Masei']`\n */\n parsha: string[];\n /**\n * False if this is a regular parashat HaShavua reading.\n * True if it's a special holiday reading.\n */\n chag: boolean;\n /**\n * The parsha number (or numbers) using 1-indexing.\n * A `number` for a regular (single) parsha, and a `number[]`\n * for a doubled parsha.\n * For Parashat *Bereshit*, `num` would be equal to `1`, and for\n * *Matot-Masei* it would be `[42, 43]`\n * For a chag (holiday) reading, `num` will be `0`.\n */\n num: number | number[];\n /** The date of the Shabbat this parsha is read */\n hdate: HDate;\n /** true if Israel, false for Diaspora */\n il: boolean;\n};\n\n/**\n * Represents the weekly Torah-reading (Parashat HaShavua) schedule for an\n * entire Hebrew year.\n *\n * The schedule depends on the year's *keviyah* — the day of week of Rosh\n * Hashana, whether the year is leap, whether Cheshvan/Kislev are long or\n * short, and whether the schedule is for Israel or the Diaspora (since\n * Israel and the Diaspora diverge in some years when the 8th day of Pesach\n * or the 2nd day of Shavuot fall on Shabbat).\n *\n * Prefer {@link getSedra} (or {@link HebrewCalendar.getSedra}) over\n * calling this constructor directly, since both cache their results.\n *\n * @example\n * import {Sedra, HDate, months} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * const result = sedra.lookup(new HDate(15, months.CHESHVAN, 5784));\n * console.log(result.parsha); // ['Lech-Lecha']\n */\nexport class Sedra {\n private readonly year: number;\n private readonly il: boolean;\n private readonly rh: number;\n private readonly firstSaturday: number;\n private readonly theSedraArray: readonly NumberOrString[];\n private readonly yearKey: string;\n /**\n * Calculates the Parashat HaShavua schedule for an entire Hebrew year.\n * @param hyear - Hebrew year (e.g. 5749)\n * @param il - Use Israel sedra schedule (false for Diaspora)\n */\n constructor(hyear: number, il: boolean) {\n hyear = +hyear;\n this.year = hyear;\n\n const rh0 = new HDate(1, months.TISHREI, hyear);\n const rh = (this.rh = rh0.abs());\n const rhDay = rh0.getDay() + 1;\n\n // find the first Saturday on or after Rosh Hashana\n this.firstSaturday = HDate.dayOnOrBefore(6, rh + 6);\n const leap = +HDate.isLeapYear(hyear);\n this.il = Boolean(il);\n\n const type = yearType(hyear);\n let key = `${leap}${rhDay}${type}`;\n if (types[key]) {\n this.theSedraArray = types[key];\n this.yearKey = key;\n } else {\n key = key + +this.il; // cast to num, then concat\n this.theSedraArray = types[key];\n this.yearKey = key;\n }\n\n if (!this.theSedraArray) {\n throw new Error(\n `improper sedra year type ${key} calculated for ${hyear}`\n );\n }\n }\n\n /**\n * Returns the date a parsha is read this year, or `null` if it does not\n * occur in this year's schedule.\n *\n * A doubled parsha (e.g. `'Matot-Masei'`) will only return a date in years\n * where that pair is actually read together; in years where they are read\n * separately, this returns `null`. Use {@link findContaining} to find the\n * date a parsha is read regardless of whether it is doubled.\n *\n * Throws `RangeError` for an out-of-range numeric input or an invalid\n * doubled-parsha pair, and `TypeError` for a malformed array argument.\n * @example\n * import {Sedra} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * sedra.find('Noach')?.toString(); // '15 Cheshvan 5784'\n * sedra.find(1)?.toString(); // same, by 0-based index\n * sedra.find('Matot-Masei')?.toString(); // null in 5784 — read separately\n * sedra.find(['Matot', 'Masei']); // also null in 5784\n * @param parsha if a `string`, specified with Sephardic transliterations\n * like `'Noach'` or `'Matot-Masei'`. If an array, must be a 1- or 2-element\n * array such as `['Noach']` or `['Matot', 'Masei']`. If a `number`, should\n * be a 0-based parsha index (`0` for Bereshit, `1` for Noach) or a negative\n * number for a doubled parsha (e.g. `-21` for Vayakhel-Pekudei)\n */\n find(parsha: number | string | string[]): HDate | null {\n if (typeof parsha === 'number') {\n if (parsha >= parshiot.length || (parsha < 0 && !isValidDouble(parsha))) {\n throw new RangeError(`Invalid parsha number: ${parsha}`);\n }\n return this.findInternal(parsha);\n } else if (typeof parsha === 'string') {\n const num = parsha2id.get(parsha);\n if (typeof num === 'number') {\n return this.find(num);\n } else if (parsha.includes('-')) {\n if (parsha === CHMPESACH || parsha === CHMSUKOT) {\n return this.findInternal(parsha);\n }\n return this.find(parsha.split('-'));\n } else {\n // try to find Saturday holiday like 'Yom Kippur'\n return this.findInternal(parsha);\n }\n } else if (Array.isArray(parsha)) {\n const plen = parsha.length;\n if ((plen !== 1 && plen !== 2) || typeof parsha[0] !== 'string') {\n throw new TypeError(\n `Invalid parsha argument: ${JSON.stringify(parsha)}`\n );\n }\n if (plen === 1) {\n return this.find(parsha[0]);\n }\n const p1 = parsha[0];\n const p2 = parsha[1];\n const num1 = parsha2id.get(p1);\n const num2 = parsha2id.get(p2);\n if (\n typeof num1 !== 'number' ||\n typeof num2 !== 'number' ||\n num2 !== num1 + 1 ||\n !isValidDouble(-num1)\n ) {\n throw new RangeError(`Unrecognized parsha name: ${p1}-${p2}`);\n }\n return this.find(-num1);\n }\n return null; /* NOTREACHED */\n }\n\n private findInternal(parsha: NumberOrString): HDate | null {\n const idx = this.theSedraArray.indexOf(parsha);\n if (idx === -1) {\n return null; // doesn't occur this year\n }\n return new HDate(this.firstSaturday + idx * 7);\n }\n\n /**\n * Returns the date a parsha is read this year, looking through both\n * single and doubled forms.\n *\n * For example, if `'Matot'` is read individually this year, this returns\n * its date; if it is read as part of `'Matot-Masei'` this year, this\n * returns the date of `'Matot-Masei'` (and similarly for `'Masei'`).\n * Conversely, asking for `'Matot-Masei'` in a year where they are split\n * will return the date of `'Matot'` alone.\n * @example\n * import {Sedra} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * // Matot-Masei is split in 5784; both individual halves resolve:\n * sedra.findContaining('Matot')?.toString(); // '22 Tamuz 5784'\n * sedra.findContaining('Masei')?.toString(); // '29 Tamuz 5784'\n * // Asking for the doubled name returns the date of the first half:\n * sedra.findContaining('Matot-Masei')?.toString(); // '22 Tamuz 5784'\n */\n findContaining(parsha: number | string): HDate | null {\n const hdate = this.find(parsha);\n if (hdate) {\n return hdate;\n }\n if (typeof parsha === 'number') {\n // a valid negative number (double parsha in a year where they are\n // combined) would've been found above, and a invalid negative number\n // would've thrown an error, so this parsha must be a positive number\n // representing either p1 or p2\n const p1 = -parsha;\n if (isValidDouble(p1)) {\n return this.find(p1);\n } else {\n // this must be the second individual parsha of a doubled pair\n // for example 29 for Kedoshim, so check for -28 for Achrei Mot-Kedoshim\n return this.find(p1 + 1);\n }\n } else {\n const num = parsha2id.get(parsha);\n if (num) {\n // parsha is either the first or second individual parsha of\n // a pair that is doubled this year\n const p1 = -num;\n if (isValidDouble(p1)) {\n return this.find(p1);\n } else {\n return this.find(p1 + 1);\n }\n } else {\n // this was indeed a doubled parsha, so return date of the first half\n const [p1] = parsha.split('-');\n return this.find(p1);\n }\n }\n }\n\n /**\n * Returns the underlying annual reading schedule as an array, where each\n * entry corresponds to one Saturday (starting from the first Shabbat on\n * or after Rosh Hashana). Entries are either:\n * - a non-negative `number`: a 0-based parsha index (e.g. `0` for\n * *Bereshit*)\n * - a negative `number`: the negated first index of a doubled parsha\n * (e.g. `-21` for *Vayakhel-Pekudei*)\n * - a `string`: a holiday name when a Yom Tov displaces the weekly reading\n * (e.g. `'Pesach Shabbat Chol ha-Moed'`, `'Yom Kippur'`)\n *\n * Used by `@hebcal/triennial`.\n */\n getSedraArray(): readonly NumberOrString[] {\n return this.theSedraArray;\n }\n\n /**\n * Returns the R.D. (Rata Die / Fixed Date) absolute day number of the\n * first Saturday on or after Rosh Hashana of this year. This is the\n * anchor point for {@link getSedraArray} — index `0` of that array\n * corresponds to this date.\n */\n getFirstSaturday(): number {\n return this.firstSaturday;\n }\n\n /** Returns the Hebrew year this `Sedra` instance covers. */\n getYear(): number {\n return this.year;\n }\n\n /**\n * Returns details about the parsha read on the first Saturday on or after\n * `hd`. If `hd` is itself a Saturday, the reading for that date is\n * returned; otherwise the reading for the upcoming Saturday is returned.\n *\n * If the given date falls in the final days of the Hebrew year (after\n * the last reading of this year's schedule), this method transparently\n * delegates to the next year's `Sedra`.\n * @example\n * import {Sedra, HDate, months} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * // A weekday — returns the upcoming Shabbat's reading\n * const result = sedra.lookup(new HDate(13, months.CHESHVAN, 5784));\n * console.log(result.parsha); // ['Lech-Lecha']\n * console.log(result.chag); // false\n * console.log(result.hdate.toString()); // '15 Cheshvan 5784' (Saturday)\n * @param hd Hebrew date or R.D. days\n */\n lookup(hd: HDate | number): SedraResult {\n const abs =\n typeof hd === 'number' ? hd : HDate.isHDate(hd) ? hd.abs() : NaN;\n\n if (isNaN(abs)) {\n throw new TypeError(`Bad date argument: ${hd}`);\n } else if (abs < this.rh) {\n throw new RangeError(\n `Date ${hd} before start of Hebrew year ${this.year}`\n );\n }\n\n // find the first saturday on or after today's date\n const saturday = HDate.dayOnOrBefore(6, abs + 6);\n\n const weekNum = (saturday - this.firstSaturday) / 7;\n const index = this.theSedraArray[weekNum];\n\n if (index === undefined) {\n const sedra = getSedra(this.year + 1, this.il);\n return sedra.lookup(saturday); // must be next year\n }\n const hdate = new HDate(saturday);\n if (typeof index === 'string') {\n // Shabbat has a chag. Return a description\n return {parsha: [index], chag: true, hdate, il: this.il, num: 0};\n }\n if (index >= 0) {\n return {\n parsha: [parshiot[index]],\n chag: false,\n num: index + 1,\n hdate,\n il: this.il,\n };\n }\n\n const p1 = D(index); // undouble the parsha\n return {\n parsha: [parshiot[p1], parshiot[p1 + 1]],\n chag: false,\n num: [p1 + 1, p1 + 2],\n hdate,\n il: this.il,\n };\n }\n}\n\n/**\n * The 54 parshiyot of the Torah as transilterated strings.\n * * parshiot[0] == `Bereshit`\n * * parshiot[1] == `Noach`\n * * parshiot[52] == `Ha'azinu`\n * * parshiot[53] == `Vezot Haberakhah`\n * @readonly\n * @type {string[]}\n */\nexport const parshiot: readonly string[] = [\n 'Bereshit',\n 'Noach',\n 'Lech-Lecha',\n 'Vayera',\n 'Chayei Sara',\n 'Toldot',\n 'Vayetzei',\n 'Vayishlach',\n 'Vayeshev',\n 'Miketz',\n 'Vayigash',\n 'Vayechi',\n 'Shemot',\n 'Vaera',\n 'Bo',\n 'Beshalach',\n 'Yitro',\n 'Mishpatim',\n 'Terumah',\n 'Tetzaveh',\n 'Ki Tisa',\n 'Vayakhel',\n 'Pekudei',\n 'Vayikra',\n 'Tzav',\n 'Shmini',\n 'Tazria',\n 'Metzora',\n 'Achrei Mot',\n 'Kedoshim',\n 'Emor',\n 'Behar',\n 'Bechukotai',\n 'Bamidbar',\n 'Nasso',\n \"Beha'alotcha\",\n \"Sh'lach\",\n 'Korach',\n 'Chukat',\n 'Balak',\n 'Pinchas',\n 'Matot',\n 'Masei',\n 'Devarim',\n 'Vaetchanan',\n 'Eikev',\n \"Re'eh\",\n 'Shoftim',\n 'Ki Teitzei',\n 'Ki Tavo',\n 'Nitzavim',\n 'Vayeilech',\n \"Ha'azinu\",\n 'Vezot Haberakhah',\n] as const;\n\n// 0-based parsha IDs\nconst parsha2id = new Map<string, number>();\nfor (let id = 0; id < parshiot.length; id++) {\n const name = parshiot[id];\n parsha2id.set(name, id);\n}\n\n// 0-based parsha IDs\nconst doubles = new Set([\n 21, // Vayakhel-Pekudei\n 26, // Tazria-Metzora\n 28, // Achrei Mot-Kedoshim\n 31, // Behar-Bechukotai\n 38, // Chukat-Balak\n 41, // Matot-Masei\n 50, // Nitzavim-Vayeilech\n]);\n\n/**\n * @private\n * @param id a negative number\n */\nfunction isValidDouble(id: number): boolean {\n return doubles.has(-id);\n}\n\n/**\n * parsha doubler/undoubler\n * @private\n * @param p\n */\nfunction D(p: number): number {\n return -p;\n}\n\nconst RH = 'Rosh Hashana'; // 0\nconst YK = 'Yom Kippur'; // 1\n\nconst SUKKOT = 'Sukkot'; // 0\nconst CHMSUKOT = 'Sukkot Shabbat Chol ha-Moed'; // 0\nconst SHMINI = 'Shmini Atzeret'; // 0\n\nconst PESACH = 'Pesach'; // 25\nconst PESACH1 = 'Pesach I';\nconst CHMPESACH = 'Pesach Shabbat Chol ha-Moed'; // 25\nconst PESACH7 = 'Pesach VII'; // 25\nconst PESACH8 = 'Pesach VIII';\nconst SHAVUOT = 'Shavuot'; // 33\n\n/**\n * Returns an array from start to end\n * @private\n * @param start beginning number, inclusive\n * @param stop ending number, inclusive\n */\nfunction range(start: number, stop: number): readonly number[] {\n return Array.from({length: stop - start + 1}, (v, k) => k + start);\n}\n\ntype NumberOrString = number | string;\n\nconst yearStartVayeilech: readonly NumberOrString[] = [51, 52, CHMSUKOT];\nconst yearStartHaazinu: readonly NumberOrString[] = [52, YK, CHMSUKOT];\nconst yearStartRH: readonly NumberOrString[] = [RH, 52, SUKKOT, SHMINI];\nconst r020 = range(0, 20);\nconst r027 = range(0, 27);\nconst r3340 = range(33, 40);\nconst r4349 = range(43, 49);\nconst r4350 = range(43, 50);\n\n/**\n * The ordinary year types (keviot)\n * names are leap/nonleap - day - incomplete/regular/complete - diaspora/Israel\n * @private\n * @readonly\n */\nconst types: Record<string, readonly NumberOrString[]> = {\n /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Tuesday. */\n // e.g. 5753\n '020': yearStartVayeilech.concat(\n r020,\n D(21),\n 23,\n 24,\n CHMPESACH,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\n // e.g. 5756\n '0220': yearStartVayeilech.concat(\n r020,\n D(21),\n 23,\n 24,\n CHMPESACH,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n 33,\n SHAVUOT,\n range(34, 37),\n D(38),\n 40,\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\n // e.g. 5701\n '0510': yearStartHaazinu.concat(\n r020,\n D(21),\n 23,\n 24,\n PESACH1,\n PESACH8,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\n // e.g. 5745\n '0511': yearStartHaazinu.concat(\n r020,\n D(21),\n 23,\n 24,\n PESACH,\n 25,\n D(26),\n D(28),\n range(30, 40),\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Thursday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Sunday. */\n // e.g. 5754\n '052': yearStartHaazinu.concat(\n range(0, 24),\n PESACH7,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and Kislev\n * each have 29 days), and has Passover start on Sunday. */\n // e.g. 5761\n '070': yearStartRH.concat(\n r020,\n D(21),\n 23,\n 24,\n PESACH7,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Saturday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Tuesday. */\n // e.g. 5716\n '072': yearStartRH.concat(\n r020,\n D(21),\n 23,\n 24,\n CHMPESACH,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4349,\n D(50)\n ),\n\n /* -- The leap year types (keviot) -- */\n /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Thursday. */\n // e.g. 5746\n '1200': yearStartVayeilech.concat(\n r027,\n CHMPESACH,\n range(28, 33),\n SHAVUOT,\n range(34, 37),\n D(38),\n 40,\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Thursday. */\n // e.g. 5746\n '1201': yearStartVayeilech.concat(\n r027,\n CHMPESACH,\n range(28, 40),\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Saturday. */\n // e.g.5752\n '1220': yearStartVayeilech.concat(\n r027,\n PESACH1,\n PESACH8,\n range(28, 40),\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Saturday. */\n // e.g.5752\n '1221': yearStartVayeilech.concat(r027, PESACH, range(28, 50)),\n\n /* Hebrew year that starts on Thursday, is `incomplete' (Heshvan and\n * Kislev both have 29 days), and has Passover start on Sunday. */\n // e.g. 5768\n '150': yearStartHaazinu.concat(range(0, 28), PESACH7, range(29, 50)),\n\n /* Hebrew year that starts on Thursday, is `complete' (Heshvan and\n * Kislev both have 30 days), and has Passover start on Tuesday. */\n // eg. 5771\n '152': yearStartHaazinu.concat(range(0, 28), CHMPESACH, range(29, 49), D(50)),\n\n /* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Tuesday. */\n // e.g.5757\n '170': yearStartRH.concat(\n r027,\n CHMPESACH,\n range(28, 40),\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Saturday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\n '1720': yearStartRH.concat(\n r027,\n CHMPESACH,\n range(28, 33),\n SHAVUOT,\n range(34, 37),\n D(38),\n 40,\n D(41),\n r4349,\n D(50)\n ),\n} as const;\n\n/* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\ntypes['0221'] = types['020'];\n\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Thursday. */\n// e.g. 5715\ntypes['0310'] = types['0220'];\n\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Thursday. */\ntypes['0311'] = types['020'];\n\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\n// e.g. 5715\ntypes['1310'] = types['1220'];\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\ntypes['1311'] = types['1221'];\n\n/* Hebrew year that starts on Saturday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\ntypes['1721'] = types['170'];\n\nconst sedraCache = new QuickLRU<string, Sedra>({maxSize: 120});\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 and schedule.\n *\n * Prefer this over `new Sedra(...)` when calling repeatedly — an internal\n * LRU cache (~120 entries) avoids recomputing the keviyah-specific schedule.\n * @example\n * import {getSedra, HDate, months} from '@hebcal/core';\n * const sedra = getSedra(5784, false);\n * const {parsha} = sedra.lookup(new HDate(15, months.CHESHVAN, 5784));\n * console.log(parsha); // ['Lech-Lecha']\n * @param hyear Hebrew year\n * @param il Use Israel sedra schedule (`false` for Diaspora)\n */\nexport function getSedra(hyear: number, il: boolean): Sedra {\n const cacheKey = `${hyear}-${il ? 1 : 0}`;\n let sedra = sedraCache.get(cacheKey);\n if (!sedra) {\n sedra = new Sedra(hyear, il);\n sedraCache.set(cacheKey, sedra);\n }\n return sedra;\n}\n"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;;;;;;;;;;;AAmBG;AAEH;;;;;;;;;;AAUG;AAKH,MAAM,UAAU,GAAG,CAAC;AACpB,MAAM,OAAO,GAAG,CAAC;AACjB,MAAM,QAAQ,GAAG,CAAC;AAElB,SAAS,QAAQ,CAAC,KAAa,EAAA;IAC7B,MAAM,KAAK,GAAG,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC;IACvC,MAAM,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC;AACvC,IAAA,IAAI,KAAK,IAAI,CAAC,MAAM,EAAE;AACpB,QAAA,OAAO,QAAQ;IACjB;AAAO,SAAA,IAAI,CAAC,KAAK,IAAI,MAAM,EAAE;AAC3B,QAAA,OAAO,UAAU;IACnB;SAAO;AACL,QAAA,OAAO,OAAO;IAChB;AACF;AA6BA;;;;;;;;;;;;;;;;;;AAkBG;MACU,KAAK,CAAA;AACC,IAAA,IAAI;AACJ,IAAA,EAAE;AACF,IAAA,EAAE;AACF,IAAA,aAAa;AACb,IAAA,aAAa;AACb,IAAA,OAAO;AACxB;;;;AAIG;IACH,WAA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K,EAAE,EAAE,CAAC;AAC5B,QAAA,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC;IACjC;AACA,IAAA,OAAO,KAAK;AACd;;;;"}
|
package/dist/esm/sefira.json.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v6.5.
|
|
1
|
+
/*! @hebcal/core v6.5.3, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
const ps67lines=["אֱלֹהִים יְחָנֵּנוּ וִיבָרְכֵנוּ יָאֵר־פָּנָיו אִתָּנוּ סֶלָה","לָדַעַת בָּאָרֶץ דַּרְכֶּךָ בְּכָל־גּוֹיִם יְשׁוּעָתֶךָ","יוֹדוּךָ עַמִּים אֱלֹהִים יוֹדוּךָ עַמִּים כֻּלָּם","יִשְׂמְחוּ וִירַנְּנוּ לְאֻמִּים כִּי־תִשְׁפֹּט עַמִּים מִישׁוֹר וּלְאֻמִּים בָּאָרֶץ תַּנחֵם סֶלָה","יוֹדוּךָ עַמִּים אֱלֹהִים יוֹדוּךָ עַמִּים כֻּלָּם","אֶרֶץ נָתְנָה יְבוּלָהּ יְבָרְכֵנוּ אֱלֹהִים אֱלֹהֵינוּ","יְבָרְכֵנוּ אֱלֹהִים וְיִירְאוּ אוֹתוֹ כָּל־אַפְסֵי־אָרֶץ"];const lamnatzeachLetters="ישמחווירננולאמיםכיתשפוטעמיםמישורולאמיםבארץתנחםסלה";const anaBekoach=["אָנָּא","בְּכֹחַ","גְּדֻלַּת","יְמִינְךָ","תַּתִּיר","צְרוּרָה","אב״ג ית״ץ","קַבֵּל","רִנַּת","עַמְּךָ","שַׂגְּבֵנוּ","טַהֲרֵנוּ","נוֹרָא","קר״ע שט״ן","נָא","גִבּוֹר","דּוֹרְשֵׁי","יִחוּדְךָ","כְּבָבַת","שָׁמְרֵם","נג״ד יכ״ש","בָּרְכֵם","טַהֲרֵם","רַחֲמֵי","צִדְקָתְךָ","תָּמִיד","גָּמְלֵם","בט״ר צת״ג","חֲסִין","קָדוֹשׁ","בְּרֹב","טוּבְךָ","נַהֵל","עֲדָתֶךָ","חק״ב תנ״ע","יָחִיד","גֵּאֶה","לְעַמְּךָ","פְּנֵה","זוֹכְרֵי","קְדֻשָּׁתֶךָ","יג״ל פז״ק","שַׁוְעָתֵנוּ","קַבֵּל","וּשְׁמַע","צַעֲקָתֵנוּ","יוֹדֵעַ","תַּעֲלוּמוֹת","שק״ו צי״ת"];var sefira = {ps67lines:ps67lines,lamnatzeachLetters:lamnatzeachLetters,anaBekoach:anaBekoach};
|
|
3
3
|
|
|
4
4
|
export { anaBekoach, sefira as default, lamnatzeachLetters, ps67lines };
|
package/dist/esm/tachanun.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v6.5.
|
|
1
|
+
/*! @hebcal/core v6.5.3, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
import { HDate, months } from '@hebcal/hdate';
|
|
3
3
|
import { dateYomHaZikaron } from './modern.js';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v6.5.
|
|
1
|
+
/*! @hebcal/core v6.5.3, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
import { Temporal } from 'temporal-polyfill';
|
|
3
3
|
|
|
4
4
|
/// <reference types="temporal-polyfill/global" />
|
package/dist/esm/zmanim.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v6.5.
|
|
1
|
+
/*! @hebcal/core v6.5.3, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
import './temporal-shim.js';
|
|
3
3
|
import { NOAACalculator } from '@hebcal/noaa';
|
|
4
4
|
import { HDate, isDate, getTimezoneOffset, pad2, getPseudoISO } from '@hebcal/hdate';
|
package/dist/src/CalOptions.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export type CalOptions = {
|
|
|
22
22
|
*/
|
|
23
23
|
month?: number | string;
|
|
24
24
|
/**
|
|
25
|
-
* generate calendar for multiple years (default 1)
|
|
25
|
+
* generate calendar for multiple years (default 1, maximum 2000)
|
|
26
26
|
*/
|
|
27
27
|
numYears?: number;
|
|
28
28
|
/**
|
|
@@ -50,8 +50,7 @@ export type CalOptions = {
|
|
|
50
50
|
havdalahMins?: number;
|
|
51
51
|
/**
|
|
52
52
|
* degrees for solar depression for Havdalah.
|
|
53
|
-
* Default is 8.5 degrees for 3 small stars. use 7.083 degrees for 3 medium-sized stars
|
|
54
|
-
* (observed by Dr. Baruch (Berthold) Cohn in his luach published in France in 1899).
|
|
53
|
+
* Default is 8.5 degrees for 3 small stars. use 7.083 degrees for 3 medium-sized stars.
|
|
55
54
|
* If `0`, Havdalah times are suppressed.
|
|
56
55
|
*/
|
|
57
56
|
havdalahDeg?: number;
|
|
@@ -70,7 +69,7 @@ export type CalOptions = {
|
|
|
70
69
|
*/
|
|
71
70
|
useElevation?: boolean;
|
|
72
71
|
/**
|
|
73
|
-
* calculate
|
|
72
|
+
* calculate Parashat HaShavua on Saturdays
|
|
74
73
|
*/
|
|
75
74
|
sedrot?: boolean;
|
|
76
75
|
/**
|
|
@@ -1,32 +1,69 @@
|
|
|
1
1
|
import { HDate } from '@hebcal/hdate';
|
|
2
2
|
import { Event } from './event';
|
|
3
3
|
/**
|
|
4
|
-
* Plug-
|
|
4
|
+
* Plug-in registry for daily learning calendars such as Daf Yomi (Bavli),
|
|
5
|
+
* Yerushalmi Yomi, Mishna Yomi, Nach Yomi, etc.
|
|
5
6
|
*
|
|
6
|
-
*
|
|
7
|
+
* `@hebcal/core` itself contains no learning schedules — they are provided
|
|
8
|
+
* by the {@link https://github.com/hebcal/hebcal-learning @hebcal/learning}
|
|
9
|
+
* package, which calls {@link DailyLearning.addCalendar} on import. After
|
|
10
|
+
* `@hebcal/learning` is loaded, `HebrewCalendar.calendar()` will emit
|
|
11
|
+
* learning events when the corresponding `options.dailyLearning` flag is set.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* import '@hebcal/learning';
|
|
15
|
+
* import {DailyLearning, HDate} from '@hebcal/core';
|
|
16
|
+
*
|
|
17
|
+
* const ev = DailyLearning.lookup('dafYomi', new HDate(), false);
|
|
18
|
+
* console.log(ev?.render('en')); // e.g. 'Berakhot 2'
|
|
7
19
|
*/
|
|
8
20
|
export declare class DailyLearning {
|
|
9
21
|
/**
|
|
10
|
-
*
|
|
22
|
+
* Registers a new learning calendar.
|
|
23
|
+
*
|
|
24
|
+
* The provided function is called whenever a caller asks for an event
|
|
25
|
+
* from this calendar; if no learning occurs that day (e.g. the date is
|
|
26
|
+
* before the cycle's start) it should return `null`.
|
|
27
|
+
* @example
|
|
28
|
+
* DailyLearning.addCalendar(
|
|
29
|
+
* 'myCalendar',
|
|
30
|
+
* (hd, il) => new Event(hd, 'Today\'s learning', 0),
|
|
31
|
+
* new HDate(1, 'Tishrei', 5780),
|
|
32
|
+
* );
|
|
11
33
|
* @param name case insensitive
|
|
12
34
|
* @param calendar a function that returns an `Event` or `null`
|
|
13
35
|
* @param startDate the first date for which this calendar is valid
|
|
14
36
|
*/
|
|
15
37
|
static addCalendar(name: string, calendar: (hd: HDate, il: boolean) => Event | null, startDate?: HDate): void;
|
|
16
38
|
/**
|
|
17
|
-
* Returns
|
|
18
|
-
* is no learning
|
|
39
|
+
* Returns the learning event for the given date from the named calendar,
|
|
40
|
+
* or `null` if there is no learning that day (or the named calendar is
|
|
41
|
+
* not registered).
|
|
42
|
+
* @example
|
|
43
|
+
* import '@hebcal/learning';
|
|
44
|
+
* import {DailyLearning, HDate} from '@hebcal/core';
|
|
45
|
+
* DailyLearning.lookup('dafYomi', new HDate(2024, 1, 15), false);
|
|
19
46
|
* @param name case insensitive
|
|
20
47
|
* @param hd Hebrew Date
|
|
21
48
|
* @param il true for Israel, false for Diaspora
|
|
22
49
|
*/
|
|
23
50
|
static lookup(name: string, hd: HDate, il: boolean): Event | null;
|
|
51
|
+
/**
|
|
52
|
+
* Returns the first Hebrew date for which the named learning calendar
|
|
53
|
+
* is valid (as registered by {@link addCalendar}), or `undefined` if the
|
|
54
|
+
* calendar was not registered with a start date or is not registered at all.
|
|
55
|
+
* @param name case insensitive
|
|
56
|
+
*/
|
|
24
57
|
static getStartDate(name: string): HDate | undefined;
|
|
25
58
|
/**
|
|
26
|
-
*
|
|
59
|
+
* Returns `true` if a learning calendar with the given name has been
|
|
60
|
+
* registered via {@link addCalendar}.
|
|
27
61
|
* @param name case insensitive
|
|
28
62
|
*/
|
|
29
63
|
static has(name: string): boolean;
|
|
30
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* Returns the (lower-cased) names of all currently-registered learning
|
|
66
|
+
* calendars.
|
|
67
|
+
*/
|
|
31
68
|
static getCalendars(): string[];
|
|
32
69
|
}
|
|
@@ -1,12 +1,34 @@
|
|
|
1
1
|
const cals = new Map();
|
|
2
2
|
/**
|
|
3
|
-
* Plug-
|
|
3
|
+
* Plug-in registry for daily learning calendars such as Daf Yomi (Bavli),
|
|
4
|
+
* Yerushalmi Yomi, Mishna Yomi, Nach Yomi, etc.
|
|
4
5
|
*
|
|
5
|
-
*
|
|
6
|
+
* `@hebcal/core` itself contains no learning schedules — they are provided
|
|
7
|
+
* by the {@link https://github.com/hebcal/hebcal-learning @hebcal/learning}
|
|
8
|
+
* package, which calls {@link DailyLearning.addCalendar} on import. After
|
|
9
|
+
* `@hebcal/learning` is loaded, `HebrewCalendar.calendar()` will emit
|
|
10
|
+
* learning events when the corresponding `options.dailyLearning` flag is set.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* import '@hebcal/learning';
|
|
14
|
+
* import {DailyLearning, HDate} from '@hebcal/core';
|
|
15
|
+
*
|
|
16
|
+
* const ev = DailyLearning.lookup('dafYomi', new HDate(), false);
|
|
17
|
+
* console.log(ev?.render('en')); // e.g. 'Berakhot 2'
|
|
6
18
|
*/
|
|
7
19
|
export class DailyLearning {
|
|
8
20
|
/**
|
|
9
|
-
*
|
|
21
|
+
* Registers a new learning calendar.
|
|
22
|
+
*
|
|
23
|
+
* The provided function is called whenever a caller asks for an event
|
|
24
|
+
* from this calendar; if no learning occurs that day (e.g. the date is
|
|
25
|
+
* before the cycle's start) it should return `null`.
|
|
26
|
+
* @example
|
|
27
|
+
* DailyLearning.addCalendar(
|
|
28
|
+
* 'myCalendar',
|
|
29
|
+
* (hd, il) => new Event(hd, 'Today\'s learning', 0),
|
|
30
|
+
* new HDate(1, 'Tishrei', 5780),
|
|
31
|
+
* );
|
|
10
32
|
* @param name case insensitive
|
|
11
33
|
* @param calendar a function that returns an `Event` or `null`
|
|
12
34
|
* @param startDate the first date for which this calendar is valid
|
|
@@ -21,8 +43,13 @@ export class DailyLearning {
|
|
|
21
43
|
});
|
|
22
44
|
}
|
|
23
45
|
/**
|
|
24
|
-
* Returns
|
|
25
|
-
* is no learning
|
|
46
|
+
* Returns the learning event for the given date from the named calendar,
|
|
47
|
+
* or `null` if there is no learning that day (or the named calendar is
|
|
48
|
+
* not registered).
|
|
49
|
+
* @example
|
|
50
|
+
* import '@hebcal/learning';
|
|
51
|
+
* import {DailyLearning, HDate} from '@hebcal/core';
|
|
52
|
+
* DailyLearning.lookup('dafYomi', new HDate(2024, 1, 15), false);
|
|
26
53
|
* @param name case insensitive
|
|
27
54
|
* @param hd Hebrew Date
|
|
28
55
|
* @param il true for Israel, false for Diaspora
|
|
@@ -34,6 +61,12 @@ export class DailyLearning {
|
|
|
34
61
|
}
|
|
35
62
|
return null;
|
|
36
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Returns the first Hebrew date for which the named learning calendar
|
|
66
|
+
* is valid (as registered by {@link addCalendar}), or `undefined` if the
|
|
67
|
+
* calendar was not registered with a start date or is not registered at all.
|
|
68
|
+
* @param name case insensitive
|
|
69
|
+
*/
|
|
37
70
|
static getStartDate(name) {
|
|
38
71
|
const cal = cals.get(name.toLowerCase());
|
|
39
72
|
if (typeof cal === 'object') {
|
|
@@ -42,13 +75,17 @@ export class DailyLearning {
|
|
|
42
75
|
return undefined;
|
|
43
76
|
}
|
|
44
77
|
/**
|
|
45
|
-
*
|
|
78
|
+
* Returns `true` if a learning calendar with the given name has been
|
|
79
|
+
* registered via {@link addCalendar}.
|
|
46
80
|
* @param name case insensitive
|
|
47
81
|
*/
|
|
48
82
|
static has(name) {
|
|
49
83
|
return cals.has(name.toLowerCase());
|
|
50
84
|
}
|
|
51
|
-
/**
|
|
85
|
+
/**
|
|
86
|
+
* Returns the (lower-cased) names of all currently-registered learning
|
|
87
|
+
* calendars.
|
|
88
|
+
*/
|
|
52
89
|
static getCalendars() {
|
|
53
90
|
return Array.from(cals.keys());
|
|
54
91
|
}
|
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
import { HDate } from '@hebcal/hdate';
|
|
2
2
|
import { Event } from './event';
|
|
3
3
|
import './locale';
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Represents a built-in holiday like Pesach, Purim or Tu BiShvat.
|
|
6
|
+
*
|
|
7
|
+
* Most holiday-related events emitted by {@link HebrewCalendar.calendar}
|
|
8
|
+
* are instances of `HolidayEvent` or one of its subclasses
|
|
9
|
+
* ({@link ChanukahEvent}, {@link AsaraBTevetEvent},
|
|
10
|
+
* {@link RoshHashanaEvent}, {@link RoshChodeshEvent}).
|
|
11
|
+
*
|
|
12
|
+
* Adds two notable behaviors over the base {@link Event}:
|
|
13
|
+
*
|
|
14
|
+
* - {@link HolidayEvent.basename} strips qualifiers like `Erev `, ` I`/`II`,
|
|
15
|
+
* `(CH''M)`, `(observed)`, candle counts, etc. (e.g. `"Erev Pesach"` →
|
|
16
|
+
* `"Pesach"`).
|
|
17
|
+
* - {@link HolidayEvent.url} returns a `https://www.hebcal.com/holidays/...`
|
|
18
|
+
* link for the holiday.
|
|
19
|
+
*/
|
|
5
20
|
export declare class HolidayEvent extends Event {
|
|
6
21
|
/** During Sukkot or Pesach */
|
|
7
22
|
cholHaMoedDay?: number;
|
|
@@ -12,7 +27,25 @@ export declare class HolidayEvent extends Event {
|
|
|
12
27
|
*/
|
|
13
28
|
observed?: boolean;
|
|
14
29
|
constructor(date: HDate, desc: string, mask?: number, attrs?: object);
|
|
30
|
+
/**
|
|
31
|
+
* Returns a simplified (untranslated) name for this holiday, stripping
|
|
32
|
+
* qualifiers so that related events group under one name.
|
|
33
|
+
*
|
|
34
|
+
* Strips trailing 4-digit years, `(CH''M)`, `(observed)`, `(Hoshana Raba)`,
|
|
35
|
+
* Roman-numeral day numbers (` I`, ` II`, ...), Chanukah candle counts,
|
|
36
|
+
* `: 8th Day`, and a leading `"Erev "`.
|
|
37
|
+
* @example
|
|
38
|
+
* // 'Erev Pesach' => 'Pesach'
|
|
39
|
+
* // 'Sukkot III (CH''M)' => 'Sukkot'
|
|
40
|
+
* // 'Chanukah: 5 Candles' => 'Chanukah'
|
|
41
|
+
* // 'Rosh Hashana 5784' => 'Rosh Hashana'
|
|
42
|
+
*/
|
|
15
43
|
basename(): string;
|
|
44
|
+
/**
|
|
45
|
+
* Returns a `https://www.hebcal.com/holidays/...` URL for more detail on
|
|
46
|
+
* this holiday. Israel-only holidays get an `?i=on` query parameter.
|
|
47
|
+
* Returns `undefined` for years outside `[100, 2999]`.
|
|
48
|
+
*/
|
|
16
49
|
url(): string | undefined;
|
|
17
50
|
urlDateSuffix(): string;
|
|
18
51
|
getEmoji(): string;
|
package/dist/src/HolidayEvent.js
CHANGED
|
@@ -2,7 +2,22 @@ import { Locale, isoDateString } from '@hebcal/hdate';
|
|
|
2
2
|
import { Event, flags } from './event';
|
|
3
3
|
import { holidayDesc as hdesc } from './staticHolidays';
|
|
4
4
|
import './locale'; // Adds Hebrew and Ashkenazic translations
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Represents a built-in holiday like Pesach, Purim or Tu BiShvat.
|
|
7
|
+
*
|
|
8
|
+
* Most holiday-related events emitted by {@link HebrewCalendar.calendar}
|
|
9
|
+
* are instances of `HolidayEvent` or one of its subclasses
|
|
10
|
+
* ({@link ChanukahEvent}, {@link AsaraBTevetEvent},
|
|
11
|
+
* {@link RoshHashanaEvent}, {@link RoshChodeshEvent}).
|
|
12
|
+
*
|
|
13
|
+
* Adds two notable behaviors over the base {@link Event}:
|
|
14
|
+
*
|
|
15
|
+
* - {@link HolidayEvent.basename} strips qualifiers like `Erev `, ` I`/`II`,
|
|
16
|
+
* `(CH''M)`, `(observed)`, candle counts, etc. (e.g. `"Erev Pesach"` →
|
|
17
|
+
* `"Pesach"`).
|
|
18
|
+
* - {@link HolidayEvent.url} returns a `https://www.hebcal.com/holidays/...`
|
|
19
|
+
* link for the holiday.
|
|
20
|
+
*/
|
|
6
21
|
export class HolidayEvent extends Event {
|
|
7
22
|
/** During Sukkot or Pesach */
|
|
8
23
|
cholHaMoedDay;
|
|
@@ -18,6 +33,19 @@ export class HolidayEvent extends Event {
|
|
|
18
33
|
Object.assign(this, attrs);
|
|
19
34
|
}
|
|
20
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Returns a simplified (untranslated) name for this holiday, stripping
|
|
38
|
+
* qualifiers so that related events group under one name.
|
|
39
|
+
*
|
|
40
|
+
* Strips trailing 4-digit years, `(CH''M)`, `(observed)`, `(Hoshana Raba)`,
|
|
41
|
+
* Roman-numeral day numbers (` I`, ` II`, ...), Chanukah candle counts,
|
|
42
|
+
* `: 8th Day`, and a leading `"Erev "`.
|
|
43
|
+
* @example
|
|
44
|
+
* // 'Erev Pesach' => 'Pesach'
|
|
45
|
+
* // 'Sukkot III (CH''M)' => 'Sukkot'
|
|
46
|
+
* // 'Chanukah: 5 Candles' => 'Chanukah'
|
|
47
|
+
* // 'Rosh Hashana 5784' => 'Rosh Hashana'
|
|
48
|
+
*/
|
|
21
49
|
basename() {
|
|
22
50
|
return this.getDesc()
|
|
23
51
|
.replace(/ \d{4}$/, '')
|
|
@@ -29,6 +57,11 @@ export class HolidayEvent extends Event {
|
|
|
29
57
|
.replace(/: 8th Day$/, '')
|
|
30
58
|
.replace(/^Erev /, '');
|
|
31
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* Returns a `https://www.hebcal.com/holidays/...` URL for more detail on
|
|
62
|
+
* this holiday. Israel-only holidays get an `?i=on` query parameter.
|
|
63
|
+
* Returns `undefined` for years outside `[100, 2999]`.
|
|
64
|
+
*/
|
|
32
65
|
url() {
|
|
33
66
|
const year = this.greg().getFullYear();
|
|
34
67
|
if (year < 100 || year > 2999) {
|
package/dist/src/TimedEvent.d.ts
CHANGED
|
@@ -3,12 +3,26 @@ import { CalOptions } from './CalOptions';
|
|
|
3
3
|
import { Location } from './location';
|
|
4
4
|
import { Event } from './event';
|
|
5
5
|
import './locale';
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Base class for events that have an associated wall-clock time and
|
|
8
|
+
* geographic location — for example, candle lighting, havdalah, and
|
|
9
|
+
* fast begin/end times.
|
|
10
|
+
*
|
|
11
|
+
* Stores both a `Date` (`eventTime`) and pre-formatted 24-hour
|
|
12
|
+
* (`eventTimeStr`) and locale-aware (`fmtTime`) strings. May reference a
|
|
13
|
+
* "linked" event such as the holiday whose candle-lighting time this
|
|
14
|
+
* represents.
|
|
15
|
+
*/
|
|
7
16
|
export declare class TimedEvent extends Event {
|
|
17
|
+
/** The exact moment of the event, rounded to the nearest minute */
|
|
8
18
|
readonly eventTime: Date;
|
|
19
|
+
/** Geographic location used to compute `eventTime` */
|
|
9
20
|
readonly location: Location;
|
|
21
|
+
/** 24-hour formatted time string in the location's timezone (e.g. `"19:42"`) */
|
|
10
22
|
readonly eventTimeStr: string;
|
|
23
|
+
/** Locale-aware formatted time string (e.g. `"7:42pm"` in US locale) */
|
|
11
24
|
readonly fmtTime: string;
|
|
25
|
+
/** Optional event this time is associated with (e.g. the Yom Tov being lit for) */
|
|
12
26
|
readonly linkedEvent?: Event;
|
|
13
27
|
/**
|
|
14
28
|
* @param desc Description (not translated)
|
|
@@ -25,12 +39,27 @@ export declare class TimedEvent extends Event {
|
|
|
25
39
|
renderBrief(locale?: string): string;
|
|
26
40
|
getCategories(): string[];
|
|
27
41
|
}
|
|
28
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* Candle-lighting event for the eve of Shabbat or a Yom Tov.
|
|
44
|
+
*
|
|
45
|
+
* Generated by {@link HebrewCalendar.calendar} when `options.candlelighting`
|
|
46
|
+
* is `true` and `options.location` is provided. By default candle lighting
|
|
47
|
+
* occurs 18 minutes before sundown (40 minutes in Jerusalem; 30 minutes in
|
|
48
|
+
* Haifa and Zikhron Ya'akov), configurable via `options.candleLightingMins`.
|
|
49
|
+
*/
|
|
29
50
|
export declare class CandleLightingEvent extends TimedEvent {
|
|
30
51
|
constructor(date: HDate, mask: number, eventTime: Date, location: Location, linkedEvent?: Event, options?: CalOptions);
|
|
31
52
|
getEmoji(): string;
|
|
32
53
|
}
|
|
33
|
-
/**
|
|
54
|
+
/**
|
|
55
|
+
* Havdalah event marking the end of Shabbat or a Yom Tov.
|
|
56
|
+
*
|
|
57
|
+
* Generated by {@link HebrewCalendar.calendar} when `options.candlelighting`
|
|
58
|
+
* is `true` and `options.location` is provided. By default Havdalah is
|
|
59
|
+
* calculated by *tzeit hakochavim* (8.5° solar depression); pass
|
|
60
|
+
* `options.havdalahMins` to use a fixed minute offset instead, or
|
|
61
|
+
* `options.havdalahDeg` to use a different degree.
|
|
62
|
+
*/
|
|
34
63
|
export declare class HavdalahEvent extends TimedEvent {
|
|
35
64
|
private readonly havdalahMins?;
|
|
36
65
|
constructor(date: HDate, mask: number, eventTime: Date, location: Location, havdalahMins?: number, linkedEvent?: Event, options?: CalOptions);
|
package/dist/src/TimedEvent.js
CHANGED
|
@@ -6,12 +6,26 @@ import { holidayDesc as hdesc } from './staticHolidays';
|
|
|
6
6
|
import './locale'; // Adds Hebrew and Ashkenazic translations
|
|
7
7
|
const HAVDALAH = hdesc.HAVDALAH;
|
|
8
8
|
const CANDLE_LIGHTING = hdesc.CANDLE_LIGHTING;
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Base class for events that have an associated wall-clock time and
|
|
11
|
+
* geographic location — for example, candle lighting, havdalah, and
|
|
12
|
+
* fast begin/end times.
|
|
13
|
+
*
|
|
14
|
+
* Stores both a `Date` (`eventTime`) and pre-formatted 24-hour
|
|
15
|
+
* (`eventTimeStr`) and locale-aware (`fmtTime`) strings. May reference a
|
|
16
|
+
* "linked" event such as the holiday whose candle-lighting time this
|
|
17
|
+
* represents.
|
|
18
|
+
*/
|
|
10
19
|
export class TimedEvent extends Event {
|
|
20
|
+
/** The exact moment of the event, rounded to the nearest minute */
|
|
11
21
|
eventTime;
|
|
22
|
+
/** Geographic location used to compute `eventTime` */
|
|
12
23
|
location;
|
|
24
|
+
/** 24-hour formatted time string in the location's timezone (e.g. `"19:42"`) */
|
|
13
25
|
eventTimeStr;
|
|
26
|
+
/** Locale-aware formatted time string (e.g. `"7:42pm"` in US locale) */
|
|
14
27
|
fmtTime;
|
|
28
|
+
/** Optional event this time is associated with (e.g. the Yom Tov being lit for) */
|
|
15
29
|
linkedEvent;
|
|
16
30
|
/**
|
|
17
31
|
* @param desc Description (not translated)
|
|
@@ -63,7 +77,14 @@ export class TimedEvent extends Event {
|
|
|
63
77
|
return ['unknown'];
|
|
64
78
|
}
|
|
65
79
|
}
|
|
66
|
-
/**
|
|
80
|
+
/**
|
|
81
|
+
* Candle-lighting event for the eve of Shabbat or a Yom Tov.
|
|
82
|
+
*
|
|
83
|
+
* Generated by {@link HebrewCalendar.calendar} when `options.candlelighting`
|
|
84
|
+
* is `true` and `options.location` is provided. By default candle lighting
|
|
85
|
+
* occurs 18 minutes before sundown (40 minutes in Jerusalem; 30 minutes in
|
|
86
|
+
* Haifa and Zikhron Ya'akov), configurable via `options.candleLightingMins`.
|
|
87
|
+
*/
|
|
67
88
|
export class CandleLightingEvent extends TimedEvent {
|
|
68
89
|
constructor(date, mask, eventTime, location, linkedEvent, options) {
|
|
69
90
|
super(date, CANDLE_LIGHTING, mask, eventTime, location, linkedEvent, options);
|
|
@@ -72,7 +93,15 @@ export class CandleLightingEvent extends TimedEvent {
|
|
|
72
93
|
return '🕯️';
|
|
73
94
|
}
|
|
74
95
|
}
|
|
75
|
-
/**
|
|
96
|
+
/**
|
|
97
|
+
* Havdalah event marking the end of Shabbat or a Yom Tov.
|
|
98
|
+
*
|
|
99
|
+
* Generated by {@link HebrewCalendar.calendar} when `options.candlelighting`
|
|
100
|
+
* is `true` and `options.location` is provided. By default Havdalah is
|
|
101
|
+
* calculated by *tzeit hakochavim* (8.5° solar depression); pass
|
|
102
|
+
* `options.havdalahMins` to use a fixed minute offset instead, or
|
|
103
|
+
* `options.havdalahDeg` to use a different degree.
|
|
104
|
+
*/
|
|
76
105
|
export class HavdalahEvent extends TimedEvent {
|
|
77
106
|
havdalahMins;
|
|
78
107
|
constructor(date, mask, eventTime, location, havdalahMins, linkedEvent, options) {
|