@hebcal/core 5.7.7 → 5.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CalOptions.d.ts +12 -0
- package/dist/bundle.js +46 -2
- package/dist/bundle.js.map +1 -1
- package/dist/bundle.min.js +4 -4
- package/dist/bundle.min.js.map +1 -1
- package/dist/calendar.d.ts +1 -0
- package/dist/esm/CalOptions.d.ts +12 -0
- package/dist/esm/DailyLearning.js +1 -1
- package/dist/esm/HebrewDateEvent.js +1 -1
- package/dist/esm/HolidayEvent.js +1 -1
- package/dist/esm/MevarchimChodeshEvent.js +1 -1
- package/dist/esm/ParshaEvent.js +1 -1
- package/dist/esm/TimedEvent.js +1 -1
- package/dist/esm/YomKippurKatanEvent.js +1 -1
- package/dist/esm/ashkenazi.po.js +1 -1
- package/dist/esm/calendar.d.ts +1 -0
- package/dist/esm/calendar.js +20 -2
- package/dist/esm/calendar.js.map +1 -1
- package/dist/esm/candles.js +1 -1
- package/dist/esm/event.d.ts +2 -0
- package/dist/esm/event.js +3 -1
- package/dist/esm/event.js.map +1 -1
- package/dist/esm/getStartAndEnd.js +1 -1
- package/dist/esm/hallel.js +1 -1
- package/dist/esm/he.po.js +1 -1
- package/dist/esm/hebcal.d.ts +1 -0
- package/dist/esm/hebcal.js +2 -1
- package/dist/esm/hebcal.js.map +1 -1
- package/dist/esm/holidays.js +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/locale.js +1 -1
- package/dist/esm/location.js +1 -1
- package/dist/esm/modern.js +1 -1
- package/dist/esm/molad.js +1 -1
- package/dist/esm/omer.js +1 -1
- package/dist/esm/parshaName.js +1 -1
- package/dist/esm/parshaYear.d.ts +9 -0
- package/dist/esm/parshaYear.js +29 -0
- package/dist/esm/parshaYear.js.map +1 -0
- package/dist/esm/pkgVersion.d.ts +1 -1
- package/dist/esm/pkgVersion.js +2 -2
- package/dist/esm/pkgVersion.js.map +1 -1
- package/dist/esm/reformatTimeStr.js +1 -1
- package/dist/esm/sedra.js +1 -1
- package/dist/esm/staticHolidays.js +1 -1
- package/dist/esm/tachanun.js +1 -1
- package/dist/esm/zmanim.js +1 -1
- package/dist/event.d.ts +2 -0
- package/dist/hebcal.d.ts +1 -0
- package/dist/index.cjs +46 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/parshaYear.d.ts +9 -0
- package/dist/pkgVersion.d.ts +1 -1
- package/package.json +1 -1
package/dist/esm/hebcal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hebcal.js","sources":["../../../src/hebcal.ts"],"sourcesContent":["/*\n Hebcal - A Jewish Calendar Generator\n Copyright (c) 1994-2020 Danny Sadinoff\n Portions copyright Eyal Schachter and Michael J. Radwin\n\n https://github.com/hebcal/hebcal-es6\n\n This program is free software; you can redistribute it and/or\n modify it under the terms of the GNU General Public License\n as published by the Free Software Foundation; either version 2\n of the License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport {getBirthdayHD, getYahrzeitHD, HDate, months} from '@hebcal/hdate';\nimport './locale'; // Adds Hebrew and Ashkenazic translations\nimport {CalOptions} from './CalOptions';\nimport {version as pkgVersion} from './pkgVersion';\nimport {Event, flags} from './event';\nimport {Sedra, getSedra} from './sedra';\nimport {hallel_} from './hallel';\nimport {\n getHolidaysForYear_,\n getHolidaysForYearArray,\n getHolidaysOnDate,\n HolidayYearMap,\n} from './holidays';\nimport {HolidayEvent} from './HolidayEvent';\nimport {reformatTimeStr} from './reformatTimeStr';\nimport {TachanunResult, tachanun} from './tachanun';\nimport {calendar} from './calendar';\n\n/**\n * HebrewCalendar is the main interface to the `@hebcal/core` library.\n * This namespace is used to calculate holidays, rosh chodesh, candle lighting & havdalah times,\n * Parashat HaShavua, Daf Yomi, days of the omer, and the molad.\n * Event names can be rendered in several languges using the `locale` option.\n */\nexport class HebrewCalendar {\n private constructor() {}\n /**\n * Calculates holidays and other Hebrew calendar events based on {@link CalOptions}.\n *\n * Each holiday is represented by an {@link Event} object which includes a date,\n * a description, flags and optional attributes.\n * If given no options, returns holidays for the Diaspora for the current Gregorian year.\n *\n * The date range returned by this function can be controlled by:\n * * `options.year` - Gregorian (e.g. 1993) or Hebrew year (e.g. 5749)\n * * `options.isHebrewYear` - to interpret `year` as Hebrew year\n * * `options.numYears` - generate calendar for multiple years (default 1)\n * * `options.month` - Gregorian or Hebrew month (to filter results to a single month)\n *\n * Alternatively, specify start and end days with `Date` or {@link HDate} instances:\n * * `options.start` - use specific start date (requires `end` date)\n * * `options.end` - use specific end date (requires `start` date)\n *\n * Unless `options.noHolidays == true`, default holidays include:\n * * Major holidays - Rosh Hashana, Yom Kippur, Pesach, Sukkot, etc.\n * * Minor holidays - Purim, Chanukah, Tu BiShvat, Lag BaOmer, etc.\n * * Minor fasts - Ta'anit Esther, Tzom Gedaliah, etc. (unless `options.noMinorFast`)\n * * Special Shabbatot - Shabbat Shekalim, Zachor, etc. (unless `options.noSpecialShabbat`)\n * * Modern Holidays - Yom HaShoah, Yom HaAtzma'ut, etc. (unless `options.noModern`)\n * * Rosh Chodesh (unless `options.noRoshChodesh`)\n *\n * Holiday and Torah reading schedules differ between Israel and the Disapora.\n * Set `options.il=true` to use the Israeli schedule.\n *\n * Additional non-default event types can be specified:\n * * Parashat HaShavua - weekly Torah Reading on Saturdays (`options.sedrot`)\n * * Counting of the Omer (`options.omer`)\n * * Shabbat Mevarchim HaChodesh on Saturday before Rosh Chodesh (`options.shabbatMevarchim`)\n * * Molad announcement on Saturday before Rosh Chodesh (`options.molad`)\n * * Yom Kippur Katan (`options.yomKippurKatan`)\n *\n * Daily Study of texts are supported by the\n * {@link https://github.com/hebcal/hebcal-learning @hebcal/learning} package,\n * for example:\n * * Babylonian Talmud Daf Yomi (`options.dailyLearning.dafYomi`)\n * * Jerusalem Talmud (Yerushalmi) Yomi (`options.dailyLearning.yerushalmi`)\n * * Mishna Yomi (`options.dailyLearning.mishnaYomi`)\n * * Nach Yomi (`options.dailyLearning.nachYomi`)\n *\n * Candle-lighting and Havdalah times are approximated using latitude and longitude\n * specified by the {@link Location} class. The `Location` class contains a small\n * database of cities with their associated geographic information and time-zone information.\n * If you ever have any doubts about Hebcal's times, consult your local halachic authority.\n * If you enter geographic coordinates above the arctic circle or antarctic circle,\n * the times are guaranteed to be wrong.\n *\n * To add candle-lighting options, set `options.candlelighting=true` and set\n * `options.location` to an instance of `Location`. By default, candle lighting\n * time is 18 minutes before sundown (40 minutes for Jerusalem,\n * 30 minutes for Haifa and Zikhron Ya'akov) and Havdalah is\n * calculated according to Tzeit Hakochavim - Nightfall (the point when 3 small stars\n * are observable in the night time sky with the naked eye). The default Havdalah\n * option (Tzeit Hakochavim) is calculated when the sun is 8.5° below the horizon.\n * These defaults can be changed using these options:\n * * `options.candleLightingMins` - minutes before sundown to light candles\n * * `options.havdalahMins` - minutes after sundown for Havdalah (typical values are 42, 50, or 72).\n * Havdalah times are suppressed when `options.havdalahMins=0`.\n * * `options.havdalahDeg` - degrees for solar depression for Havdalah.\n * Default is 8.5 degrees for 3 small stars. Use 7.083 degrees for 3 medium-sized stars.\n * Havdalah times are suppressed when `options.havdalahDeg=0`.\n *\n * If both `options.candlelighting=true` and `options.location` is specified,\n * Chanukah candle-lighting times and minor fast start/end times will also be generated.\n * Chanukah candle-lighting is at Bein HaShmashos (13.5 minutes before\n * the sun is 7.083° below the horizon in the evening)\n * on weekdays, at regular candle-lighting time on Fridays, and at regular Havdalah time on\n * Saturday night (see above).\n *\n * Minor fasts begin at Alot HaShachar (sun is 16.1° below the horizon in the morning) and\n * end when 3 medium-sized stars are observable in the night sky (sun is 7.083° below the horizon\n * in the evening).\n *\n * Two options also exist for generating an Event with the Hebrew date:\n * * `options.addHebrewDates` - print the Hebrew date for the entire date range\n * * `options.addHebrewDatesForEvents` - print the Hebrew date for dates with some events\n *\n * Lastly, translation and transliteration of event titles is controlled by\n * `options.locale` and the {@link Locale} API.\n * `@hebcal/core` supports three locales by default:\n * * `en` - default, Sephardic transliterations (e.g. \"Shabbat\")\n * * `ashkenazi` - Ashkenazi transliterations (e.g. \"Shabbos\")\n * * `he` - Hebrew (e.g. \"שַׁבָּת\")\n *\n * Additional locales (such as `ru` or `fr`) are supported by the\n * {@link https://github.com/hebcal/hebcal-locales @hebcal/locales} package\n *\n * @example\n * import {HebrewCalendar, HDate, Location, Event} from '@hebcal/core';\n * const options: CalOptions = {\n * year: 1981,\n * isHebrewYear: false,\n * candlelighting: true,\n * location: Location.lookup('San Francisco'),\n * sedrot: true,\n * omer: true,\n * };\n * const events = HebrewCalendar.calendar(options);\n * for (const ev of events) {\n * const hd = ev.getDate();\n * const date = hd.greg();\n * console.log(date.toLocaleDateString(), ev.render('en'), hd.toString());\n * }\n */\n static calendar(options: CalOptions = {}): Event[] {\n return calendar(options);\n }\n\n /**\n * Calculates a birthday or anniversary (non-yahrzeit).\n * `hyear` must be after original `gdate` of anniversary.\n * Returns `undefined` when requested year preceeds or is same as original year.\n *\n * Hebcal uses the algorithm defined in \"Calendrical Calculations\"\n * by Edward M. Reingold and Nachum Dershowitz.\n *\n * The birthday of someone born in Adar of an ordinary year or Adar II of\n * a leap year is also always in the last month of the year, be that Adar\n * or Adar II. The birthday in an ordinary year of someone born during the\n * first 29 days of Adar I in a leap year is on the corresponding day of Adar;\n * in a leap year, the birthday occurs in Adar I, as expected.\n *\n * Someone born on the thirtieth day of Marcheshvan, Kislev, or Adar I\n * has his birthday postponed until the first of the following month in\n * years where that day does not occur. [Calendrical Calculations p. 111]\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'\n * const hd = HebrewCalendar.getBirthdayOrAnniversary(5780, dt); // '1 Nisan 5780'\n * console.log(hd.greg().toLocaleDateString('en-US')); // '3/26/2020'\n * @param hyear Hebrew year\n * @param gdate Gregorian or Hebrew date of event\n * @returns anniversary occurring in `hyear`\n */\n static getBirthdayOrAnniversary(\n hyear: number,\n gdate: Date | HDate\n ): HDate | undefined {\n const dt = getBirthdayHD(hyear, gdate);\n if (typeof dt === 'undefined') {\n return dt;\n }\n return new HDate(dt);\n }\n\n /**\n * Calculates yahrzeit.\n * `hyear` must be after original `gdate` of death.\n * Returns `undefined` when requested year preceeds or is same as original year.\n *\n * Hebcal uses the algorithm defined in \"Calendrical Calculations\"\n * by Edward M. Reingold and Nachum Dershowitz.\n *\n * The customary anniversary date of a death is more complicated and depends\n * also on the character of the year in which the first anniversary occurs.\n * There are several cases:\n *\n * * If the date of death is Marcheshvan 30, the anniversary in general depends\n * on the first anniversary; if that first anniversary was not Marcheshvan 30,\n * use the day before Kislev 1.\n * * If the date of death is Kislev 30, the anniversary in general again depends\n * on the first anniversary — if that was not Kislev 30, use the day before\n * Tevet 1.\n * * If the date of death is Adar II, the anniversary is the same day in the\n * last month of the Hebrew year (Adar or Adar II).\n * * If the date of death is Adar I 30, the anniversary in a Hebrew year that\n * is not a leap year (in which Adar only has 29 days) is the last day in\n * Shevat.\n * * In all other cases, use the normal (that is, same month number) anniversary\n * of the date of death. [Calendrical Calculations p. 113]\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'\n * const hd = HebrewCalendar.getYahrzeit(5780, dt); // '30 Sh\\'vat 5780'\n * console.log(hd.greg().toLocaleDateString('en-US')); // '2/25/2020'\n * @param hyear Hebrew year\n * @param gdate Gregorian or Hebrew date of death\n * @returns anniversary occurring in hyear\n */\n static getYahrzeit(hyear: number, gdate: Date | HDate): HDate | undefined {\n const dt = getYahrzeitHD(hyear, gdate);\n if (typeof dt === 'undefined') {\n return dt;\n }\n return new HDate(dt);\n }\n\n /**\n * Lower-level holidays interface, which returns a `Map` of `Event`s indexed by\n * `HDate.toString()`. These events must filtered especially for `flags.IL_ONLY`\n * or `flags.CHUL_ONLY` depending on Israel vs. Diaspora holiday scheme.\n * @param year Hebrew year\n */\n static getHolidaysForYear(year: number): HolidayYearMap {\n return getHolidaysForYear_(year);\n }\n\n /**\n * Returns an array of holidays for the year\n * @param year Hebrew year\n * @param il use the Israeli schedule for holidays\n */\n static getHolidaysForYearArray(year: number, il: boolean): HolidayEvent[] {\n return getHolidaysForYearArray(year, il);\n }\n\n /**\n * Returns an array of Events on this date (or `undefined` if no events)\n * @param date Hebrew Date, Gregorian date, or absolute R.D. day number\n * @param [il] use the Israeli schedule for holidays\n */\n static getHolidaysOnDate(\n date: HDate | Date | number,\n il?: boolean\n ): HolidayEvent[] | undefined {\n return getHolidaysOnDate(date, il);\n }\n\n /**\n * Eruv Tavshilin\n */\n static eruvTavshilin(date: Date | HDate, il: boolean): boolean {\n if (date.getDay() < 3 || date.getDay() > 4) {\n return false;\n }\n const today = new HDate(date);\n const friday = today.after(5);\n const tomorrow = today.next();\n if (!isChag(friday, il) || isChag(today, il) || !isChag(tomorrow, il)) {\n return false;\n }\n return true;\n }\n\n /**\n * Helper function to format a 23-hour (00:00-23:59) time in US format (\"8:13pm\") or\n * keep as \"20:13\" for any other locale/country. Uses {@link CalOptions} to determine\n * locale.\n * If `options.hour12` is `false`, locale is ignored and always returns 24-hour time.\n * If `options.hour12` is `true`, locale is ignored and always returns 12-hour time.\n * @param timeStr - original time like \"20:30\"\n * @param suffix - \"p\" or \"pm\" or \" P.M.\". Add leading space if you want it\n * @param options\n */\n static reformatTimeStr(\n timeStr: string,\n suffix: string,\n options: CalOptions\n ): string {\n return reformatTimeStr(timeStr, suffix, options);\n }\n\n static version(): string {\n return pkgVersion;\n }\n\n /**\n * Convenience function to create an instance of `Sedra` or reuse a previously\n * created and cached instance.\n */\n static getSedra(hyear: number, il: boolean): Sedra {\n return getSedra(hyear, il);\n }\n\n /**\n * Return a number containing information on what Hallel is said on that day.\n *\n * Whole Hallel is said on Chanukah, the first Yom Tov of Pesach, Shavuot, Sukkot,\n * Yom Ha'atzmaut, and Yom Yerushalayim.\n *\n * Half Hallel is said on Rosh Chodesh (not Rosh Hashanah), and the last 6 days of Pesach.\n *\n * The number is one of the following values:\n *\n * 0 - No Hallel\n * 1 - Half Hallel\n * 2 - Whole Hallel\n */\n static hallel(hdate: HDate, il: boolean): number {\n const events = getHolidaysForYearArray(hdate.getFullYear(), il);\n return hallel_(events, hdate);\n }\n\n /**\n * Return details on what Tachanun (or Tzidchatcha on Shabbat) is said on `hdate`.\n *\n * Tachanun is not said on Rosh Chodesh, the month of Nisan, Lag Baomer,\n * Rosh Chodesh Sivan until Isru Chag, Tisha B'av, 15 Av, Erev Rosh Hashanah,\n * Rosh Hashanah, Erev Yom Kippur until after Simchat Torah, Chanukah,\n * Tu B'shvat, Purim and Shushan Purim, and Purim and Shushan Purim Katan.\n *\n * In some congregations Tachanun is not said until from Rosh Chodesh Sivan\n * until 14th Sivan, Sukkot until after Rosh Chodesh Cheshvan, Pesach Sheini,\n * Yom Ha'atzmaut, and Yom Yerushalayim.\n *\n * Tachanun is not said at Mincha on days before it is not said at Shacharit.\n *\n * Tachanun is not said at Shacharit on Shabbat, but is at Mincha, usually.\n */\n static tachanun(hdate: HDate, il: boolean): TachanunResult {\n return tachanun(hdate, il);\n }\n}\n\n/**\n * @private\n */\nfunction isChag(date: HDate, il: boolean): boolean {\n const events = getHolidaysOnDate(date, il) || [];\n const chag = events.filter(ev => ev.getFlags() & flags.CHAG);\n return chag.length !== 0;\n}\n"],"names":["pkgVersion"],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;AAmBG;AAoBH;;;;;AAKG;MACU,cAAc,CAAA;AACzB,IAAA,WAAA,GAAA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAM,MAAM,GAAG,iBAAiB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE;AAChD,IAAA,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC;AAC5D,IAAA,OAAO,IAAI,CAAC,MAAM,KAAK,CAAC;AAC1B;;;;"}
|
|
1
|
+
{"version":3,"file":"hebcal.js","sources":["../../../src/hebcal.ts"],"sourcesContent":["/*\n Hebcal - A Jewish Calendar Generator\n Copyright (c) 1994-2020 Danny Sadinoff\n Portions copyright Eyal Schachter and Michael J. Radwin\n\n https://github.com/hebcal/hebcal-es6\n\n This program is free software; you can redistribute it and/or\n modify it under the terms of the GNU General Public License\n as published by the Free Software Foundation; either version 2\n of the License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport {getBirthdayHD, getYahrzeitHD, HDate} from '@hebcal/hdate';\nimport './locale'; // Adds Hebrew and Ashkenazic translations\nimport {CalOptions} from './CalOptions';\nimport {version as pkgVersion} from './pkgVersion';\nimport {Event, flags} from './event';\nimport {Sedra, getSedra} from './sedra';\nimport {hallel_} from './hallel';\nimport {\n getHolidaysForYear_,\n getHolidaysForYearArray,\n getHolidaysOnDate,\n HolidayYearMap,\n} from './holidays';\nimport {HolidayEvent} from './HolidayEvent';\nimport {reformatTimeStr} from './reformatTimeStr';\nimport {TachanunResult, tachanun} from './tachanun';\nimport {calendar} from './calendar';\n\n/**\n * HebrewCalendar is the main interface to the `@hebcal/core` library.\n * This namespace is used to calculate holidays, rosh chodesh, candle lighting & havdalah times,\n * Parashat HaShavua, Daf Yomi, days of the omer, and the molad.\n * Event names can be rendered in several languges using the `locale` option.\n */\nexport class HebrewCalendar {\n private constructor() {}\n /**\n * Calculates holidays and other Hebrew calendar events based on {@link CalOptions}.\n *\n * Each holiday is represented by an {@link Event} object which includes a date,\n * a description, flags and optional attributes.\n * If given no options, returns holidays for the Diaspora for the current Gregorian year.\n *\n * The date range returned by this function can be controlled by:\n * * `options.year` - Gregorian (e.g. 1993) or Hebrew year (e.g. 5749)\n * * `options.isHebrewYear` - to interpret `year` as Hebrew year\n * * `options.numYears` - generate calendar for multiple years (default 1)\n * * `options.month` - Gregorian or Hebrew month (to filter results to a single month)\n *\n * Alternatively, specify start and end days with `Date` or {@link HDate} instances:\n * * `options.start` - use specific start date (requires `end` date)\n * * `options.end` - use specific end date (requires `start` date)\n *\n * Unless `options.noHolidays == true`, default holidays include:\n * * Major holidays - Rosh Hashana, Yom Kippur, Pesach, Sukkot, etc.\n * * Minor holidays - Purim, Chanukah, Tu BiShvat, Lag BaOmer, etc.\n * * Minor fasts - Ta'anit Esther, Tzom Gedaliah, etc. (unless `options.noMinorFast`)\n * * Special Shabbatot - Shabbat Shekalim, Zachor, etc. (unless `options.noSpecialShabbat`)\n * * Modern Holidays - Yom HaShoah, Yom HaAtzma'ut, etc. (unless `options.noModern`)\n * * Rosh Chodesh (unless `options.noRoshChodesh`)\n *\n * Holiday and Torah reading schedules differ between Israel and the Disapora.\n * Set `options.il=true` to use the Israeli schedule.\n *\n * Additional non-default event types can be specified:\n * * Parashat HaShavua - weekly Torah Reading on Saturdays (`options.sedrot`)\n * * Counting of the Omer (`options.omer`)\n * * Shabbat Mevarchim HaChodesh on Saturday before Rosh Chodesh (`options.shabbatMevarchim`)\n * * Molad announcement on Saturday before Rosh Chodesh (`options.molad`)\n * * Yom Kippur Katan (`options.yomKippurKatan`)\n * * Yizkor (`options.yizkor`)\n *\n * Daily Study of texts are supported by the\n * {@link https://github.com/hebcal/hebcal-learning @hebcal/learning} package,\n * for example:\n * * Babylonian Talmud Daf Yomi (`options.dailyLearning.dafYomi`)\n * * Jerusalem Talmud (Yerushalmi) Yomi (`options.dailyLearning.yerushalmi`)\n * * Mishna Yomi (`options.dailyLearning.mishnaYomi`)\n * * Nach Yomi (`options.dailyLearning.nachYomi`)\n *\n * Candle-lighting and Havdalah times are approximated using latitude and longitude\n * specified by the {@link Location} class. The `Location` class contains a small\n * database of cities with their associated geographic information and time-zone information.\n * If you ever have any doubts about Hebcal's times, consult your local halachic authority.\n * If you enter geographic coordinates above the arctic circle or antarctic circle,\n * the times are guaranteed to be wrong.\n *\n * To add candle-lighting options, set `options.candlelighting=true` and set\n * `options.location` to an instance of `Location`. By default, candle lighting\n * time is 18 minutes before sundown (40 minutes for Jerusalem,\n * 30 minutes for Haifa and Zikhron Ya'akov) and Havdalah is\n * calculated according to Tzeit Hakochavim - Nightfall (the point when 3 small stars\n * are observable in the night time sky with the naked eye). The default Havdalah\n * option (Tzeit Hakochavim) is calculated when the sun is 8.5° below the horizon.\n * These defaults can be changed using these options:\n * * `options.candleLightingMins` - minutes before sundown to light candles\n * * `options.havdalahMins` - minutes after sundown for Havdalah (typical values are 42, 50, or 72).\n * Havdalah times are suppressed when `options.havdalahMins=0`.\n * * `options.havdalahDeg` - degrees for solar depression for Havdalah.\n * Default is 8.5 degrees for 3 small stars. Use 7.083 degrees for 3 medium-sized stars.\n * Havdalah times are suppressed when `options.havdalahDeg=0`.\n *\n * If both `options.candlelighting=true` and `options.location` is specified,\n * Chanukah candle-lighting times and minor fast start/end times will also be generated.\n * Chanukah candle-lighting is at Bein HaShmashos (13.5 minutes before\n * the sun is 7.083° below the horizon in the evening)\n * on weekdays, at regular candle-lighting time on Fridays, and at regular Havdalah time on\n * Saturday night (see above).\n *\n * Minor fasts begin at Alot HaShachar (sun is 16.1° below the horizon in the morning) and\n * end when 3 medium-sized stars are observable in the night sky (sun is 7.083° below the horizon\n * in the evening).\n *\n * Two options also exist for generating an Event with the Hebrew date:\n * * `options.addHebrewDates` - print the Hebrew date for the entire date range\n * * `options.addHebrewDatesForEvents` - print the Hebrew date for dates with some events\n *\n * Lastly, translation and transliteration of event titles is controlled by\n * `options.locale` and the {@link Locale} API.\n * `@hebcal/core` supports three locales by default:\n * * `en` - default, Sephardic transliterations (e.g. \"Shabbat\")\n * * `ashkenazi` - Ashkenazi transliterations (e.g. \"Shabbos\")\n * * `he` - Hebrew (e.g. \"שַׁבָּת\")\n *\n * Additional locales (such as `ru` or `fr`) are supported by the\n * {@link https://github.com/hebcal/hebcal-locales @hebcal/locales} package\n *\n * @example\n * import {HebrewCalendar, HDate, Location, Event} from '@hebcal/core';\n * const options: CalOptions = {\n * year: 1981,\n * isHebrewYear: false,\n * candlelighting: true,\n * location: Location.lookup('San Francisco'),\n * sedrot: true,\n * omer: true,\n * };\n * const events = HebrewCalendar.calendar(options);\n * for (const ev of events) {\n * const hd = ev.getDate();\n * const date = hd.greg();\n * console.log(date.toLocaleDateString(), ev.render('en'), hd.toString());\n * }\n */\n static calendar(options: CalOptions = {}): Event[] {\n return calendar(options);\n }\n\n /**\n * Calculates a birthday or anniversary (non-yahrzeit).\n * `hyear` must be after original `gdate` of anniversary.\n * Returns `undefined` when requested year preceeds or is same as original year.\n *\n * Hebcal uses the algorithm defined in \"Calendrical Calculations\"\n * by Edward M. Reingold and Nachum Dershowitz.\n *\n * The birthday of someone born in Adar of an ordinary year or Adar II of\n * a leap year is also always in the last month of the year, be that Adar\n * or Adar II. The birthday in an ordinary year of someone born during the\n * first 29 days of Adar I in a leap year is on the corresponding day of Adar;\n * in a leap year, the birthday occurs in Adar I, as expected.\n *\n * Someone born on the thirtieth day of Marcheshvan, Kislev, or Adar I\n * has his birthday postponed until the first of the following month in\n * years where that day does not occur. [Calendrical Calculations p. 111]\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'\n * const hd = HebrewCalendar.getBirthdayOrAnniversary(5780, dt); // '1 Nisan 5780'\n * console.log(hd.greg().toLocaleDateString('en-US')); // '3/26/2020'\n * @param hyear Hebrew year\n * @param gdate Gregorian or Hebrew date of event\n * @returns anniversary occurring in `hyear`\n */\n static getBirthdayOrAnniversary(\n hyear: number,\n gdate: Date | HDate\n ): HDate | undefined {\n const dt = getBirthdayHD(hyear, gdate);\n if (typeof dt === 'undefined') {\n return dt;\n }\n return new HDate(dt);\n }\n\n /**\n * Calculates yahrzeit.\n * `hyear` must be after original `gdate` of death.\n * Returns `undefined` when requested year preceeds or is same as original year.\n *\n * Hebcal uses the algorithm defined in \"Calendrical Calculations\"\n * by Edward M. Reingold and Nachum Dershowitz.\n *\n * The customary anniversary date of a death is more complicated and depends\n * also on the character of the year in which the first anniversary occurs.\n * There are several cases:\n *\n * * If the date of death is Marcheshvan 30, the anniversary in general depends\n * on the first anniversary; if that first anniversary was not Marcheshvan 30,\n * use the day before Kislev 1.\n * * If the date of death is Kislev 30, the anniversary in general again depends\n * on the first anniversary — if that was not Kislev 30, use the day before\n * Tevet 1.\n * * If the date of death is Adar II, the anniversary is the same day in the\n * last month of the Hebrew year (Adar or Adar II).\n * * If the date of death is Adar I 30, the anniversary in a Hebrew year that\n * is not a leap year (in which Adar only has 29 days) is the last day in\n * Shevat.\n * * In all other cases, use the normal (that is, same month number) anniversary\n * of the date of death. [Calendrical Calculations p. 113]\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'\n * const hd = HebrewCalendar.getYahrzeit(5780, dt); // '30 Sh\\'vat 5780'\n * console.log(hd.greg().toLocaleDateString('en-US')); // '2/25/2020'\n * @param hyear Hebrew year\n * @param gdate Gregorian or Hebrew date of death\n * @returns anniversary occurring in hyear\n */\n static getYahrzeit(hyear: number, gdate: Date | HDate): HDate | undefined {\n const dt = getYahrzeitHD(hyear, gdate);\n if (typeof dt === 'undefined') {\n return dt;\n }\n return new HDate(dt);\n }\n\n /**\n * Lower-level holidays interface, which returns a `Map` of `Event`s indexed by\n * `HDate.toString()`. These events must filtered especially for `flags.IL_ONLY`\n * or `flags.CHUL_ONLY` depending on Israel vs. Diaspora holiday scheme.\n * @param year Hebrew year\n */\n static getHolidaysForYear(year: number): HolidayYearMap {\n return getHolidaysForYear_(year);\n }\n\n /**\n * Returns an array of holidays for the year\n * @param year Hebrew year\n * @param il use the Israeli schedule for holidays\n */\n static getHolidaysForYearArray(year: number, il: boolean): HolidayEvent[] {\n return getHolidaysForYearArray(year, il);\n }\n\n /**\n * Returns an array of Events on this date (or `undefined` if no events)\n * @param date Hebrew Date, Gregorian date, or absolute R.D. day number\n * @param [il] use the Israeli schedule for holidays\n */\n static getHolidaysOnDate(\n date: HDate | Date | number,\n il?: boolean\n ): HolidayEvent[] | undefined {\n return getHolidaysOnDate(date, il);\n }\n\n /**\n * Eruv Tavshilin\n */\n static eruvTavshilin(date: Date | HDate, il: boolean): boolean {\n if (date.getDay() < 3 || date.getDay() > 4) {\n return false;\n }\n const today = new HDate(date);\n const friday = today.after(5);\n const tomorrow = today.next();\n if (!isChag(friday, il) || isChag(today, il) || !isChag(tomorrow, il)) {\n return false;\n }\n return true;\n }\n\n /**\n * Helper function to format a 23-hour (00:00-23:59) time in US format (\"8:13pm\") or\n * keep as \"20:13\" for any other locale/country. Uses {@link CalOptions} to determine\n * locale.\n * If `options.hour12` is `false`, locale is ignored and always returns 24-hour time.\n * If `options.hour12` is `true`, locale is ignored and always returns 12-hour time.\n * @param timeStr - original time like \"20:30\"\n * @param suffix - \"p\" or \"pm\" or \" P.M.\". Add leading space if you want it\n * @param options\n */\n static reformatTimeStr(\n timeStr: string,\n suffix: string,\n options: CalOptions\n ): string {\n return reformatTimeStr(timeStr, suffix, options);\n }\n\n static version(): string {\n return pkgVersion;\n }\n\n /**\n * Convenience function to create an instance of `Sedra` or reuse a previously\n * created and cached instance.\n */\n static getSedra(hyear: number, il: boolean): Sedra {\n return getSedra(hyear, il);\n }\n\n /**\n * Return a number containing information on what Hallel is said on that day.\n *\n * Whole Hallel is said on Chanukah, the first Yom Tov of Pesach, Shavuot, Sukkot,\n * Yom Ha'atzmaut, and Yom Yerushalayim.\n *\n * Half Hallel is said on Rosh Chodesh (not Rosh Hashanah), and the last 6 days of Pesach.\n *\n * The number is one of the following values:\n *\n * 0 - No Hallel\n * 1 - Half Hallel\n * 2 - Whole Hallel\n */\n static hallel(hdate: HDate, il: boolean): number {\n const events = getHolidaysForYearArray(hdate.getFullYear(), il);\n return hallel_(events, hdate);\n }\n\n /**\n * Return details on what Tachanun (or Tzidchatcha on Shabbat) is said on `hdate`.\n *\n * Tachanun is not said on Rosh Chodesh, the month of Nisan, Lag Baomer,\n * Rosh Chodesh Sivan until Isru Chag, Tisha B'av, 15 Av, Erev Rosh Hashanah,\n * Rosh Hashanah, Erev Yom Kippur until after Simchat Torah, Chanukah,\n * Tu B'shvat, Purim and Shushan Purim, and Purim and Shushan Purim Katan.\n *\n * In some congregations Tachanun is not said until from Rosh Chodesh Sivan\n * until 14th Sivan, Sukkot until after Rosh Chodesh Cheshvan, Pesach Sheini,\n * Yom Ha'atzmaut, and Yom Yerushalayim.\n *\n * Tachanun is not said at Mincha on days before it is not said at Shacharit.\n *\n * Tachanun is not said at Shacharit on Shabbat, but is at Mincha, usually.\n */\n static tachanun(hdate: HDate, il: boolean): TachanunResult {\n return tachanun(hdate, il);\n }\n}\n\n/**\n * @private\n */\nfunction isChag(date: HDate, il: boolean): boolean {\n const events = getHolidaysOnDate(date, il) || [];\n const chag = events.filter(ev => ev.getFlags() & flags.CHAG);\n return chag.length !== 0;\n}\n"],"names":["pkgVersion"],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;AAmBG;AAoBH;;;;;AAKG;MACU,cAAc,CAAA;AACzB,IAAA,WAAA,GAAA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2GG;AACH,IAAA,OAAO,QAAQ,CAAC,OAAA,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AC,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC;AAC5D,IAAA,OAAO,IAAI,CAAC,MAAM,KAAK,CAAC;AAC1B;;;;"}
|
package/dist/esm/holidays.js
CHANGED
package/dist/esm/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export { OmerEvent } from './omer';
|
|
|
15
15
|
export { TachanunResult } from './tachanun';
|
|
16
16
|
export { Sedra, SedraResult, parshiot, getSedra } from './sedra';
|
|
17
17
|
export { ParshaEvent } from './ParshaEvent';
|
|
18
|
+
export { parshaYear } from './parshaYear';
|
|
18
19
|
export { HolidayEvent, AsaraBTevetEvent, RoshChodeshEvent, RoshHashanaEvent, } from './HolidayEvent';
|
|
19
20
|
export { HolidayYearMap, getHolidaysOnDate } from './holidays';
|
|
20
21
|
export { MevarchimChodeshEvent } from './MevarchimChodeshEvent';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v5.
|
|
1
|
+
/*! @hebcal/core v5.8.0 */
|
|
2
2
|
export { version } from './pkgVersion.js';
|
|
3
3
|
export { HDate, Locale, gematriya, gematriyaStrToNum, greg, months } from '@hebcal/hdate';
|
|
4
4
|
import './locale.js';
|
|
@@ -13,6 +13,7 @@ export { Molad, MoladEvent } from './molad.js';
|
|
|
13
13
|
export { OmerEvent } from './omer.js';
|
|
14
14
|
export { Sedra, getSedra, parshiot } from './sedra.js';
|
|
15
15
|
export { ParshaEvent } from './ParshaEvent.js';
|
|
16
|
+
export { parshaYear } from './parshaYear.js';
|
|
16
17
|
export { AsaraBTevetEvent, HolidayEvent, RoshChodeshEvent, RoshHashanaEvent } from './HolidayEvent.js';
|
|
17
18
|
export { getHolidaysOnDate } from './holidays.js';
|
|
18
19
|
export { MevarchimChodeshEvent } from './MevarchimChodeshEvent.js';
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/esm/locale.js
CHANGED
package/dist/esm/location.js
CHANGED
package/dist/esm/modern.js
CHANGED
package/dist/esm/molad.js
CHANGED
package/dist/esm/omer.js
CHANGED
package/dist/esm/parshaName.js
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Event } from './event';
|
|
2
|
+
/**
|
|
3
|
+
* Calculates weekly Torah Reading on Saturdays for entire year
|
|
4
|
+
* @param year Hebrew year
|
|
5
|
+
* @param il Israel (false for Diaspora)
|
|
6
|
+
* @returns an array of `ParshaEvent` occurring on Saturdays that contain a regular
|
|
7
|
+
* (non-holiday) Parashat HaShavua
|
|
8
|
+
*/
|
|
9
|
+
export declare function parshaYear(year: number, il: boolean): Event[];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*! @hebcal/core v5.8.0 */
|
|
2
|
+
import { HDate, months } from '@hebcal/hdate';
|
|
3
|
+
import { ParshaEvent } from './ParshaEvent.js';
|
|
4
|
+
import { getSedra } from './sedra.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Calculates weekly Torah Reading on Saturdays for entire year
|
|
8
|
+
* @param year Hebrew year
|
|
9
|
+
* @param il Israel (false for Diaspora)
|
|
10
|
+
* @returns an array of `ParshaEvent` occurring on Saturdays that contain a regular
|
|
11
|
+
* (non-holiday) Parashat HaShavua
|
|
12
|
+
*/
|
|
13
|
+
function parshaYear(year, il) {
|
|
14
|
+
const sedra = getSedra(year, il);
|
|
15
|
+
const startAbs = sedra.getFirstSaturday();
|
|
16
|
+
const endAbs = HDate.hebrew2abs(year, months.ELUL, 29);
|
|
17
|
+
const events = [];
|
|
18
|
+
for (let absDt = startAbs; absDt <= endAbs; absDt += 7) {
|
|
19
|
+
const parsha = sedra.lookup(absDt);
|
|
20
|
+
if (!parsha.chag) {
|
|
21
|
+
const ev = new ParshaEvent(parsha.hdate, parsha.parsha, il, parsha.num);
|
|
22
|
+
events.push(ev);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return events;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { parshaYear };
|
|
29
|
+
//# sourceMappingURL=parshaYear.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parshaYear.js","sources":["../../../src/parshaYear.ts"],"sourcesContent":["import {HDate, months} from '@hebcal/hdate';\nimport {Event} from './event';\nimport {ParshaEvent} from './ParshaEvent';\nimport {getSedra} from './sedra';\n\n/**\n * Calculates weekly Torah Reading on Saturdays for entire year\n * @param year Hebrew year\n * @param il Israel (false for Diaspora)\n * @returns an array of `ParshaEvent` occurring on Saturdays that contain a regular\n * (non-holiday) Parashat HaShavua\n */\nexport function parshaYear(year: number, il: boolean): Event[] {\n const sedra = getSedra(year, il);\n const startAbs = sedra.getFirstSaturday();\n const endAbs = HDate.hebrew2abs(year, months.ELUL, 29);\n const events: Event[] = [];\n for (let absDt = startAbs; absDt <= endAbs; absDt += 7) {\n const parsha = sedra.lookup(absDt);\n if (!parsha.chag) {\n const ev = new ParshaEvent(parsha.hdate, parsha.parsha, il, parsha.num);\n events.push(ev);\n }\n }\n return events;\n}\n"],"names":[],"mappings":";;;;;AAKA;;;;;;AAMG;AACa,SAAA,UAAU,CAAC,IAAY,EAAE,EAAW,EAAA;IAClD,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC;AAChC,IAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,gBAAgB,EAAE;AACzC,IAAA,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;IACtD,MAAM,MAAM,GAAY,EAAE;AAC1B,IAAA,KAAK,IAAI,KAAK,GAAG,QAAQ,EAAE,KAAK,IAAI,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE;QACtD,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;AAClC,QAAA,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;AAChB,YAAA,MAAM,EAAE,GAAG,IAAI,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC;AACvE,YAAA,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;;;AAGnB,IAAA,OAAO,MAAM;AACf;;;;"}
|
package/dist/esm/pkgVersion.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** DO NOT EDIT THIS AUTO-GENERATED FILE! */
|
|
2
|
-
export declare const version = "5.
|
|
2
|
+
export declare const version = "5.8.0";
|
package/dist/esm/pkgVersion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pkgVersion.js","sources":["../../../src/pkgVersion.ts"],"sourcesContent":["/** DO NOT EDIT THIS AUTO-GENERATED FILE! */\nexport const version = '5.
|
|
1
|
+
{"version":3,"file":"pkgVersion.js","sources":["../../../src/pkgVersion.ts"],"sourcesContent":["/** DO NOT EDIT THIS AUTO-GENERATED FILE! */\nexport const version = '5.8.0';\n"],"names":[],"mappings":";AAAA;AACO,MAAM,OAAO,GAAG;;;;"}
|
package/dist/esm/sedra.js
CHANGED
package/dist/esm/tachanun.js
CHANGED
package/dist/esm/zmanim.js
CHANGED
package/dist/event.d.ts
CHANGED
package/dist/hebcal.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ export declare class HebrewCalendar {
|
|
|
48
48
|
* * Shabbat Mevarchim HaChodesh on Saturday before Rosh Chodesh (`options.shabbatMevarchim`)
|
|
49
49
|
* * Molad announcement on Saturday before Rosh Chodesh (`options.molad`)
|
|
50
50
|
* * Yom Kippur Katan (`options.yomKippurKatan`)
|
|
51
|
+
* * Yizkor (`options.yizkor`)
|
|
51
52
|
*
|
|
52
53
|
* Daily Study of texts are supported by the
|
|
53
54
|
* {@link https://github.com/hebcal/hebcal-learning @hebcal/learning} package,
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v5.
|
|
1
|
+
/*! @hebcal/core v5.8.0 */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var hdate = require('@hebcal/hdate');
|
|
@@ -6,7 +6,7 @@ var noaa = require('@hebcal/noaa');
|
|
|
6
6
|
require('temporal-polyfill/global');
|
|
7
7
|
|
|
8
8
|
/** DO NOT EDIT THIS AUTO-GENERATED FILE! */
|
|
9
|
-
const version = '5.
|
|
9
|
+
const version = '5.8.0';
|
|
10
10
|
|
|
11
11
|
var poAshkenazi = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);" }, "contexts": { "": { "Shabbat": ["Shabbos"], "Achrei Mot": ["Achrei Mos"], "Bechukotai": ["Bechukosai"], "Beha'alotcha": ["Beha’aloscha"], "Bereshit": ["Bereshis"], "Chukat": ["Chukas"], "Erev Shavuot": ["Erev Shavuos"], "Erev Sukkot": ["Erev Sukkos"], "Ki Tavo": ["Ki Savo"], "Ki Teitzei": ["Ki Seitzei"], "Ki Tisa": ["Ki Sisa"], "Matot": ["Matos"], "Purim Katan": ["Purim Koton"], "Shabbat Chazon": ["Shabbos Chazon"], "Shabbat HaChodesh": ["Shabbos HaChodesh"], "Shabbat HaGadol": ["Shabbos HaGadol"], "Shabbat Nachamu": ["Shabbos Nachamu"], "Shabbat Parah": ["Shabbos Parah"], "Shabbat Shekalim": ["Shabbos Shekalim"], "Shabbat Shuva": ["Shabbos Shuvah"], "Shabbat Zachor": ["Shabbos Zachor"], "Shavuot": ["Shavuos"], "Shavuot I": ["Shavuos I"], "Shavuot II": ["Shavuos II"], "Shemot": ["Shemos"], "Shmini Atzeret": ["Shmini Atzeres"], "Simchat Torah": ["Simchas Torah"], "Sukkot": ["Sukkos"], "Sukkot I": ["Sukkos I"], "Sukkot II": ["Sukkos II"], "Sukkot II (CH''M)": ["Sukkos II (CH’’M)"], "Sukkot III (CH''M)": ["Sukkos III (CH’’M)"], "Sukkot IV (CH''M)": ["Sukkos IV (CH’’M)"], "Sukkot V (CH''M)": ["Sukkos V (CH’’M)"], "Sukkot VI (CH''M)": ["Sukkos VI (CH’’M)"], "Sukkot VII (Hoshana Raba)": ["Sukkos VII (Hoshana Raba)"], "Ta'anit Bechorot": ["Ta’anis Bechoros"], "Ta'anit Esther": ["Ta’anis Esther"], "Toldot": ["Toldos"], "Vaetchanan": ["Vaeschanan"], "Yitro": ["Yisro"], "Vezot Haberakhah": ["Vezos Haberakhah"], "Parashat": ["Parshas"], "Leil Selichot": ["Leil Selichos"], "Shabbat Mevarchim Chodesh": ["Shabbos Mevorchim Chodesh"], "Shabbat Shirah": ["Shabbos Shirah"], "Asara B'Tevet": ["Asara B’Teves"], "Alot HaShachar": ["Alos HaShachar"], "Kriat Shema, sof zeman": ["Krias Shema, sof zman"], "Tefilah, sof zeman": ["Tefilah, sof zman"], "Kriat Shema, sof zeman (MGA)": ["Krias Shema, sof zman (MGA)"], "Tefilah, sof zeman (MGA)": ["Tefilah, sof zman (MGA)"], "Chatzot HaLailah": ["Chatzos HaLailah"], "Chatzot hayom": ["Chatzos"], "Tzeit HaKochavim": ["Tzeis HaKochavim"], "Birkat Hachamah": ["Birkas Hachamah"], "Shushan Purim Katan": ["Shushan Purim Koton"] } } };
|
|
12
12
|
|
|
@@ -89,6 +89,8 @@ const flags = {
|
|
|
89
89
|
NACH_YOMI: 0x2000000,
|
|
90
90
|
/** Daily Learning */
|
|
91
91
|
DAILY_LEARNING: 0x4000000,
|
|
92
|
+
/** Yizkor */
|
|
93
|
+
YIZKOR: 0x8000000,
|
|
92
94
|
};
|
|
93
95
|
const flagToCategory = [
|
|
94
96
|
[flags.MAJOR_FAST, 'holiday', 'major', 'fast'],
|
|
@@ -3311,6 +3313,28 @@ class ParshaEvent extends Event {
|
|
|
3311
3313
|
}
|
|
3312
3314
|
}
|
|
3313
3315
|
|
|
3316
|
+
/**
|
|
3317
|
+
* Calculates weekly Torah Reading on Saturdays for entire year
|
|
3318
|
+
* @param year Hebrew year
|
|
3319
|
+
* @param il Israel (false for Diaspora)
|
|
3320
|
+
* @returns an array of `ParshaEvent` occurring on Saturdays that contain a regular
|
|
3321
|
+
* (non-holiday) Parashat HaShavua
|
|
3322
|
+
*/
|
|
3323
|
+
function parshaYear(year, il) {
|
|
3324
|
+
const sedra = getSedra(year, il);
|
|
3325
|
+
const startAbs = sedra.getFirstSaturday();
|
|
3326
|
+
const endAbs = hdate.HDate.hebrew2abs(year, hdate.months.ELUL, 29);
|
|
3327
|
+
const events = [];
|
|
3328
|
+
for (let absDt = startAbs; absDt <= endAbs; absDt += 7) {
|
|
3329
|
+
const parsha = sedra.lookup(absDt);
|
|
3330
|
+
if (!parsha.chag) {
|
|
3331
|
+
const ev = new ParshaEvent(parsha.hdate, parsha.parsha, il, parsha.num);
|
|
3332
|
+
events.push(ev);
|
|
3333
|
+
}
|
|
3334
|
+
}
|
|
3335
|
+
return events;
|
|
3336
|
+
}
|
|
3337
|
+
|
|
3314
3338
|
const SUN$1 = 0;
|
|
3315
3339
|
const TUE$1 = 2;
|
|
3316
3340
|
const FRI$2 = 5;
|
|
@@ -4089,6 +4113,7 @@ function startEndHebrew(theMonth, theYear, numYears) {
|
|
|
4089
4113
|
* * Shabbat Mevarchim HaChodesh on Saturday before Rosh Chodesh (`options.shabbatMevarchim`)
|
|
4090
4114
|
* * Molad announcement on Saturday before Rosh Chodesh (`options.molad`)
|
|
4091
4115
|
* * Yom Kippur Katan (`options.yomKippurKatan`)
|
|
4116
|
+
* * Yizkor (`options.yizkor`)
|
|
4092
4117
|
*
|
|
4093
4118
|
* Daily Study of texts are supported by the
|
|
4094
4119
|
* {@link https://github.com/hebcal/hebcal-learning @hebcal/learning} package,
|
|
@@ -4255,6 +4280,16 @@ function calendar(options = {}) {
|
|
|
4255
4280
|
if (candlesEv) {
|
|
4256
4281
|
evts.push(candlesEv);
|
|
4257
4282
|
}
|
|
4283
|
+
if (options.yizkor) {
|
|
4284
|
+
const mm = hd.getMonth();
|
|
4285
|
+
const dd = hd.getDate();
|
|
4286
|
+
if ((mm === hdate.months.TISHREI && (dd === 10 || dd === 22)) ||
|
|
4287
|
+
(mm === NISAN && dd === (il ? 21 : 22)) ||
|
|
4288
|
+
(mm === SIVAN && dd === (il ? 6 : 7))) {
|
|
4289
|
+
const ev = new Event(hd, 'Yizkor', flags.YIZKOR, { emoji: '🕯️' });
|
|
4290
|
+
evts.push(ev);
|
|
4291
|
+
}
|
|
4292
|
+
}
|
|
4258
4293
|
if (options.addHebrewDates ||
|
|
4259
4294
|
(options.addHebrewDatesForEvents && prevEventsLength !== evts.length)) {
|
|
4260
4295
|
const e2 = new HebrewDateEvent(hd);
|
|
@@ -4295,6 +4330,7 @@ const MINOR_HOLIDAY = flags.MINOR_HOLIDAY;
|
|
|
4295
4330
|
const EREV = flags.EREV;
|
|
4296
4331
|
const CHOL_HAMOED = flags.CHOL_HAMOED;
|
|
4297
4332
|
const YOM_KIPPUR_KATAN = flags.YOM_KIPPUR_KATAN;
|
|
4333
|
+
const YIZKOR = flags.YIZKOR;
|
|
4298
4334
|
const unrecognizedAlreadyWarned = new Set();
|
|
4299
4335
|
const RECOGNIZED_OPTIONS = {
|
|
4300
4336
|
location: 1,
|
|
@@ -4328,6 +4364,7 @@ const RECOGNIZED_OPTIONS = {
|
|
|
4328
4364
|
hour12: 1,
|
|
4329
4365
|
dailyLearning: 1,
|
|
4330
4366
|
useElevation: 1,
|
|
4367
|
+
yizkor: 1,
|
|
4331
4368
|
};
|
|
4332
4369
|
/**
|
|
4333
4370
|
* @private
|
|
@@ -4488,6 +4525,9 @@ function getMaskFromOptions(options) {
|
|
|
4488
4525
|
if (options.yomKippurKatan) {
|
|
4489
4526
|
mask |= YOM_KIPPUR_KATAN;
|
|
4490
4527
|
}
|
|
4528
|
+
if (options.yizkor) {
|
|
4529
|
+
mask |= YIZKOR;
|
|
4530
|
+
}
|
|
4491
4531
|
if (options.dailyLearning) {
|
|
4492
4532
|
const dailyLearning = options.dailyLearning;
|
|
4493
4533
|
if (dailyLearning.dafYomi) {
|
|
@@ -4543,6 +4583,8 @@ function setOptionsFromMask(options) {
|
|
|
4543
4583
|
options.shabbatMevarchim = true;
|
|
4544
4584
|
if (m & YOM_KIPPUR_KATAN)
|
|
4545
4585
|
options.yomKippurKatan = true;
|
|
4586
|
+
if (m & YIZKOR)
|
|
4587
|
+
options.yizkor = true;
|
|
4546
4588
|
return m;
|
|
4547
4589
|
}
|
|
4548
4590
|
/**
|
|
@@ -4713,6 +4755,7 @@ class HebrewCalendar {
|
|
|
4713
4755
|
* * Shabbat Mevarchim HaChodesh on Saturday before Rosh Chodesh (`options.shabbatMevarchim`)
|
|
4714
4756
|
* * Molad announcement on Saturday before Rosh Chodesh (`options.molad`)
|
|
4715
4757
|
* * Yom Kippur Katan (`options.yomKippurKatan`)
|
|
4758
|
+
* * Yizkor (`options.yizkor`)
|
|
4716
4759
|
*
|
|
4717
4760
|
* Daily Study of texts are supported by the
|
|
4718
4761
|
* {@link https://github.com/hebcal/hebcal-learning @hebcal/learning} package,
|
|
@@ -5029,6 +5072,7 @@ exports.flags = flags;
|
|
|
5029
5072
|
exports.getHolidaysOnDate = getHolidaysOnDate;
|
|
5030
5073
|
exports.getSedra = getSedra;
|
|
5031
5074
|
exports.holidayDesc = holidayDesc;
|
|
5075
|
+
exports.parshaYear = parshaYear;
|
|
5032
5076
|
exports.parshiot = parshiot;
|
|
5033
5077
|
exports.version = version;
|
|
5034
5078
|
//# sourceMappingURL=index.cjs.map
|