@hebcal/core 5.10.0 → 5.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.js +6 -6
- package/dist/bundle.js.map +1 -1
- package/dist/bundle.min.js +3 -3
- package/dist/bundle.min.js.map +1 -1
- package/dist/esm/DailyLearning.js +1 -1
- package/dist/esm/DailyLearning.js.map +1 -1
- package/dist/esm/HebrewDateEvent.js +1 -1
- package/dist/esm/HebrewDateEvent.js.map +1 -1
- package/dist/esm/HolidayEvent.js +1 -1
- package/dist/esm/HolidayEvent.js.map +1 -1
- package/dist/esm/MevarchimChodeshEvent.js +1 -1
- package/dist/esm/MevarchimChodeshEvent.js.map +1 -1
- package/dist/esm/ParshaEvent.js +1 -1
- package/dist/esm/ParshaEvent.js.map +1 -1
- package/dist/esm/TimedEvent.js +1 -1
- package/dist/esm/TimedEvent.js.map +1 -1
- package/dist/esm/YomKippurKatanEvent.js +1 -1
- package/dist/esm/YomKippurKatanEvent.js.map +1 -1
- package/dist/esm/ashkenazi.po.js +1 -1
- package/dist/esm/calendar.js +1 -1
- package/dist/esm/calendar.js.map +1 -1
- package/dist/esm/candles.js +1 -1
- package/dist/esm/candles.js.map +1 -1
- package/dist/esm/event.js +1 -1
- package/dist/esm/event.js.map +1 -1
- package/dist/esm/getStartAndEnd.js +1 -1
- package/dist/esm/getStartAndEnd.js.map +1 -1
- package/dist/esm/hallel.js +1 -1
- package/dist/esm/hallel.js.map +1 -1
- package/dist/esm/he-x-NoNikud.po.d.ts +1 -0
- package/dist/esm/he-x-NoNikud.po.js +2 -2
- package/dist/esm/he-x-NoNikud.po.js.map +1 -1
- package/dist/esm/he.po.js +2 -2
- package/dist/esm/he.po.js.map +1 -1
- package/dist/esm/hebcal.js +1 -1
- package/dist/esm/hebcal.js.map +1 -1
- package/dist/esm/holidays.js +1 -1
- package/dist/esm/holidays.js.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/isAssurBemlacha.js +1 -1
- package/dist/esm/isAssurBemlacha.js.map +1 -1
- package/dist/esm/locale.js +1 -1
- package/dist/esm/location.js +1 -1
- package/dist/esm/location.js.map +1 -1
- package/dist/esm/modern.js +1 -1
- package/dist/esm/modern.js.map +1 -1
- package/dist/esm/molad.js +1 -1
- package/dist/esm/molad.js.map +1 -1
- package/dist/esm/omer.js +1 -1
- package/dist/esm/omer.js.map +1 -1
- package/dist/esm/parshaName.js +1 -1
- package/dist/esm/parshaName.js.map +1 -1
- package/dist/esm/parshaYear.js +1 -1
- 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/reformatTimeStr.js.map +1 -1
- package/dist/esm/sedra.js +1 -1
- package/dist/esm/sedra.js.map +1 -1
- package/dist/esm/staticHolidays.js +1 -1
- package/dist/esm/tachanun.js +1 -1
- package/dist/esm/tachanun.js.map +1 -1
- package/dist/esm/zmanim.js +1 -1
- package/dist/esm/zmanim.js.map +1 -1
- package/dist/he-x-NoNikud.po.d.ts +1 -0
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/pkgVersion.d.ts +1 -1
- package/package.json +9 -9
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 {renderParshaName} from './parshaName';\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 * True if this is a regular parasha HaShavua\n * Torah reading, false 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 */\n num?: number | number[];\n /** The date of the Shabbat this parsha is read */\n hdate: HDate;\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 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 = 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 parsha (or parshiyot) read on Hebrew date\n * @deprecated Use {@link lookup} instead\n * @param hd Hebrew date or R.D. days\n */\n get(hd: HDate | number): string[] {\n return this.lookup(hd).parsha;\n }\n\n /**\n * Looks up parsha for the date, then returns a translated or transliterated string\n * @deprecated Use {@link lookup} instead\n * @param hd Hebrew date or R.D. days\n * @param [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale\n */\n getString(hd: HDate | number, locale?: string): string {\n const parsha = this.get(hd);\n return renderParshaName(parsha, locale);\n }\n\n /**\n * Checks to see if this day would be a regular parasha HaShavua\n * Torah reading or special holiday reading\n * @deprecated Use {@link lookup} instead\n * @param hd Hebrew date or R.D. days\n */\n isParsha(hd: HDate | number): boolean {\n return !this.lookup(hd).chag;\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.indexOf('-') !== -1) {\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 }\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 (typeof 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};\n }\n if (index >= 0) {\n return {parsha: [parshiot[index]], chag: false, num: index + 1, hdate};\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 };\n }\n}\n\n/**\n * The 54 parshiyot of the Torah as transilterated strings.\n * parshiot[0] == 'Bereshit', parshiot[1] == 'Noach', parshiot[52] == \"Ha'azinu\".\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] 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 = [\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.includes(-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: 400});\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;AAMH,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;;AACV,SAAA,IAAI,CAAC,KAAK,IAAI,MAAM,EAAE;AAC3B,QAAA,OAAO,UAAU;;SACZ;AACL,QAAA,OAAO,OAAO;;AAElB;AA0BA;;AAEG;MACU,K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"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 {renderParshaName} from './parshaName';\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 * True if this is a regular parasha HaShavua\n * Torah reading, false 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 */\n num?: number | number[];\n /** The date of the Shabbat this parsha is read */\n hdate: HDate;\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 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 = 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 parsha (or parshiyot) read on Hebrew date\n * @deprecated Use {@link lookup} instead\n * @param hd Hebrew date or R.D. days\n */\n get(hd: HDate | number): string[] {\n return this.lookup(hd).parsha;\n }\n\n /**\n * Looks up parsha for the date, then returns a translated or transliterated string\n * @deprecated Use {@link lookup} instead\n * @param hd Hebrew date or R.D. days\n * @param [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale\n */\n getString(hd: HDate | number, locale?: string): string {\n const parsha = this.get(hd);\n return renderParshaName(parsha, locale);\n }\n\n /**\n * Checks to see if this day would be a regular parasha HaShavua\n * Torah reading or special holiday reading\n * @deprecated Use {@link lookup} instead\n * @param hd Hebrew date or R.D. days\n */\n isParsha(hd: HDate | number): boolean {\n return !this.lookup(hd).chag;\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.indexOf('-') !== -1) {\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 }\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 (typeof 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};\n }\n if (index >= 0) {\n return {parsha: [parshiot[index]], chag: false, num: index + 1, hdate};\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 };\n }\n}\n\n/**\n * The 54 parshiyot of the Torah as transilterated strings.\n * parshiot[0] == 'Bereshit', parshiot[1] == 'Noach', parshiot[52] == \"Ha'azinu\".\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] 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 = [\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.includes(-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: 400});\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;AAMH,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,C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,OAAO,EAAE,GAAG,EAAC,CAAC;AAE9D;;;;;AAKG;AACG,SAAU,QAAQ,CAAC,KAAa,EAAE,EAAW,EAAA;AACjD,IAAA,MAAM,QAAQ,GAAG,CAAA,EAAG,KAAK,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE;IACzC,IAAI,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC;IACpC,IAAI,CAAC,KAAK,EAAE;QACV,KAAK,GAAG,IAAI,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;AAC5B,QAAA,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC;IACjC;AACA,IAAA,OAAO,KAAK;AACd;;;;"}
|
package/dist/esm/tachanun.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v5.10.
|
|
1
|
+
/*! @hebcal/core v5.10.1, 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
|
|
package/dist/esm/tachanun.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tachanun.js","sources":["../../../src/tachanun.ts"],"sourcesContent":["import {HDate, months} from '@hebcal/hdate';\nimport {dateYomHaZikaron} from './modern';\n\nfunction range(start: number, end: number): readonly number[] {\n const arr = [];\n for (let i = start; i <= end; i++) {\n arr.push(i);\n }\n return arr;\n}\n\n/**\n * Is *tachanun* said today?\n */\nexport type TachanunResult = {\n /** Tachanun is said at Shacharit */\n shacharit: boolean;\n /** Tachanun is said at Mincha */\n mincha: boolean;\n /** All congregations say Tachanun on the day */\n allCongs: boolean;\n};\n\nconst NONE: TachanunResult = {\n shacharit: false,\n mincha: false,\n allCongs: false,\n} as const;\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 */\nexport function tachanun(hdate: HDate, il: boolean): TachanunResult {\n return tachanun0(hdate, il, true);\n}\n\nfunction tachanun0(\n hdate: HDate,\n il: boolean,\n checkNext: boolean\n): TachanunResult {\n const year = hdate.yy;\n const dates = tachanunYear(year, il);\n const abs = hdate.abs();\n if (dates.none.indexOf(abs) > -1) {\n return NONE;\n }\n const dow = hdate.getDay();\n const ret: TachanunResult = {\n shacharit: false,\n mincha: false,\n allCongs: false,\n };\n if (dates.some.indexOf(abs) === -1) {\n ret.allCongs = true;\n }\n if (dow !== 6) {\n ret.shacharit = true;\n }\n const tomorrow = abs + 1;\n if (checkNext && dates.yesPrev.indexOf(tomorrow) === -1) {\n const tmp = tachanun0(new HDate(tomorrow), il, false);\n ret.mincha = tmp.shacharit;\n } else {\n ret.mincha = dow !== 5;\n }\n if (ret.allCongs && !ret.mincha && !ret.shacharit) {\n return NONE;\n }\n return ret;\n}\n\ntype TachanunYear = {\n none: number[];\n some: number[];\n yesPrev: number[];\n};\n\nfunction tachanunYear(year: number, il: boolean): TachanunYear {\n const leap = HDate.isLeapYear(year);\n const monthsInYear = HDate.monthsInYear(year);\n let av9dt = new HDate(9, months.AV, year);\n if (av9dt.getDay() === 6) {\n av9dt = av9dt.next();\n }\n let shushPurim = new HDate(15, months.ADAR_II, year);\n if (shushPurim.getDay() === 6) {\n shushPurim = shushPurim.next();\n }\n const none: readonly HDate[] = [\n new HDate(2, months.TISHREI, year), // Rosh Hashana II\n ].concat(\n // Rosh Chodesh - 1st of every month. Also includes RH day 1 (1 Tishrei)\n range(1, monthsInYear).map(month => new HDate(1, month, year)),\n // Rosh Chodesh - 30th of months that have one\n range(1, monthsInYear)\n .filter(month => HDate.daysInMonth(month, year) === 30)\n .map(month => new HDate(30, month, year)),\n // entire month of Nisan\n range(1, HDate.daysInMonth(months.NISAN, year)).map(\n mday => new HDate(mday, months.NISAN, year)\n ),\n new HDate(18, months.IYYAR, year), // Lag BaOmer\n // Rosh Chodesh Sivan thru Isru Chag\n range(1, 8 - (il ? 1 : 0)).map(mday => new HDate(mday, months.SIVAN, year)),\n av9dt, // Tisha B'Av\n new HDate(15, months.AV, year), // Tu B'Av\n new HDate(29, months.ELUL, year), // Erev Rosh Hashanah\n // Erev Yom Kippur thru Isru Chag\n range(9, 24 - (il ? 1 : 0)).map(\n mday => new HDate(mday, months.TISHREI, year)\n ),\n // Chanukah\n range(25, 33).map(mday => new HDate(mday, months.KISLEV, year)),\n new HDate(15, months.SHVAT, year), // Tu BiShvat\n new HDate(14, months.ADAR_II, year), // Purim\n shushPurim,\n leap ? new HDate(14, months.ADAR_I, year) : [] // Purim Katan\n );\n const some: readonly HDate[] = [\n new HDate(14, months.IYYAR, year), // Pesach Sheini\n ].concat(\n // Until 14 Sivan\n range(1, 13).map(mday => new HDate(mday, months.SIVAN, year)),\n // Until after Rosh Chodesh Cheshvan\n range(20, 31).map(mday => new HDate(mday, months.TISHREI, year)),\n // Yom HaAtzma'ut, which changes based on day of week\n year >= 5708 ? (dateYomHaZikaron(year) as HDate).next() : [],\n // Yom Yerushalayim\n year >= 5727 ? new HDate(28, months.IYYAR, year) : []\n );\n const yesPrev: readonly HDate[] = [\n new HDate(29, months.ELUL, year - 1), // Erev Rosh Hashanah\n new HDate(9, months.TISHREI, year), // Erev Yom Kippur\n new HDate(14, months.IYYAR, year), // Pesach Sheini\n ];\n return {\n none: none.map(hd => hd.abs()).sort((a, b) => a - b),\n some: some.map(hd => hd.abs()).sort((a, b) => a - b),\n yesPrev: yesPrev.map(hd => hd.abs()).sort((a, b) => a - b),\n };\n}\n"],"names":[],"mappings":";;;;AAGA,SAAS,KAAK,CAAC,KAAa,EAAE,GAAW,EAAA;IACvC,MAAM,GAAG,GAAG,EAAE;AACd,IAAA,KAAK,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,EAAE,EAAE;AACjC,QAAA,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC
|
|
1
|
+
{"version":3,"file":"tachanun.js","sources":["../../../src/tachanun.ts"],"sourcesContent":["import {HDate, months} from '@hebcal/hdate';\nimport {dateYomHaZikaron} from './modern';\n\nfunction range(start: number, end: number): readonly number[] {\n const arr = [];\n for (let i = start; i <= end; i++) {\n arr.push(i);\n }\n return arr;\n}\n\n/**\n * Is *tachanun* said today?\n */\nexport type TachanunResult = {\n /** Tachanun is said at Shacharit */\n shacharit: boolean;\n /** Tachanun is said at Mincha */\n mincha: boolean;\n /** All congregations say Tachanun on the day */\n allCongs: boolean;\n};\n\nconst NONE: TachanunResult = {\n shacharit: false,\n mincha: false,\n allCongs: false,\n} as const;\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 */\nexport function tachanun(hdate: HDate, il: boolean): TachanunResult {\n return tachanun0(hdate, il, true);\n}\n\nfunction tachanun0(\n hdate: HDate,\n il: boolean,\n checkNext: boolean\n): TachanunResult {\n const year = hdate.yy;\n const dates = tachanunYear(year, il);\n const abs = hdate.abs();\n if (dates.none.indexOf(abs) > -1) {\n return NONE;\n }\n const dow = hdate.getDay();\n const ret: TachanunResult = {\n shacharit: false,\n mincha: false,\n allCongs: false,\n };\n if (dates.some.indexOf(abs) === -1) {\n ret.allCongs = true;\n }\n if (dow !== 6) {\n ret.shacharit = true;\n }\n const tomorrow = abs + 1;\n if (checkNext && dates.yesPrev.indexOf(tomorrow) === -1) {\n const tmp = tachanun0(new HDate(tomorrow), il, false);\n ret.mincha = tmp.shacharit;\n } else {\n ret.mincha = dow !== 5;\n }\n if (ret.allCongs && !ret.mincha && !ret.shacharit) {\n return NONE;\n }\n return ret;\n}\n\ntype TachanunYear = {\n none: number[];\n some: number[];\n yesPrev: number[];\n};\n\nfunction tachanunYear(year: number, il: boolean): TachanunYear {\n const leap = HDate.isLeapYear(year);\n const monthsInYear = HDate.monthsInYear(year);\n let av9dt = new HDate(9, months.AV, year);\n if (av9dt.getDay() === 6) {\n av9dt = av9dt.next();\n }\n let shushPurim = new HDate(15, months.ADAR_II, year);\n if (shushPurim.getDay() === 6) {\n shushPurim = shushPurim.next();\n }\n const none: readonly HDate[] = [\n new HDate(2, months.TISHREI, year), // Rosh Hashana II\n ].concat(\n // Rosh Chodesh - 1st of every month. Also includes RH day 1 (1 Tishrei)\n range(1, monthsInYear).map(month => new HDate(1, month, year)),\n // Rosh Chodesh - 30th of months that have one\n range(1, monthsInYear)\n .filter(month => HDate.daysInMonth(month, year) === 30)\n .map(month => new HDate(30, month, year)),\n // entire month of Nisan\n range(1, HDate.daysInMonth(months.NISAN, year)).map(\n mday => new HDate(mday, months.NISAN, year)\n ),\n new HDate(18, months.IYYAR, year), // Lag BaOmer\n // Rosh Chodesh Sivan thru Isru Chag\n range(1, 8 - (il ? 1 : 0)).map(mday => new HDate(mday, months.SIVAN, year)),\n av9dt, // Tisha B'Av\n new HDate(15, months.AV, year), // Tu B'Av\n new HDate(29, months.ELUL, year), // Erev Rosh Hashanah\n // Erev Yom Kippur thru Isru Chag\n range(9, 24 - (il ? 1 : 0)).map(\n mday => new HDate(mday, months.TISHREI, year)\n ),\n // Chanukah\n range(25, 33).map(mday => new HDate(mday, months.KISLEV, year)),\n new HDate(15, months.SHVAT, year), // Tu BiShvat\n new HDate(14, months.ADAR_II, year), // Purim\n shushPurim,\n leap ? new HDate(14, months.ADAR_I, year) : [] // Purim Katan\n );\n const some: readonly HDate[] = [\n new HDate(14, months.IYYAR, year), // Pesach Sheini\n ].concat(\n // Until 14 Sivan\n range(1, 13).map(mday => new HDate(mday, months.SIVAN, year)),\n // Until after Rosh Chodesh Cheshvan\n range(20, 31).map(mday => new HDate(mday, months.TISHREI, year)),\n // Yom HaAtzma'ut, which changes based on day of week\n year >= 5708 ? (dateYomHaZikaron(year) as HDate).next() : [],\n // Yom Yerushalayim\n year >= 5727 ? new HDate(28, months.IYYAR, year) : []\n );\n const yesPrev: readonly HDate[] = [\n new HDate(29, months.ELUL, year - 1), // Erev Rosh Hashanah\n new HDate(9, months.TISHREI, year), // Erev Yom Kippur\n new HDate(14, months.IYYAR, year), // Pesach Sheini\n ];\n return {\n none: none.map(hd => hd.abs()).sort((a, b) => a - b),\n some: some.map(hd => hd.abs()).sort((a, b) => a - b),\n yesPrev: yesPrev.map(hd => hd.abs()).sort((a, b) => a - b),\n };\n}\n"],"names":[],"mappings":";;;;AAGA,SAAS,KAAK,CAAC,KAAa,EAAE,GAAW,EAAA;IACvC,MAAM,GAAG,GAAG,EAAE;AACd,IAAA,KAAK,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,EAAE,EAAE;AACjC,QAAA,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IACb;AACA,IAAA,OAAO,G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,CAAC,CAAC;QACpD,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACpD,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;KAC3D;AACH;;;;"}
|
package/dist/esm/zmanim.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v5.10.
|
|
1
|
+
/*! @hebcal/core v5.10.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
import 'temporal-polyfill/global';
|
|
3
3
|
import { NOAACalculator } from '@hebcal/noaa';
|
|
4
4
|
import { getTimezoneOffset, pad2, getPseudoISO, HDate, isDate } from '@hebcal/hdate';
|
package/dist/esm/zmanim.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zmanim.js","sources":["../../../src/zmanim.ts"],"sourcesContent":["import 'temporal-polyfill/global';\nimport {GeoLocation, NOAACalculator} from '@hebcal/noaa';\nimport {\n HDate,\n getPseudoISO,\n getTimezoneOffset,\n isDate,\n pad2,\n} from '@hebcal/hdate';\n\n/**\n * @private\n */\nfunction zdtToDate(zdt: Temporal.ZonedDateTime | null): Date {\n if (zdt === null) {\n return new Date(NaN);\n }\n const res = new Date(zdt.epochMilliseconds);\n res.setMilliseconds(0);\n return res;\n}\n\nfunction getDate(date: Date | HDate): Date {\n if (isDate(date)) return date as Date;\n if (HDate.isHDate(date)) return (date as HDate).greg();\n throw new TypeError(`invalid date: ${date}`);\n}\n\n/**\n * Calculate halachic times (zmanim / זְמַנִּים) for a given day and location.\n * Calculations are available for tzeit / tzais (nightfall),\n * shkiah (sunset) and more.\n *\n * Zmanim are estimated using an algorithm published by the US National Oceanic\n * and Atmospheric Administration. The NOAA solar calculator is based on equations\n * from _Astronomical Algorithms_ by Jean Meeus.\n *\n * The sunrise and sunset results are theoretically accurate to within a minute for\n * locations between +/- 72° latitude, and within 10 minutes outside of those latitudes.\n * However, due to variations in atmospheric composition, temperature, pressure and\n * conditions, observed values may vary from calculations.\n * https://gml.noaa.gov/grad/solcalc/calcdetails.html\n *\n * @example\n * const {GeoLocation, Zmanim} = require('@hebcal/core');\n * const latitude = 41.822232;\n * const longitude = -71.448292;\n * const tzid = 'America/New_York';\n * const friday = new Date(2023, 8, 8);\n * const gloc = new GeoLocation(null, latitude, longitude, 0, tzid);\n * const zmanim = new Zmanim(gloc, friday, false);\n * const candleLighting = zmanim.sunsetOffset(-18, true);\n * const timeStr = Zmanim.formatISOWithTimeZone(tzid, candleLighting);\n */\nexport class Zmanim {\n private readonly date: Date;\n private readonly gloc: GeoLocation;\n private readonly noaa: NOAACalculator;\n private useElevation: boolean;\n /**\n * Initialize a Zmanim instance.\n * @param gloc GeoLocation including latitude, longitude, and timezone\n * @param date Regular or Hebrew Date. If `date` is a regular `Date`,\n * hours, minutes, seconds and milliseconds are ignored.\n * @param useElevation use elevation for calculations (default `false`).\n * If `true`, use elevation to affect the calculation of all sunrise/sunset based\n * zmanim. Note: there are some zmanim such as degree-based zmanim that are driven\n * by the amount of light in the sky and are not impacted by elevation.\n * These zmanim intentionally do not support elevation adjustment.\n */\n constructor(gloc: GeoLocation, date: Date | HDate, useElevation: boolean) {\n const dt = getDate(date);\n this.date = dt;\n this.gloc = gloc;\n const plainDate = Temporal.PlainDate.from({\n year: dt.getFullYear(),\n month: dt.getMonth() + 1,\n day: dt.getDate(),\n });\n this.noaa = new NOAACalculator(gloc, plainDate);\n this.useElevation = Boolean(useElevation);\n }\n /**\n * Returns `true` if elevation adjustment is enabled\n * for zmanim support elevation adjustment\n */\n getUseElevation(): boolean {\n return this.useElevation;\n }\n /**\n * Enables or disables elevation adjustment for zmanim support elevation adjustment\n * @param useElevation\n */\n setUseElevation(useElevation: boolean) {\n this.useElevation = useElevation;\n }\n /**\n * Convenience function to get the time when sun is above or below the horizon\n * for a certain angle (in degrees).\n * This function does not support elevation adjustment.\n * @param angle\n * @param rising\n */\n timeAtAngle(angle: number, rising: boolean): Date {\n const offsetZenith = 90 + angle;\n const zdt = rising\n ? this.noaa.getSunriseOffsetByDegrees(offsetZenith)\n : this.noaa.getSunsetOffsetByDegrees(offsetZenith);\n return zdtToDate(zdt);\n }\n /**\n * Upper edge of the Sun appears over the eastern horizon in the morning (0.833° above horizon)\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n sunrise(): Date {\n const zdt = this.useElevation\n ? this.noaa.getSunrise()\n : this.noaa.getSeaLevelSunrise();\n return zdtToDate(zdt);\n }\n /**\n * Upper edge of the Sun appears over the eastern horizon in the morning (0.833° above horizon).\n * This function does not support elevation adjustment.\n */\n seaLevelSunrise(): Date {\n const zdt = this.noaa.getSeaLevelSunrise();\n return zdtToDate(zdt);\n }\n /**\n * When the upper edge of the Sun disappears below the horizon (0.833° below horizon).\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n sunset(): Date {\n const zdt = this.useElevation\n ? this.noaa.getSunset()\n : this.noaa.getSeaLevelSunset();\n return zdtToDate(zdt);\n }\n /**\n * When the upper edge of the Sun disappears below the horizon (0.833° below horizon).\n * This function does not support elevation adjustment.\n */\n seaLevelSunset(): Date {\n const zdt = this.noaa.getSeaLevelSunset();\n return zdtToDate(zdt);\n }\n /**\n * Civil dawn; Sun is 6° below the horizon in the morning.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n dawn(): Date {\n const zdt = this.noaa.getBeginCivilTwilight();\n return zdtToDate(zdt);\n }\n /**\n * Civil dusk; Sun is 6° below the horizon in the evening.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n dusk(): Date {\n const zdt = this.noaa.getEndCivilTwilight();\n return zdtToDate(zdt);\n }\n /**\n * Returns sunset for the previous day.\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n gregEve(): Date {\n const prev = new Date(this.date);\n prev.setDate(prev.getDate() - 1);\n const zman = new Zmanim(this.gloc, prev, this.useElevation);\n return zman.sunset();\n }\n /**\n * @private\n */\n nightHour(): number {\n return (this.sunrise().getTime() - this.gregEve().getTime()) / 12; // ms in hour\n }\n /**\n * Midday – Chatzot; Sunrise plus 6 halachic hours\n */\n chatzot(): Date {\n const startOfDay = this.noaa.getSeaLevelSunrise();\n const endOfDay = this.noaa.getSeaLevelSunset();\n const zdt = this.noaa.getSunTransit(startOfDay, endOfDay);\n return zdtToDate(zdt);\n }\n /**\n * Midnight – Chatzot; Sunset plus 6 halachic hours.\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n chatzotNight(): Date {\n return new Date(this.sunrise().getTime() - this.nightHour() * 6);\n }\n /**\n * Dawn – Alot haShachar; Sun is 16.1° below the horizon in the morning.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n alotHaShachar(): Date {\n return this.timeAtAngle(16.1, true);\n }\n /**\n * Dawn – Alot haShachar; calculated as 72 minutes before sunrise or\n * sea level sunrise.\n */\n alotHaShachar72(): Date {\n return this.sunriseOffset(-72, false, false);\n }\n /**\n * Earliest talis & tefillin – Misheyakir; Sun is 11.5° below the horizon in the morning.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n misheyakir(): Date {\n return this.timeAtAngle(11.5, true);\n }\n /**\n * Earliest talis & tefillin – Misheyakir Machmir; Sun is 10.2° below the horizon in the morning.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n misheyakirMachmir(): Date {\n return this.timeAtAngle(10.2, true);\n }\n /**\n * Utility method for using elevation-aware sunrise/sunset\n * @private\n * @param hours\n */\n getShaahZmanisBasedZman(hours: number): Date {\n const startOfDay = this.useElevation\n ? this.noaa.getSunrise()\n : this.noaa.getSeaLevelSunrise();\n const endOfDay = this.useElevation\n ? this.noaa.getSunset()\n : this.noaa.getSeaLevelSunset();\n const temporalHour = this.noaa.getTemporalHour(startOfDay, endOfDay);\n const offset = Math.round(temporalHour * hours);\n const zdt = NOAACalculator.getTimeOffset(startOfDay, offset);\n return zdtToDate(zdt);\n }\n /**\n * Latest Shema (Gra); Sunrise plus 3 halachic hours, according to the Gra.\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n sofZmanShma(): Date {\n // Gra\n return this.getShaahZmanisBasedZman(3);\n }\n /**\n * Latest Shacharit (Gra); Sunrise plus 4 halachic hours, according to the Gra.\n *\n * This method returns the latest *zman tfila* (time to recite shema in the morning)\n * that is 4 *shaos zmaniyos* (solar hours) after sunrise or sea level sunrise\n * (depending on the `useElevation` setting), according\n * to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).\n *\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n sofZmanTfilla(): Date {\n // Gra\n return this.getShaahZmanisBasedZman(4);\n }\n /**\n * Returns an array with alot (Date) and ms in hour (number)\n * @private\n */\n getTemporalHour72(forceSeaLevel: boolean): [Date, number] {\n const alot72 = this.sunriseOffset(-72, false, forceSeaLevel);\n const tzeit72 = this.sunsetOffset(72, false, forceSeaLevel);\n const temporalHour = (tzeit72.getTime() - alot72.getTime()) / 12;\n return [alot72, temporalHour];\n }\n /**\n * Returns an array with alot (Date) and ms in hour (number)\n * @private\n */\n getTemporalHourByDeg(angle: number): [Date, number] {\n const alot = this.timeAtAngle(angle, true);\n const tzeit = this.timeAtAngle(angle, false);\n const temporalHour = (tzeit.getTime() - alot.getTime()) / 12;\n return [alot, temporalHour];\n }\n /**\n * Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.\n * Based on the opinion of the MGA that the day is calculated from\n * dawn being fixed 72 minutes before sea-level sunrise, and nightfall is fixed\n * 72 minutes after sea-level sunset.\n */\n sofZmanShmaMGA(): Date {\n // Magen Avraham\n const [alot72, temporalHour] = this.getTemporalHour72(true);\n const offset = Math.floor(3 * temporalHour);\n return new Date(alot72.getTime() + offset);\n }\n /**\n * Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.\n * Based on the opinion of the MGA that the day is calculated from\n * dawn to nightfall with both being 16.1° below the horizon.\n */\n sofZmanShmaMGA16Point1(): Date {\n const [alot, temporalHour] = this.getTemporalHourByDeg(16.1);\n const offset = Math.floor(3 * temporalHour);\n return new Date(alot.getTime() + offset);\n }\n /**\n * Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.\n * Based on the opinion of the MGA that the day is calculated from\n * dawn to nightfall with both being 19.8° below the horizon.\n *\n * This calculation is based on the position of the sun 90 minutes after sunset in Jerusalem\n * around the equinox / equilux which calculates to 19.8° below geometric zenith.\n * https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/\n */\n sofZmanShmaMGA19Point8(): Date {\n const [alot, temporalHour] = this.getTemporalHourByDeg(19.8);\n const offset = Math.floor(3 * temporalHour);\n return new Date(alot.getTime() + offset);\n }\n /**\n * Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham\n */\n sofZmanTfillaMGA(): Date {\n // Magen Avraham\n const [alot72, temporalHour] = this.getTemporalHour72(true);\n const offset = Math.floor(4 * temporalHour);\n return new Date(alot72.getTime() + offset);\n }\n /**\n * Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham.\n * Based on the opinion of the MGA that the day is calculated from\n * dawn to nightfall with both being 16.1° below the horizon.\n */\n sofZmanTfillaMGA16Point1(): Date {\n const [alot, temporalHour] = this.getTemporalHourByDeg(16.1);\n const offset = Math.floor(4 * temporalHour);\n return new Date(alot.getTime() + offset);\n }\n /**\n * Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham.\n * Based on the opinion of the MGA that the day is calculated from\n * dawn to nightfall with both being 19.8° below the horizon.\n *\n * This calculation is based on the position of the sun 90 minutes after sunset in Jerusalem\n * around the equinox / equilux which calculates to 19.8° below geometric zenith.\n * https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/\n */\n sofZmanTfillaMGA19Point8(): Date {\n const [alot, temporalHour] = this.getTemporalHourByDeg(19.8);\n const offset = Math.floor(4 * temporalHour);\n return new Date(alot.getTime() + offset);\n }\n /**\n * Earliest Mincha – Mincha Gedola (GRA); Sunrise plus 6.5 halachic hours.\n * If elevation is enabled, this function will include elevation in the calculation.\n *\n * This method returns the latest mincha gedola, the earliest time one can pray mincha\n * that is 6.5 shaos zmaniyos (solar hours) after sunrise or sea level sunrise\n * (depending on the `useElevation` setting), according\n * to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).\n *\n * The Ramba\"m is of the opinion that it is better to delay *mincha* until\n * *mincha ketana* while the Ra\"sh, Tur, GRA and others are of the\n * opinion that *mincha* can be prayed *lechatchila* starting at *mincha gedola*.\n */\n minchaGedola(): Date {\n return this.getShaahZmanisBasedZman(6.5);\n }\n /**\n * Earliest Mincha – Mincha Gedola (MGA); Sunrise plus 6.5 halachic hours.\n * If elevation is enabled, this function will include elevation in the calculation.\n *\n * This method returns the time of *mincha gedola* according to the Magen Avraham\n * with the day starting 72 minutes before sunrise and ending 72 minutes after sunset.\n * This is the earliest time to pray *mincha*.\n */\n minchaGedolaMGA(): Date {\n const [alot72, temporalHour] = this.getTemporalHour72(false);\n const offset = Math.floor(6.5 * temporalHour);\n return new Date(alot72.getTime() + offset);\n }\n /**\n * Preferable earliest time to recite Minchah – Mincha Ketana; Sunrise plus 9.5 halachic hours.\n * If elevation is enabled, this function will include elevation in the calculation.\n *\n * This method returns *mincha ketana*, the preferred earliest time to pray *mincha* in the\n * opinion of the [Rambam](https://en.wikipedia.org/wiki/Maimonides) and others,\n * that is 9.5 *shaos zmaniyos* (solar hours) after sunrise or sea level sunrise\n * (depending on the `useElevation` setting), according\n * to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).\n */\n minchaKetana(): Date {\n return this.getShaahZmanisBasedZman(9.5);\n }\n /**\n * This method returns the time of *mincha ketana* according to the Magen Avraham\n * with the day starting 72 minutes before sunrise and ending 72 minutes after sunset.\n * This is the preferred earliest time to pray *mincha* according to the opinion of\n * the [Rambam](https://en.wikipedia.org/wiki/Maimonides) and others.\n *\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n minchaKetanaMGA(): Date {\n const [alot72, temporalHour] = this.getTemporalHour72(false);\n return new Date(alot72.getTime() + Math.floor(9.5 * temporalHour));\n }\n /**\n * Plag haMincha; Sunrise plus 10.75 halachic hours.\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n plagHaMincha(): Date {\n return this.getShaahZmanisBasedZman(10.75);\n }\n /**\n * @param [angle=8.5] optional time for solar depression.\n * Default is 8.5 degrees for 3 small stars, use 7.083 degrees for 3 medium-sized stars.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n tzeit(angle = 8.5): Date {\n return this.timeAtAngle(angle, false);\n }\n /**\n * Alias for sunrise\n */\n neitzHaChama(): Date {\n return this.sunrise();\n }\n /**\n * Alias for sunset\n */\n shkiah(): Date {\n return this.sunset();\n }\n /**\n * Rabbeinu Tam holds that bein hashmashos is a specific time\n * between sunset and tzeis hakochavim.\n * One opinion on how to calculate this time is that\n * it is 13.5 minutes before tzies 7.083.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n beinHaShmashos(): Date {\n const tzeit = this.tzeit(7.083);\n const millis = tzeit.getTime();\n if (isNaN(millis)) {\n return tzeit;\n }\n return new Date(millis - 13.5 * 60 * 1000);\n }\n /**\n * Uses timeFormat to return a date like '20:34'.\n * Returns `XX:XX` if the date is invalid.\n */\n static formatTime(dt: Date, timeFormat: Intl.DateTimeFormat): string {\n if (isNaN(dt.getTime())) {\n return 'XX:XX'; // Invalid Date\n }\n const time = timeFormat.format(dt);\n const hm = time.split(':');\n if (hm[0] === '24') {\n return '00:' + hm[1];\n }\n return time;\n }\n\n /**\n * Discards seconds, rounding to nearest minute.\n * @param dt\n */\n static roundTime(dt: Date): Date {\n const millis = dt.getTime();\n if (isNaN(millis)) {\n return dt;\n }\n // Round up to next minute if needed\n const millisOnly = dt.getMilliseconds();\n const seconds = dt.getSeconds();\n if (seconds === 0 && millisOnly === 0) {\n return dt;\n }\n const secAndMillis = seconds * 1000 + millisOnly;\n const delta =\n secAndMillis >= 30000 ? 60000 - secAndMillis : -1 * secAndMillis;\n return new Date(millis + delta);\n }\n\n /**\n * Get offset string (like \"+05:00\" or \"-08:00\") from tzid (like \"Europe/Moscow\")\n * @param tzid\n * @param date\n */\n static timeZoneOffset(tzid: string, date: Date): string {\n const offset = getTimezoneOffset(tzid, date);\n const offsetAbs = Math.abs(offset);\n const hours = Math.floor(offsetAbs / 60);\n const minutes = offsetAbs % 60;\n return (offset < 0 ? '+' : '-') + pad2(hours) + ':' + pad2(minutes);\n }\n\n /**\n * Returns a string like \"2022-04-01T13:06:00-11:00\"\n * @param tzid\n * @param date\n */\n static formatISOWithTimeZone(tzid: string, date: Date): string {\n if (isNaN(date.getTime())) {\n return '0000-00-00T00:00:00Z';\n }\n return (\n getPseudoISO(tzid, date).substring(0, 19) +\n Zmanim.timeZoneOffset(tzid, date)\n );\n }\n\n /**\n * Returns sunrise + `offset` minutes (either positive or negative).\n * If elevation is enabled, this function will include elevation in the calculation\n * unless `forceSeaLevel` is `true`.\n * @param offset minutes\n * @param roundMinute round time to nearest minute (default true)\n * @param forceSeaLevel use sea-level sunrise (default false)\n */\n sunriseOffset(\n offset: number,\n roundMinute = true,\n forceSeaLevel = false\n ): Date {\n const sunrise = forceSeaLevel ? this.seaLevelSunrise() : this.sunrise();\n if (isNaN(sunrise.getTime())) {\n return sunrise;\n }\n if (roundMinute) {\n // For positive offsets only, round up to next minute if needed\n if (offset > 0 && sunrise.getSeconds() >= 30) {\n offset++;\n }\n sunrise.setSeconds(0, 0);\n }\n return new Date(sunrise.getTime() + offset * 60 * 1000);\n }\n\n /**\n * Returns sunset + `offset` minutes (either positive or negative).\n * If elevation is enabled, this function will include elevation in the calculation\n * unless `forceSeaLevel` is `true`.\n * @param offset minutes\n * @param roundMinute round time to nearest minute (default true)\n * @param forceSeaLevel use sea-level sunset (default false)\n */\n sunsetOffset(\n offset: number,\n roundMinute = true,\n forceSeaLevel = false\n ): Date {\n const sunset = forceSeaLevel ? this.seaLevelSunset() : this.sunset();\n if (isNaN(sunset.getTime())) {\n return sunset;\n }\n if (roundMinute) {\n // For Havdalah only, round up to next minute if needed\n if (offset > 0 && sunset.getSeconds() >= 30) {\n offset++;\n }\n sunset.setSeconds(0, 0);\n }\n return new Date(sunset.getTime() + offset * 60 * 1000);\n }\n /**\n * Returns the Hebrew date relative to the specified location and Gregorian date,\n * taking into consideration whether the time is before or after sunset.\n *\n * For example, if the given date and is `2024-09-22T10:35` (before sunset), and\n * sunset for the specified location is **19:04**, then this function would\n * return a Hebrew date of `19th of Elul, 5784`.\n * If the given date is the same Gregorian day after sunset\n * (for example `2024-09-22T20:07`), this function would return a\n * Hebrew date of `20th of Elul, 5784`.\n * @example\n * const {GeoLocation, Zmanim, HDate} = require('@hebcal/core');\n * const latitude = 48.85341;\n * const longitude = 2.3488;\n * const timezone = 'Europe/Paris';\n * const gloc = new GeoLocation(null, latitude, longitude, 0, timezone);\n * const before = Zmanim.makeSunsetAwareHDate(gloc, new Date('2024-09-22T17:38:46.123Z'), false);\n * console.log(before.toString()); // '19 Elul 5784'\n * const after = Zmanim.makeSunsetAwareHDate(gloc, new Date('2024-09-22T23:45:18.345Z'), false);\n * console.log(after.toString()); // '20 Elul 5784'\n */\n static makeSunsetAwareHDate(\n gloc: GeoLocation,\n date: Date,\n useElevation: boolean\n ): HDate {\n const zmanim = new Zmanim(gloc, date, useElevation);\n const sunset = zmanim.sunset();\n let hd = new HDate(date);\n const sunsetMillis = sunset.getTime();\n if (isNaN(sunsetMillis)) {\n return hd;\n }\n if (date.getTime() >= sunsetMillis) {\n hd = hd.next();\n }\n return hd;\n }\n}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,MAAM,EAAE;QACpE,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,EAAE;AAC3B,YAAA,OAAO,MAAM;;QAEf,IAAI,WAAW,EAAE;;YAEf,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,CAAC,UAAU,EAAE,IAAI,EAAE,EAAE;AAC3C,gBAAA,MAAM,EAAE;;AAEV,YAAA,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC;;AAEzB,QAAA,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,MAAM,GAAG,EAAE,GAAG,IAAI,CAAC;;AAExD;;;;;;;;;;;;;;;;;;;;AAoBG;AACH,IAAA,OAAO,oBAAoB,CACzB,IAAiB,EACjB,IAAU,EACV,YAAqB,EAAA;QAErB,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,CAAC;AACnD,QAAA,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE;AAC9B,QAAA,IAAI,EAAE,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC;AACxB,QAAA,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,EAAE;AACrC,QAAA,IAAI,KAAK,CAAC,YAAY,CAAC,EAAE;AACvB,YAAA,OAAO,EAAE;;AAEX,QAAA,IAAI,IAAI,CAAC,OAAO,EAAE,IAAI,YAAY,EAAE;AAClC,YAAA,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE;;AAEhB,QAAA,OAAO,EAAE;;AAEZ;;;;"}
|
|
1
|
+
{"version":3,"file":"zmanim.js","sources":["../../../src/zmanim.ts"],"sourcesContent":["import 'temporal-polyfill/global';\nimport {GeoLocation, NOAACalculator} from '@hebcal/noaa';\nimport {\n HDate,\n getPseudoISO,\n getTimezoneOffset,\n isDate,\n pad2,\n} from '@hebcal/hdate';\n\n/**\n * @private\n */\nfunction zdtToDate(zdt: Temporal.ZonedDateTime | null): Date {\n if (zdt === null) {\n return new Date(NaN);\n }\n const res = new Date(zdt.epochMilliseconds);\n res.setMilliseconds(0);\n return res;\n}\n\nfunction getDate(date: Date | HDate): Date {\n if (isDate(date)) return date as Date;\n if (HDate.isHDate(date)) return (date as HDate).greg();\n throw new TypeError(`invalid date: ${date}`);\n}\n\n/**\n * Calculate halachic times (zmanim / זְמַנִּים) for a given day and location.\n * Calculations are available for tzeit / tzais (nightfall),\n * shkiah (sunset) and more.\n *\n * Zmanim are estimated using an algorithm published by the US National Oceanic\n * and Atmospheric Administration. The NOAA solar calculator is based on equations\n * from _Astronomical Algorithms_ by Jean Meeus.\n *\n * The sunrise and sunset results are theoretically accurate to within a minute for\n * locations between +/- 72° latitude, and within 10 minutes outside of those latitudes.\n * However, due to variations in atmospheric composition, temperature, pressure and\n * conditions, observed values may vary from calculations.\n * https://gml.noaa.gov/grad/solcalc/calcdetails.html\n *\n * @example\n * const {GeoLocation, Zmanim} = require('@hebcal/core');\n * const latitude = 41.822232;\n * const longitude = -71.448292;\n * const tzid = 'America/New_York';\n * const friday = new Date(2023, 8, 8);\n * const gloc = new GeoLocation(null, latitude, longitude, 0, tzid);\n * const zmanim = new Zmanim(gloc, friday, false);\n * const candleLighting = zmanim.sunsetOffset(-18, true);\n * const timeStr = Zmanim.formatISOWithTimeZone(tzid, candleLighting);\n */\nexport class Zmanim {\n private readonly date: Date;\n private readonly gloc: GeoLocation;\n private readonly noaa: NOAACalculator;\n private useElevation: boolean;\n /**\n * Initialize a Zmanim instance.\n * @param gloc GeoLocation including latitude, longitude, and timezone\n * @param date Regular or Hebrew Date. If `date` is a regular `Date`,\n * hours, minutes, seconds and milliseconds are ignored.\n * @param useElevation use elevation for calculations (default `false`).\n * If `true`, use elevation to affect the calculation of all sunrise/sunset based\n * zmanim. Note: there are some zmanim such as degree-based zmanim that are driven\n * by the amount of light in the sky and are not impacted by elevation.\n * These zmanim intentionally do not support elevation adjustment.\n */\n constructor(gloc: GeoLocation, date: Date | HDate, useElevation: boolean) {\n const dt = getDate(date);\n this.date = dt;\n this.gloc = gloc;\n const plainDate = Temporal.PlainDate.from({\n year: dt.getFullYear(),\n month: dt.getMonth() + 1,\n day: dt.getDate(),\n });\n this.noaa = new NOAACalculator(gloc, plainDate);\n this.useElevation = Boolean(useElevation);\n }\n /**\n * Returns `true` if elevation adjustment is enabled\n * for zmanim support elevation adjustment\n */\n getUseElevation(): boolean {\n return this.useElevation;\n }\n /**\n * Enables or disables elevation adjustment for zmanim support elevation adjustment\n * @param useElevation\n */\n setUseElevation(useElevation: boolean) {\n this.useElevation = useElevation;\n }\n /**\n * Convenience function to get the time when sun is above or below the horizon\n * for a certain angle (in degrees).\n * This function does not support elevation adjustment.\n * @param angle\n * @param rising\n */\n timeAtAngle(angle: number, rising: boolean): Date {\n const offsetZenith = 90 + angle;\n const zdt = rising\n ? this.noaa.getSunriseOffsetByDegrees(offsetZenith)\n : this.noaa.getSunsetOffsetByDegrees(offsetZenith);\n return zdtToDate(zdt);\n }\n /**\n * Upper edge of the Sun appears over the eastern horizon in the morning (0.833° above horizon)\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n sunrise(): Date {\n const zdt = this.useElevation\n ? this.noaa.getSunrise()\n : this.noaa.getSeaLevelSunrise();\n return zdtToDate(zdt);\n }\n /**\n * Upper edge of the Sun appears over the eastern horizon in the morning (0.833° above horizon).\n * This function does not support elevation adjustment.\n */\n seaLevelSunrise(): Date {\n const zdt = this.noaa.getSeaLevelSunrise();\n return zdtToDate(zdt);\n }\n /**\n * When the upper edge of the Sun disappears below the horizon (0.833° below horizon).\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n sunset(): Date {\n const zdt = this.useElevation\n ? this.noaa.getSunset()\n : this.noaa.getSeaLevelSunset();\n return zdtToDate(zdt);\n }\n /**\n * When the upper edge of the Sun disappears below the horizon (0.833° below horizon).\n * This function does not support elevation adjustment.\n */\n seaLevelSunset(): Date {\n const zdt = this.noaa.getSeaLevelSunset();\n return zdtToDate(zdt);\n }\n /**\n * Civil dawn; Sun is 6° below the horizon in the morning.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n dawn(): Date {\n const zdt = this.noaa.getBeginCivilTwilight();\n return zdtToDate(zdt);\n }\n /**\n * Civil dusk; Sun is 6° below the horizon in the evening.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n dusk(): Date {\n const zdt = this.noaa.getEndCivilTwilight();\n return zdtToDate(zdt);\n }\n /**\n * Returns sunset for the previous day.\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n gregEve(): Date {\n const prev = new Date(this.date);\n prev.setDate(prev.getDate() - 1);\n const zman = new Zmanim(this.gloc, prev, this.useElevation);\n return zman.sunset();\n }\n /**\n * @private\n */\n nightHour(): number {\n return (this.sunrise().getTime() - this.gregEve().getTime()) / 12; // ms in hour\n }\n /**\n * Midday – Chatzot; Sunrise plus 6 halachic hours\n */\n chatzot(): Date {\n const startOfDay = this.noaa.getSeaLevelSunrise();\n const endOfDay = this.noaa.getSeaLevelSunset();\n const zdt = this.noaa.getSunTransit(startOfDay, endOfDay);\n return zdtToDate(zdt);\n }\n /**\n * Midnight – Chatzot; Sunset plus 6 halachic hours.\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n chatzotNight(): Date {\n return new Date(this.sunrise().getTime() - this.nightHour() * 6);\n }\n /**\n * Dawn – Alot haShachar; Sun is 16.1° below the horizon in the morning.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n alotHaShachar(): Date {\n return this.timeAtAngle(16.1, true);\n }\n /**\n * Dawn – Alot haShachar; calculated as 72 minutes before sunrise or\n * sea level sunrise.\n */\n alotHaShachar72(): Date {\n return this.sunriseOffset(-72, false, false);\n }\n /**\n * Earliest talis & tefillin – Misheyakir; Sun is 11.5° below the horizon in the morning.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n misheyakir(): Date {\n return this.timeAtAngle(11.5, true);\n }\n /**\n * Earliest talis & tefillin – Misheyakir Machmir; Sun is 10.2° below the horizon in the morning.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n misheyakirMachmir(): Date {\n return this.timeAtAngle(10.2, true);\n }\n /**\n * Utility method for using elevation-aware sunrise/sunset\n * @private\n * @param hours\n */\n getShaahZmanisBasedZman(hours: number): Date {\n const startOfDay = this.useElevation\n ? this.noaa.getSunrise()\n : this.noaa.getSeaLevelSunrise();\n const endOfDay = this.useElevation\n ? this.noaa.getSunset()\n : this.noaa.getSeaLevelSunset();\n const temporalHour = this.noaa.getTemporalHour(startOfDay, endOfDay);\n const offset = Math.round(temporalHour * hours);\n const zdt = NOAACalculator.getTimeOffset(startOfDay, offset);\n return zdtToDate(zdt);\n }\n /**\n * Latest Shema (Gra); Sunrise plus 3 halachic hours, according to the Gra.\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n sofZmanShma(): Date {\n // Gra\n return this.getShaahZmanisBasedZman(3);\n }\n /**\n * Latest Shacharit (Gra); Sunrise plus 4 halachic hours, according to the Gra.\n *\n * This method returns the latest *zman tfila* (time to recite shema in the morning)\n * that is 4 *shaos zmaniyos* (solar hours) after sunrise or sea level sunrise\n * (depending on the `useElevation` setting), according\n * to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).\n *\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n sofZmanTfilla(): Date {\n // Gra\n return this.getShaahZmanisBasedZman(4);\n }\n /**\n * Returns an array with alot (Date) and ms in hour (number)\n * @private\n */\n getTemporalHour72(forceSeaLevel: boolean): [Date, number] {\n const alot72 = this.sunriseOffset(-72, false, forceSeaLevel);\n const tzeit72 = this.sunsetOffset(72, false, forceSeaLevel);\n const temporalHour = (tzeit72.getTime() - alot72.getTime()) / 12;\n return [alot72, temporalHour];\n }\n /**\n * Returns an array with alot (Date) and ms in hour (number)\n * @private\n */\n getTemporalHourByDeg(angle: number): [Date, number] {\n const alot = this.timeAtAngle(angle, true);\n const tzeit = this.timeAtAngle(angle, false);\n const temporalHour = (tzeit.getTime() - alot.getTime()) / 12;\n return [alot, temporalHour];\n }\n /**\n * Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.\n * Based on the opinion of the MGA that the day is calculated from\n * dawn being fixed 72 minutes before sea-level sunrise, and nightfall is fixed\n * 72 minutes after sea-level sunset.\n */\n sofZmanShmaMGA(): Date {\n // Magen Avraham\n const [alot72, temporalHour] = this.getTemporalHour72(true);\n const offset = Math.floor(3 * temporalHour);\n return new Date(alot72.getTime() + offset);\n }\n /**\n * Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.\n * Based on the opinion of the MGA that the day is calculated from\n * dawn to nightfall with both being 16.1° below the horizon.\n */\n sofZmanShmaMGA16Point1(): Date {\n const [alot, temporalHour] = this.getTemporalHourByDeg(16.1);\n const offset = Math.floor(3 * temporalHour);\n return new Date(alot.getTime() + offset);\n }\n /**\n * Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.\n * Based on the opinion of the MGA that the day is calculated from\n * dawn to nightfall with both being 19.8° below the horizon.\n *\n * This calculation is based on the position of the sun 90 minutes after sunset in Jerusalem\n * around the equinox / equilux which calculates to 19.8° below geometric zenith.\n * https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/\n */\n sofZmanShmaMGA19Point8(): Date {\n const [alot, temporalHour] = this.getTemporalHourByDeg(19.8);\n const offset = Math.floor(3 * temporalHour);\n return new Date(alot.getTime() + offset);\n }\n /**\n * Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham\n */\n sofZmanTfillaMGA(): Date {\n // Magen Avraham\n const [alot72, temporalHour] = this.getTemporalHour72(true);\n const offset = Math.floor(4 * temporalHour);\n return new Date(alot72.getTime() + offset);\n }\n /**\n * Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham.\n * Based on the opinion of the MGA that the day is calculated from\n * dawn to nightfall with both being 16.1° below the horizon.\n */\n sofZmanTfillaMGA16Point1(): Date {\n const [alot, temporalHour] = this.getTemporalHourByDeg(16.1);\n const offset = Math.floor(4 * temporalHour);\n return new Date(alot.getTime() + offset);\n }\n /**\n * Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham.\n * Based on the opinion of the MGA that the day is calculated from\n * dawn to nightfall with both being 19.8° below the horizon.\n *\n * This calculation is based on the position of the sun 90 minutes after sunset in Jerusalem\n * around the equinox / equilux which calculates to 19.8° below geometric zenith.\n * https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/\n */\n sofZmanTfillaMGA19Point8(): Date {\n const [alot, temporalHour] = this.getTemporalHourByDeg(19.8);\n const offset = Math.floor(4 * temporalHour);\n return new Date(alot.getTime() + offset);\n }\n /**\n * Earliest Mincha – Mincha Gedola (GRA); Sunrise plus 6.5 halachic hours.\n * If elevation is enabled, this function will include elevation in the calculation.\n *\n * This method returns the latest mincha gedola, the earliest time one can pray mincha\n * that is 6.5 shaos zmaniyos (solar hours) after sunrise or sea level sunrise\n * (depending on the `useElevation` setting), according\n * to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).\n *\n * The Ramba\"m is of the opinion that it is better to delay *mincha* until\n * *mincha ketana* while the Ra\"sh, Tur, GRA and others are of the\n * opinion that *mincha* can be prayed *lechatchila* starting at *mincha gedola*.\n */\n minchaGedola(): Date {\n return this.getShaahZmanisBasedZman(6.5);\n }\n /**\n * Earliest Mincha – Mincha Gedola (MGA); Sunrise plus 6.5 halachic hours.\n * If elevation is enabled, this function will include elevation in the calculation.\n *\n * This method returns the time of *mincha gedola* according to the Magen Avraham\n * with the day starting 72 minutes before sunrise and ending 72 minutes after sunset.\n * This is the earliest time to pray *mincha*.\n */\n minchaGedolaMGA(): Date {\n const [alot72, temporalHour] = this.getTemporalHour72(false);\n const offset = Math.floor(6.5 * temporalHour);\n return new Date(alot72.getTime() + offset);\n }\n /**\n * Preferable earliest time to recite Minchah – Mincha Ketana; Sunrise plus 9.5 halachic hours.\n * If elevation is enabled, this function will include elevation in the calculation.\n *\n * This method returns *mincha ketana*, the preferred earliest time to pray *mincha* in the\n * opinion of the [Rambam](https://en.wikipedia.org/wiki/Maimonides) and others,\n * that is 9.5 *shaos zmaniyos* (solar hours) after sunrise or sea level sunrise\n * (depending on the `useElevation` setting), according\n * to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).\n */\n minchaKetana(): Date {\n return this.getShaahZmanisBasedZman(9.5);\n }\n /**\n * This method returns the time of *mincha ketana* according to the Magen Avraham\n * with the day starting 72 minutes before sunrise and ending 72 minutes after sunset.\n * This is the preferred earliest time to pray *mincha* according to the opinion of\n * the [Rambam](https://en.wikipedia.org/wiki/Maimonides) and others.\n *\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n minchaKetanaMGA(): Date {\n const [alot72, temporalHour] = this.getTemporalHour72(false);\n return new Date(alot72.getTime() + Math.floor(9.5 * temporalHour));\n }\n /**\n * Plag haMincha; Sunrise plus 10.75 halachic hours.\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n plagHaMincha(): Date {\n return this.getShaahZmanisBasedZman(10.75);\n }\n /**\n * @param [angle=8.5] optional time for solar depression.\n * Default is 8.5 degrees for 3 small stars, use 7.083 degrees for 3 medium-sized stars.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n tzeit(angle = 8.5): Date {\n return this.timeAtAngle(angle, false);\n }\n /**\n * Alias for sunrise\n */\n neitzHaChama(): Date {\n return this.sunrise();\n }\n /**\n * Alias for sunset\n */\n shkiah(): Date {\n return this.sunset();\n }\n /**\n * Rabbeinu Tam holds that bein hashmashos is a specific time\n * between sunset and tzeis hakochavim.\n * One opinion on how to calculate this time is that\n * it is 13.5 minutes before tzies 7.083.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n beinHaShmashos(): Date {\n const tzeit = this.tzeit(7.083);\n const millis = tzeit.getTime();\n if (isNaN(millis)) {\n return tzeit;\n }\n return new Date(millis - 13.5 * 60 * 1000);\n }\n /**\n * Uses timeFormat to return a date like '20:34'.\n * Returns `XX:XX` if the date is invalid.\n */\n static formatTime(dt: Date, timeFormat: Intl.DateTimeFormat): string {\n if (isNaN(dt.getTime())) {\n return 'XX:XX'; // Invalid Date\n }\n const time = timeFormat.format(dt);\n const hm = time.split(':');\n if (hm[0] === '24') {\n return '00:' + hm[1];\n }\n return time;\n }\n\n /**\n * Discards seconds, rounding to nearest minute.\n * @param dt\n */\n static roundTime(dt: Date): Date {\n const millis = dt.getTime();\n if (isNaN(millis)) {\n return dt;\n }\n // Round up to next minute if needed\n const millisOnly = dt.getMilliseconds();\n const seconds = dt.getSeconds();\n if (seconds === 0 && millisOnly === 0) {\n return dt;\n }\n const secAndMillis = seconds * 1000 + millisOnly;\n const delta =\n secAndMillis >= 30000 ? 60000 - secAndMillis : -1 * secAndMillis;\n return new Date(millis + delta);\n }\n\n /**\n * Get offset string (like \"+05:00\" or \"-08:00\") from tzid (like \"Europe/Moscow\")\n * @param tzid\n * @param date\n */\n static timeZoneOffset(tzid: string, date: Date): string {\n const offset = getTimezoneOffset(tzid, date);\n const offsetAbs = Math.abs(offset);\n const hours = Math.floor(offsetAbs / 60);\n const minutes = offsetAbs % 60;\n return (offset < 0 ? '+' : '-') + pad2(hours) + ':' + pad2(minutes);\n }\n\n /**\n * Returns a string like \"2022-04-01T13:06:00-11:00\"\n * @param tzid\n * @param date\n */\n static formatISOWithTimeZone(tzid: string, date: Date): string {\n if (isNaN(date.getTime())) {\n return '0000-00-00T00:00:00Z';\n }\n return (\n getPseudoISO(tzid, date).substring(0, 19) +\n Zmanim.timeZoneOffset(tzid, date)\n );\n }\n\n /**\n * Returns sunrise + `offset` minutes (either positive or negative).\n * If elevation is enabled, this function will include elevation in the calculation\n * unless `forceSeaLevel` is `true`.\n * @param offset minutes\n * @param roundMinute round time to nearest minute (default true)\n * @param forceSeaLevel use sea-level sunrise (default false)\n */\n sunriseOffset(\n offset: number,\n roundMinute = true,\n forceSeaLevel = false\n ): Date {\n const sunrise = forceSeaLevel ? this.seaLevelSunrise() : this.sunrise();\n if (isNaN(sunrise.getTime())) {\n return sunrise;\n }\n if (roundMinute) {\n // For positive offsets only, round up to next minute if needed\n if (offset > 0 && sunrise.getSeconds() >= 30) {\n offset++;\n }\n sunrise.setSeconds(0, 0);\n }\n return new Date(sunrise.getTime() + offset * 60 * 1000);\n }\n\n /**\n * Returns sunset + `offset` minutes (either positive or negative).\n * If elevation is enabled, this function will include elevation in the calculation\n * unless `forceSeaLevel` is `true`.\n * @param offset minutes\n * @param roundMinute round time to nearest minute (default true)\n * @param forceSeaLevel use sea-level sunset (default false)\n */\n sunsetOffset(\n offset: number,\n roundMinute = true,\n forceSeaLevel = false\n ): Date {\n const sunset = forceSeaLevel ? this.seaLevelSunset() : this.sunset();\n if (isNaN(sunset.getTime())) {\n return sunset;\n }\n if (roundMinute) {\n // For Havdalah only, round up to next minute if needed\n if (offset > 0 && sunset.getSeconds() >= 30) {\n offset++;\n }\n sunset.setSeconds(0, 0);\n }\n return new Date(sunset.getTime() + offset * 60 * 1000);\n }\n /**\n * Returns the Hebrew date relative to the specified location and Gregorian date,\n * taking into consideration whether the time is before or after sunset.\n *\n * For example, if the given date and is `2024-09-22T10:35` (before sunset), and\n * sunset for the specified location is **19:04**, then this function would\n * return a Hebrew date of `19th of Elul, 5784`.\n * If the given date is the same Gregorian day after sunset\n * (for example `2024-09-22T20:07`), this function would return a\n * Hebrew date of `20th of Elul, 5784`.\n * @example\n * const {GeoLocation, Zmanim, HDate} = require('@hebcal/core');\n * const latitude = 48.85341;\n * const longitude = 2.3488;\n * const timezone = 'Europe/Paris';\n * const gloc = new GeoLocation(null, latitude, longitude, 0, timezone);\n * const before = Zmanim.makeSunsetAwareHDate(gloc, new Date('2024-09-22T17:38:46.123Z'), false);\n * console.log(before.toString()); // '19 Elul 5784'\n * const after = Zmanim.makeSunsetAwareHDate(gloc, new Date('2024-09-22T23:45:18.345Z'), false);\n * console.log(after.toString()); // '20 Elul 5784'\n */\n static makeSunsetAwareHDate(\n gloc: GeoLocation,\n date: Date,\n useElevation: boolean\n ): HDate {\n const zmanim = new Zmanim(gloc, date, useElevation);\n const sunset = zmanim.sunset();\n let hd = new HDate(date);\n const sunsetMillis = sunset.getTime();\n if (isNaN(sunsetMillis)) {\n return hd;\n }\n if (date.getTime() >= sunsetMillis) {\n hd = hd.next();\n }\n return hd;\n }\n}\n"],"names":[],"mappings":";;;;;AAUA;;AAEG;AACH,SAAS,SAAS,CAAC,GAAkC,EAAA;AACnD,IAAA,IAAI,GAAG,KAAK,IAAI,EAAE;AAChB,QAAA,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC;IACtB;IACA,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC;AAC3C,IAAA,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC;AACtB,IAAA,OAAO,GAAG;AACZ;AAEA,SAAS,OAAO,CAAC,IAAkB,EAAA;IACjC,IAAI,MAAM,CAAC,IAAI,CAAC;AAAE,QAAA,OAAO,IAAY;AACrC,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;AAAE,QAAA,OAAQ,IAAc,CAAC,IAAI,EAAE;AACtD,IAAA,MAAM,IAAI,SAAS,CAAC,iBAAiB,IAAI,CAAA,CAAE,CAAC;AAC9C;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;MACU,MAAM,CAAA;AAKjB;;;;;;;;;;AAUG;AACH,IAAA,WAAA,CAAY,IAAiB,EAAE,IAAkB,EAAE,YAAqB,EAAA;AACtE,QAAA,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;AACxB,QAAA,IAAI,CAAC,IAAI,GAAG,EAAE;AACd,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI;AAChB,QAAA,MAAM,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC;AACxC,YAAA,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,CAAC,YAAY,CAAC,EAAE;AACvB,YAAA,OAAO,EAAE;QACX;AACA,QAAA,IAAI,IAAI,CAAC,OAAO,EAAE,IAAI,YAAY,EAAE;AAClC,YAAA,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE;QAChB;AACA,QAAA,OAAO,EAAE;IACX;AACD;;;;"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/*! @hebcal/core v5.10.
|
|
1
|
+
/*! @hebcal/core v5.10.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
require('temporal-polyfill/global');
|
|
5
5
|
|
|
6
6
|
/** DO NOT EDIT THIS AUTO-GENERATED FILE! */
|
|
7
|
-
const version = '5.10.
|
|
7
|
+
const version = '5.10.1';
|
|
8
8
|
|
|
9
9
|
/*! @hebcal/hdate v0.14.2, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
10
10
|
/* eslint-disable @typescript-eslint/no-namespace, no-inner-declarations */
|
|
@@ -1874,9 +1874,9 @@ function onOrBefore(day, t, offset) {
|
|
|
1874
1874
|
|
|
1875
1875
|
var poAshkenazi = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);", "language": "en_CA@ashkenazi" }, "contexts": { "": { "Shabbat": ["Shabbos"], "Achrei Mot": ["Achrei Mos"], "Bechukotai": ["Bechukosai"], "Beha'alotcha": ["Beha’aloscha"], "Bereshit": ["Bereshis"], "Chukat": ["Chukas"], "Erev Shavuot": ["Erev Shavuos"], "Erev Sukkot": ["Erev Sukkos"], "Ki Tavo": ["Ki Savo"], "Ki Teitzei": ["Ki Seitzei"], "Ki Tisa": ["Ki Sisa"], "Matot": ["Matos"], "Purim Katan": ["Purim Koton"], "Shabbat Chazon": ["Shabbos Chazon"], "Shabbat HaChodesh": ["Shabbos HaChodesh"], "Shabbat HaGadol": ["Shabbos HaGadol"], "Shabbat Nachamu": ["Shabbos Nachamu"], "Shabbat Parah": ["Shabbos Parah"], "Shabbat Shekalim": ["Shabbos Shekalim"], "Shabbat Shuva": ["Shabbos Shuvah"], "Shabbat Zachor": ["Shabbos Zachor"], "Shavuot": ["Shavuos"], "Shavuot I": ["Shavuos I"], "Shavuot II": ["Shavuos II"], "Shemot": ["Shemos"], "Shmini Atzeret": ["Shmini Atzeres"], "Simchat Torah": ["Simchas Torah"], "Sukkot": ["Sukkos"], "Sukkot I": ["Sukkos I"], "Sukkot II": ["Sukkos II"], "Sukkot II (CH''M)": ["Sukkos II (CH’’M)"], "Sukkot III (CH''M)": ["Sukkos III (CH’’M)"], "Sukkot IV (CH''M)": ["Sukkos IV (CH’’M)"], "Sukkot V (CH''M)": ["Sukkos V (CH’’M)"], "Sukkot VI (CH''M)": ["Sukkos VI (CH’’M)"], "Sukkot VII (Hoshana Raba)": ["Sukkos VII (Hoshana Raba)"], "Ta'anit Bechorot": ["Ta’anis Bechoros"], "Ta'anit Esther": ["Ta’anis Esther"], "Toldot": ["Toldos"], "Vaetchanan": ["Vaeschanan"], "Yitro": ["Yisro"], "Vezot Haberakhah": ["Vezos Haberakhah"], "Parashat": ["Parshas"], "Leil Selichot": ["Leil Selichos"], "Shabbat Mevarchim Chodesh": ["Shabbos Mevorchim Chodesh"], "Shabbat Shirah": ["Shabbos Shirah"], "Asara B'Tevet": ["Asara B’Teves"], "Alot HaShachar": ["Alos HaShachar"], "Kriat Shema, sof zeman": ["Krias Shema, sof zman"], "Tefilah, sof zeman": ["Tefilah, sof zman"], "Kriat Shema, sof zeman (MGA)": ["Krias Shema, sof zman (MGA)"], "Tefilah, sof zeman (MGA)": ["Tefilah, sof zman (MGA)"], "Chatzot HaLailah": ["Chatzos HaLailah"], "Chatzot hayom": ["Chatzos"], "Tzeit HaKochavim": ["Tzeis HaKochavim"], "Birkat Hachamah": ["Birkas Hachamah"], "Shushan Purim Katan": ["Shushan Purim Koton"] } } };
|
|
1876
1876
|
|
|
1877
|
-
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": ["
|
|
1877
|
+
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": ["פֶּסַח ח׳"], "Purim": ["פּוּרִים"], "Purim Katan": ["פּוּרִים קָטָן"], "Rosh Chodesh %s": ["רֹאשׁ חוֹדֶשׁ %s"], "Rosh Chodesh": ["רֹאשׁ חוֹדֶשׁ"], "Rosh Hashana": ["רֹאשׁ הַשָּׁנָה"], "Rosh Hashana I": ["רֹאשׁ הַשָּׁנָה א׳"], "Rosh Hashana II": ["רֹאשׁ הַשָּׁנָה ב׳"], "Shabbat Chazon": ["שַׁבַּת חֲזוֹן"], "Shabbat HaChodesh": ["שַׁבַּת הַחֹדֶשׁ"], "Shabbat HaGadol": ["שַׁבַּת הַגָּדוֹל"], "Shabbat Nachamu": ["שַׁבַּת נַחֲמוּ"], "Shabbat Parah": ["שַׁבַּת פָּרָה"], "Shabbat Shekalim": ["שַׁבַּת שְׁקָלִים"], "Shabbat Shuva": ["שַׁבַּת שׁוּבָה"], "Shabbat Zachor": ["שַׁבַּת זָכוֹר"], "Shavuot": ["שָׁבוּעוֹת"], "Shavuot I": ["שָׁבוּעוֹת א׳"], "Shavuot II": ["שָׁבוּעוֹת ב׳"], "Shmini Atzeret": ["שְׁמִינִי עֲצֶרֶת"], "Shushan Purim": ["שׁוּשָׁן פּוּרִים"], "Sigd": ["חַג הַסִּיגְד"], "Simchat Torah": ["שִׂמְחַת תּוֹרָה"], "Sukkot": ["סוּכּוֹת"], "Sukkot I": ["סוּכּוֹת א׳"], "Sukkot II": ["סוּכּוֹת ב׳"], "Sukkot II (CH''M)": ["סוּכּוֹת ב׳ (חוה״מ)"], "Sukkot III (CH''M)": ["סוּכּוֹת ג׳ (חוה״מ)"], "Sukkot IV (CH''M)": ["סוּכּוֹת ד׳ (חוה״מ)"], "Sukkot V (CH''M)": ["סוּכּוֹת ה׳ (חוה״מ)"], "Sukkot VI (CH''M)": ["סוּכּוֹת ו׳ (חוה״מ)"], "Sukkot VII (Hoshana Raba)": ["סוּכּוֹת ז׳ (הוֹשַׁעְנָא רַבָּה)"], "Ta'anit Bechorot": ["תַּעֲנִית בְּכוֹרוֹת"], "Ta'anit Esther": ["תַּעֲנִית אֶסְתֵּר"], "Tish'a B'Av": ["תִּשְׁעָה בְּאָב"], "Tu B'Av": ["ט״וּ בְּאָב"], "Tu BiShvat": ["ט״וּ בִּשְׁבָט"], "Tu B'Shvat": ["ט״וּ בִּשְׁבָט"], "Tzom Gedaliah": ["צוֹם גְּדַלְיָה"], "Tzom Tammuz": ["צוֹם י״ז בְּתַמּוּז"], "Yom HaAtzma'ut": ["יוֹם הָעַצְמָאוּת"], "Yom HaShoah": ["יוֹם הַשּׁוֹאָה"], "Yom HaZikaron": ["יוֹם הַזִּכָּרוֹן"], "Yom Kippur": ["יוֹם כִּפּוּר"], "Yom Yerushalayim": ["יוֹם יְרוּשָׁלַיִם"], "Yom HaAliyah": ["יוֹם הַעֲלִיָּה"], "Yom HaAliyah School Observance": ["שְׁמִירָת בֵּית הַסֵפֶר לְיוֹם הַעֲלִיָּה"], "Rosh Chodesh Adar": ["רֹאשׁ חוֹדֶשׁ אֲדָר"], "Rosh Chodesh Adar I": ["רֹאשׁ חוֹדֶשׁ אֲדָר א׳"], "Rosh Chodesh Adar II": ["רֹאשׁ חוֹדֶשׁ אֲדָר ב׳"], "Rosh Chodesh Av": ["רֹאשׁ חוֹדֶשׁ אָב"], "Rosh Chodesh Cheshvan": ["רֹאשׁ חוֹדֶשׁ חֶשְׁוָן"], "Rosh Chodesh Elul": ["רֹאשׁ חוֹדֶשׁ אֱלוּל"], "Rosh Chodesh Iyyar": ["רֹאשׁ חוֹדֶשׁ אִיָּיר"], "Rosh Chodesh Kislev": ["רֹאשׁ חוֹדֶשׁ כִּסְלֵו"], "Rosh Chodesh Nisan": ["רֹאשׁ חוֹדֶשׁ נִיסָן"], "Rosh Chodesh Sh'vat": ["רֹאשׁ חוֹדֶשׁ שְׁבָט"], "Rosh Chodesh Sivan": ["רֹאשׁ חוֹדֶשׁ סִיוָן"], "Rosh Chodesh Tamuz": ["רֹאשׁ חוֹדֶשׁ תַּמּוּז"], "Rosh Chodesh Tevet": ["רֹאשׁ חוֹדֶשׁ טֵבֵת"], "min": ["דַּקּוֹת"], "Fast begins": ["תְּחִילַּת הַצוֹם"], "Fast ends": ["סִיּוּם הַצוֹם"], "Rosh Hashana LaBehemot": ["רֹאשׁ הַשָּׁנָה לְמַעְשַׂר בְּהֵמָה"], "Tish'a B'Av (observed)": ["(תִּשְׁעָה בְּאָב (נִדְחָה"], "Shabbat Mevarchim Chodesh": ["שַׁבַּת מְבָרְכִים חוֹדֶשׁ"], "Shabbat Shirah": ["שַׁבַּת שִׁירָה"], "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": ["בִּרְכַּת הַחַמָּה"], "Shushan Purim Katan": ["שׁוּשָׁן פּוּרִים קָטָן"], "Purim Meshulash": ["פּוּרִים מְשׁוּלָּשׁ"], "Chag HaBanot": ["חַג הַבָּנוֹת"], "Molad": ["מוֹלָד הָלְּבָנָה"], "chalakim": ["חֲלָקִים"] } } };
|
|
1878
1878
|
|
|
1879
|
-
var noNikudOverride = { "headers": { "plural-forms": "nplurals=2; plural=(n != 1);", "language": "he-x-NoNikud" }, "contexts": { "": { "Korach": ["קורח"] } } };
|
|
1879
|
+
var noNikudOverride = { "headers": { "plural-forms": "nplurals=2; plural=(n != 1);", "language": "he-x-NoNikud" }, "contexts": { "": { "Korach": ["קורח"], "Chukat": ["חוקת"] } } };
|
|
1880
1880
|
|
|
1881
1881
|
Locale.addTranslations('he', poHe);
|
|
1882
1882
|
Locale.addTranslations('h', poHe);
|