@hebcal/core 6.8.2 → 6.9.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.
Files changed (95) hide show
  1. package/README.md +262 -4
  2. package/dist/bundle.js +1400 -942
  3. package/dist/bundle.js.map +1 -1
  4. package/dist/bundle.min.js +18 -17
  5. package/dist/bundle.min.js.map +1 -1
  6. package/dist/esm/CalOptions.d.ts +11 -1
  7. package/dist/esm/DailyLearning.d.ts +4 -4
  8. package/dist/esm/DailyLearning.js +5 -5
  9. package/dist/esm/DailyLearning.js.map +1 -1
  10. package/dist/esm/HebrewDateEvent.js +1 -1
  11. package/dist/esm/HolidayEvent.d.ts +7 -2
  12. package/dist/esm/HolidayEvent.js +8 -3
  13. package/dist/esm/HolidayEvent.js.map +1 -1
  14. package/dist/esm/MevarchimChodeshEvent.d.ts +2 -1
  15. package/dist/esm/MevarchimChodeshEvent.js +3 -2
  16. package/dist/esm/MevarchimChodeshEvent.js.map +1 -1
  17. package/dist/esm/ParshaEvent.d.ts +13 -0
  18. package/dist/esm/ParshaEvent.js +14 -1
  19. package/dist/esm/ParshaEvent.js.map +1 -1
  20. package/dist/esm/TimedEvent.d.ts +12 -4
  21. package/dist/esm/TimedEvent.js +13 -5
  22. package/dist/esm/TimedEvent.js.map +1 -1
  23. package/dist/esm/YomKippurKatanEvent.d.ts +2 -1
  24. package/dist/esm/YomKippurKatanEvent.js +3 -2
  25. package/dist/esm/YomKippurKatanEvent.js.map +1 -1
  26. package/dist/esm/ashkenazi.po.js +1 -1
  27. package/dist/esm/calendar.d.ts +17 -7
  28. package/dist/esm/calendar.js +23 -10
  29. package/dist/esm/calendar.js.map +1 -1
  30. package/dist/esm/candles.d.ts +19 -1
  31. package/dist/esm/candles.js +20 -2
  32. package/dist/esm/candles.js.map +1 -1
  33. package/dist/esm/cities.json.js +1 -1
  34. package/dist/esm/event.d.ts +2 -4
  35. package/dist/esm/event.js +3 -5
  36. package/dist/esm/event.js.map +1 -1
  37. package/dist/esm/getStartAndEnd.js +1 -1
  38. package/dist/esm/hallel.js +1 -1
  39. package/dist/esm/he-x-NoNikud.po.js +1 -1
  40. package/dist/esm/he.po.js +1 -1
  41. package/dist/esm/hebcal.d.ts +31 -96
  42. package/dist/esm/hebcal.js +34 -107
  43. package/dist/esm/hebcal.js.map +1 -1
  44. package/dist/esm/holidays.d.ts +8 -1
  45. package/dist/esm/holidays.js +2 -2
  46. package/dist/esm/holidays.js.map +1 -1
  47. package/dist/esm/index.d.ts +3 -1
  48. package/dist/esm/index.js +3 -1
  49. package/dist/esm/index.js.map +1 -1
  50. package/dist/esm/isAssurBemlacha.js +6 -3
  51. package/dist/esm/isAssurBemlacha.js.map +1 -1
  52. package/dist/esm/isAveilut.js +1 -1
  53. package/dist/esm/isFastDay.d.ts +1 -1
  54. package/dist/esm/isFastDay.js +2 -2
  55. package/dist/esm/isFastDay.js.map +1 -1
  56. package/dist/esm/locale.js +1 -1
  57. package/dist/esm/location.d.ts +37 -9
  58. package/dist/esm/location.js +38 -10
  59. package/dist/esm/location.js.map +1 -1
  60. package/dist/esm/modern.js +1 -1
  61. package/dist/esm/molad.d.ts +26 -20
  62. package/dist/esm/molad.js +27 -21
  63. package/dist/esm/molad.js.map +1 -1
  64. package/dist/esm/moladBase.d.ts +11 -0
  65. package/dist/esm/moladBase.js +12 -1
  66. package/dist/esm/moladBase.js.map +1 -1
  67. package/dist/esm/moladDate.d.ts +10 -6
  68. package/dist/esm/moladDate.js +25 -18
  69. package/dist/esm/moladDate.js.map +1 -1
  70. package/dist/esm/omer.d.ts +19 -3
  71. package/dist/esm/omer.js +20 -4
  72. package/dist/esm/omer.js.map +1 -1
  73. package/dist/esm/parshaName.js +1 -1
  74. package/dist/esm/parshaYear.d.ts +2 -2
  75. package/dist/esm/parshaYear.js +3 -3
  76. package/dist/esm/parshaYear.js.map +1 -1
  77. package/dist/esm/pkgVersion.d.ts +1 -1
  78. package/dist/esm/pkgVersion.js +2 -2
  79. package/dist/esm/pkgVersion.js.map +1 -1
  80. package/dist/esm/reformatTimeStr.d.ts +14 -2
  81. package/dist/esm/reformatTimeStr.js +15 -3
  82. package/dist/esm/reformatTimeStr.js.map +1 -1
  83. package/dist/esm/sedra.d.ts +44 -18
  84. package/dist/esm/sedra.js +39 -17
  85. package/dist/esm/sedra.js.map +1 -1
  86. package/dist/esm/sefira.json.js +1 -1
  87. package/dist/esm/staticHolidays.d.ts +0 -2
  88. package/dist/esm/staticHolidays.js +1 -3
  89. package/dist/esm/staticHolidays.js.map +1 -1
  90. package/dist/esm/string.js +1 -1
  91. package/dist/esm/tachanun.js +1 -1
  92. package/dist/esm/zmanim.d.ts +177 -142
  93. package/dist/esm/zmanim.js +183 -148
  94. package/dist/esm/zmanim.js.map +1 -1
  95. package/package.json +8 -9
@@ -1 +1 @@
1
- {"version":3,"file":"event.js","sources":["../../../src/event.ts"],"sourcesContent":["import {HDate, Locale} from '@hebcal/hdate';\nimport './locale'; // Adds Hebrew and Ashkenazic translations\n\n/**\n * Holiday flags for Event. These flags are typically\n * combined using bitwise arithmetic to form a mask.\n * @readonly\n * @enum {number}\n */\nexport const flags = {\n /** Chag, yontiff, yom tov */\n CHAG: 0x000001,\n /** Light candles 18 minutes before sundown */\n LIGHT_CANDLES: 0x000002,\n /** End of holiday (end of Yom Tov) */\n YOM_TOV_ENDS: 0x000004,\n /** Observed only in the Diaspora (chutz l'aretz) */\n CHUL_ONLY: 0x000008,\n /** Observed only in Israel */\n IL_ONLY: 0x000010,\n /** Light candles in the evening at Tzeit time (3 small stars) */\n LIGHT_CANDLES_TZEIS: 0x000020,\n /** Candle-lighting for Chanukah */\n CHANUKAH_CANDLES: 0x000040,\n /** Rosh Chodesh, beginning of a new Hebrew month */\n ROSH_CHODESH: 0x000080,\n /** Minor fasts like Tzom Tammuz, Ta'anit Esther, ... */\n MINOR_FAST: 0x000100,\n /** Shabbat Shekalim, Zachor, ... */\n SPECIAL_SHABBAT: 0x000200,\n /** Weekly sedrot on Saturdays */\n PARSHA_HASHAVUA: 0x000400,\n /** Daily page of Talmud (Bavli) */\n DAF_YOMI: 0x000800,\n /** Days of the Omer */\n OMER_COUNT: 0x001000,\n /** Yom HaShoah, Yom HaAtzma'ut, ... */\n MODERN_HOLIDAY: 0x002000,\n /** Yom Kippur and Tish'a B'Av */\n MAJOR_FAST: 0x004000,\n /** On the Saturday before Rosh Chodesh */\n SHABBAT_MEVARCHIM: 0x008000,\n /** Molad */\n MOLAD: 0x010000,\n /** Yahrzeit or Hebrew Anniversary */\n USER_EVENT: 0x020000,\n /** Daily Hebrew date (\"11th of Sivan, 5780\") */\n HEBREW_DATE: 0x040000,\n /** A holiday that's not major, modern, rosh chodesh, or a fast day */\n MINOR_HOLIDAY: 0x080000,\n /** Evening before a major or minor holiday */\n EREV: 0x100000,\n /** Chol haMoed, intermediate days of Pesach or Sukkot */\n CHOL_HAMOED: 0x200000,\n /** Mishna Yomi */\n MISHNA_YOMI: 0x400000,\n /** Yom Kippur Katan, minor day of atonement on the day preceeding each Rosh Chodesh */\n YOM_KIPPUR_KATAN: 0x800000,\n /** Daily page of Jerusalem Talmud (Yerushalmi) */\n YERUSHALMI_YOMI: 0x1000000,\n /** Nach Yomi */\n NACH_YOMI: 0x2000000,\n /** Daily Learning */\n DAILY_LEARNING: 0x4000000,\n /** Yizkor */\n YIZKOR: 0x8000000,\n /** BeHaB fast days on Monday, Thursday and Monday after Pesach and Sukkot */\n BEHAB: 0x10000000,\n} as const;\n\nconst flagToCategory = [\n [flags.MAJOR_FAST, 'holiday', 'major', 'fast'],\n [flags.CHANUKAH_CANDLES, 'holiday', 'minor'],\n [flags.HEBREW_DATE, 'hebdate'],\n [flags.MINOR_FAST, 'holiday', 'fast'],\n [flags.MINOR_HOLIDAY, 'holiday', 'minor'],\n [flags.MODERN_HOLIDAY, 'holiday', 'modern'],\n [flags.MOLAD, 'molad'],\n [flags.OMER_COUNT, 'omer'],\n [flags.PARSHA_HASHAVUA, 'parashat'], // backwards-compat\n [flags.ROSH_CHODESH, 'roshchodesh'],\n [flags.SHABBAT_MEVARCHIM, 'mevarchim'],\n [flags.SPECIAL_SHABBAT, 'holiday', 'shabbat'],\n [flags.USER_EVENT, 'user'],\n [flags.YIZKOR, 'yizkor'],\n] as const;\n\n/**\n * Represents an Event with a title, date, and flags.\n *\n * Events are used to represent holidays, candle-lighting times,\n * Torah readings, Omer days, Hebrew dates, and more. Most concrete event\n * types are subclasses (e.g. {@link HolidayEvent}, {@link TimedEvent},\n * {@link ParshaEvent}, {@link OmerEvent}) and are produced by\n * {@link HebrewCalendar.calendar}.\n *\n * To get the title of the event in a language other than English with\n * Sephardic transliterations, use the {@link Event.render} method.\n *\n * @example\n * import {Event, HDate, flags} from '@hebcal/core';\n * const ev = new Event(new HDate(6, 'Sivan', 5749), 'Shavuot', flags.CHAG);\n * ev.getDate().toString(); // '6 Sivan 5749'\n * ev.getDesc(); // 'Shavuot'\n * ev.render('he'); // 'שָׁבוּעוֹת'\n */\nexport class Event {\n /** Hebrew date of this event */\n readonly date: HDate;\n /**\n * Untranslated title of this event. Note that these description\n * strings are always in English and will remain stable across releases.\n * To get the title of the event in another language, use the\n * `render()` method.\n */\n readonly desc: string;\n /** Bitmask of optional event flags. See {@link flags} */\n readonly mask: number;\n /** Optional emoji character such as ✡️, 🕯️, 🕎, 🕍, 🌒 */\n emoji?: string;\n /** Optional longer description or memo text */\n memo?: string;\n /** Alarms are used by iCalendar feeds */\n alarm?: Date | string | boolean;\n /**\n * Constructs Event\n * @param date Hebrew date event occurs\n * @param desc Description (not translated)\n * @param [mask=0] optional bitmask of holiday flags (see {@link flags})\n * @param [attrs={}] optional additional attributes (e.g. `eventTimeStr`, `cholHaMoedDay`)\n */\n constructor(date: HDate, desc: string, mask = 0, attrs?: object) {\n if (!HDate.isHDate(date)) {\n throw new TypeError(`Invalid Event date: ${date}`);\n }\n if (typeof desc !== 'string') {\n throw new TypeError(`Invalid Event description: ${desc}`);\n }\n this.date = date;\n this.desc = desc;\n this.mask = +mask;\n if (typeof attrs === 'object' && attrs !== null) {\n Object.assign(this, attrs);\n }\n }\n /**\n * Hebrew date of this event\n */\n getDate(): HDate {\n return this.date;\n }\n /**\n * Gregorian date of this event\n */\n greg(): Date {\n return this.date.greg();\n }\n /**\n * Untranslated title of this event. Note that these description\n * strings are always in English and will remain stable across releases.\n * To get the title of the event in another language, use the\n * `render()` method.\n */\n getDesc(): string {\n return this.desc;\n }\n /**\n * Bitmask of optional event flags. See {@link flags}\n */\n getFlags(): number {\n return this.mask;\n }\n /**\n * Returns (translated) description of this event\n * @example\n * const ev = new Event(new HDate(6, 'Sivan', 5749), 'Shavuot', flags.CHAG);\n * ev.render('en'); // 'Shavuot'\n * ev.render('he'); // 'שָׁבוּעוֹת'\n * ev.render('ashkenazi'); // 'Shavuos'\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n return Locale.gettext(this.desc, locale);\n }\n /**\n * Returns a brief (translated) description of this event.\n *\n * For most events this is the same as {@link render}. Some subclasses\n * (e.g. {@link CandleLightingEvent}, {@link HavdalahEvent},\n * {@link OmerEvent}) produce shorter text without an attached time or\n * extra qualifier — useful for compact UI display.\n * @example\n * import {CandleLightingEvent} from '@hebcal/core';\n * // For a regular Event, renderBrief() == render():\n * const ev = new Event(new HDate(6, 'Sivan', 5749), 'Shavuot', flags.CHAG);\n * ev.renderBrief('en'); // 'Shavuot'\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n renderBrief(locale?: string): string {\n return this.render(locale);\n }\n /**\n * Returns the event's emoji character (e.g. `🕯️`, `🕎`, `🇮🇱`, `🍏🍯`),\n * or `null` if no emoji is associated with this event.\n * Subclasses override this to provide holiday-specific emoji.\n */\n getEmoji(): string | null {\n return this.emoji || null;\n }\n /**\n * Returns a simplified (untranslated) description for this event, suitable\n * for grouping related events under a single name.\n *\n * For example, {@link HolidayEvent} strips qualifiers so that\n * `\"Erev Pesach\"` → `\"Pesach\"` and `\"Sukkot III (CH''M)\"` → `\"Sukkot\"`.\n * For many events the basename and the event description are identical.\n * @example\n * import {HolidayEvent, HDate, months, flags} from '@hebcal/core';\n * const ev = new HolidayEvent(\n * new HDate(14, months.NISAN, 5784), 'Erev Pesach', flags.EREV);\n * ev.getDesc(); // 'Erev Pesach'\n * ev.basename(); // 'Pesach'\n */\n basename(): string {\n return this.getDesc();\n }\n /**\n * Returns a URL to hebcal.com or sefaria.org for more detail on the event,\n * or `undefined` for events with no detail page.\n *\n * Subclasses such as {@link HolidayEvent}, {@link ChanukahEvent},\n * {@link AsaraBTevetEvent}, {@link ParshaEvent}, and {@link OmerEvent}\n * override this with their own URL patterns.\n */\n url(): string | undefined {\n return undefined;\n }\n /**\n * Is this event observed in Israel?\n * @example\n * const ev1 = new Event(new HDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY);\n * ev1.observedInIsrael(); // false\n * const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);\n * ev2.observedInIsrael(); // true\n */\n observedInIsrael(): boolean {\n return !(this.mask & flags.CHUL_ONLY);\n }\n /**\n * Is this event observed in the Diaspora?\n * @example\n * const ev1 = new Event(new HDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY);\n * ev1.observedInDiaspora(); // true\n * const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);\n * ev2.observedInDiaspora(); // true\n */\n observedInDiaspora(): boolean {\n return !(this.mask & flags.IL_ONLY);\n }\n /**\n * Is this event observed in Israel/Diaspora?\n * @example\n * const ev1 = new Event(new HDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY);\n * ev1.observedIn(false); // true\n * ev1.observedIn(true); // false\n * const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);\n * ev2.observedIn(false); // true\n * ev2.observedIn(true); // true\n * @param il\n */\n observedIn(il: boolean): boolean {\n return il ? this.observedInIsrael() : this.observedInDiaspora();\n }\n /**\n * Returns an array of category strings classifying this event, derived\n * from its {@link flags} bitmask. The first element is the broad category\n * (e.g. `'holiday'`, `'roshchodesh'`, `'parashat'`, `'omer'`), followed\n * by zero or more refinements (e.g. `'major'`, `'minor'`, `'fast'`).\n *\n * Returns `['unknown']` if no flag maps to a known category.\n * @example\n * import {Event, HDate, flags} from '@hebcal/core';\n * new Event(new HDate(10, 'Tishrei', 5784), 'Yom Kippur', flags.MAJOR_FAST)\n * .getCategories(); // ['holiday', 'major', 'fast']\n * new Event(new HDate(1, 'Shvat', 5784), 'Rosh Chodesh Sh\\'vat', flags.ROSH_CHODESH)\n * .getCategories(); // ['roshchodesh']\n */\n getCategories(): string[] {\n const mask = this.getFlags();\n for (const attrs of flagToCategory) {\n const attr0 = attrs[0] as number;\n if (mask & attr0) {\n return attrs.slice(1) as string[];\n }\n }\n return ['unknown'];\n }\n}\n"],"names":[],"mappings":";;;;AAGA;;;;;AAKG;AACI,MAAM,KAAK,GAAG;;AAEnB,IAAA,IAAI,EAAE,QAAQ;;AAEd,IAAA,aAAa,EAAE,QAAQ;;AAEvB,IAAA,YAAY,EAAE,QAAQ;;AAEtB,IAAA,SAAS,EAAE,QAAQ;;AAEnB,IAAA,OAAO,EAAE,QAAQ;;AAEjB,IAAA,mBAAmB,EAAE,QAAQ;;AAE7B,IAAA,gBAAgB,EAAE,QAAQ;;AAE1B,IAAA,YAAY,EAAE,QAAQ;;AAEtB,IAAA,UAAU,EAAE,QAAQ;;AAEpB,IAAA,eAAe,EAAE,QAAQ;;AAEzB,IAAA,eAAe,EAAE,QAAQ;;AAEzB,IAAA,QAAQ,EAAE,QAAQ;;AAElB,IAAA,UAAU,EAAE,QAAQ;;AAEpB,IAAA,cAAc,EAAE,QAAQ;;AAExB,IAAA,UAAU,EAAE,QAAQ;;AAEpB,IAAA,iBAAiB,EAAE,QAAQ;;AAE3B,IAAA,KAAK,EAAE,QAAQ;;AAEf,IAAA,UAAU,EAAE,QAAQ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AC;IAC1C;AACA;;;;;;;;;;;;;AAaG;AACH,IAAA,WAAW,CAAC,MAAe,EAAA;AACzB,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;IAC5B;AACA;;;;AAIG;IACH,QAAQ,GAAA;AACN,QAAA,OAAO,IAAI,CAAC,KAAK,IAAI,IAAI;IAC3B;AACA;;;;;;;;;;;;;AAaG;IACH,QAAQ,GAAA;AACN,QAAA,OAAO,IAAI,CAAC,OAAO,EAAE;IACvB;AACA;;;;;;;AAOG;IACH,GAAG,GAAA;AACD,QAAA,OAAO,SAAS;IAClB;AACA;;;;;;;AAOG;IACH,gBAAgB,GAAA;QACd,OAAO,EAAE,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC;IACvC;AACA;;;;;;;AAOG;IACH,kBAAkB,GAAA;QAChB,OAAO,EAAE,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC;IACrC;AACA;;;;;;;;;;AAUG;AACH,IAAA,UAAU,CAAC,EAAW,EAAA;AACpB,QAAA,OAAO,EAAE,GAAG,IAAI,CAAC,gBAAgB,EAAE,GAAG,IAAI,CAAC,kBAAkB,EAAE;IACjE;AACA;;;;;;;;;;;;;AAaG;IACH,aAAa,GAAA;AACX,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE;AAC5B,QAAA,KAAK,MAAM,KAAK,IAAI,cAAc,EAAE;AAClC,YAAA,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAW;AAChC,YAAA,IAAI,IAAI,GAAG,KAAK,EAAE;AAChB,gBAAA,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAa;YACnC;QACF;QACA,OAAO,CAAC,SAAS,CAAC;IACpB;AACD;;;;"}
1
+ {"version":3,"file":"event.js","sources":["../../../src/event.ts"],"sourcesContent":["import {HDate, Locale} from '@hebcal/hdate';\nimport './locale'; // Adds Hebrew and Ashkenazic translations\n\n/**\n * Holiday flags for Event. These flags are typically\n * combined using bitwise arithmetic to form a mask.\n */\nexport const flags = {\n /** Chag, yontiff, yom tov */\n CHAG: 0x000001,\n /** Light candles before sundown */\n LIGHT_CANDLES: 0x000002,\n /** End of holiday (end of Yom Tov) */\n YOM_TOV_ENDS: 0x000004,\n /** Observed only in the Diaspora (chutz l'aretz) */\n CHUL_ONLY: 0x000008,\n /** Observed only in Israel */\n IL_ONLY: 0x000010,\n /** Light candles in the evening at Tzeit time (3 small stars) */\n LIGHT_CANDLES_TZEIS: 0x000020,\n /** Candle-lighting for Chanukah */\n CHANUKAH_CANDLES: 0x000040,\n /** Rosh Chodesh, beginning of a new Hebrew month */\n ROSH_CHODESH: 0x000080,\n /** Minor fasts like Tzom Tammuz, Ta'anit Esther, ... */\n MINOR_FAST: 0x000100,\n /** Shabbat Shekalim, Zachor, ... */\n SPECIAL_SHABBAT: 0x000200,\n /** Weekly sedrot on Saturdays */\n PARSHA_HASHAVUA: 0x000400,\n /** Daily page of Talmud (Bavli) */\n DAF_YOMI: 0x000800,\n /** Days of the Omer */\n OMER_COUNT: 0x001000,\n /** Yom HaShoah, Yom HaAtzma'ut, ... */\n MODERN_HOLIDAY: 0x002000,\n /** Yom Kippur and Tish'a B'Av */\n MAJOR_FAST: 0x004000,\n /** On the Saturday before Rosh Chodesh */\n SHABBAT_MEVARCHIM: 0x008000,\n /** Molad */\n MOLAD: 0x010000,\n /** Yahrzeit or Hebrew Anniversary */\n USER_EVENT: 0x020000,\n /** Daily Hebrew date (\"11th of Sivan, 5780\") */\n HEBREW_DATE: 0x040000,\n /** A holiday that's not major, modern, rosh chodesh, or a fast day */\n MINOR_HOLIDAY: 0x080000,\n /** Evening before a major or minor holiday */\n EREV: 0x100000,\n /** Chol haMoed, intermediate days of Pesach or Sukkot */\n CHOL_HAMOED: 0x200000,\n /** Mishna Yomi */\n MISHNA_YOMI: 0x400000,\n /** Yom Kippur Katan, minor day of atonement on the day preceeding each Rosh Chodesh */\n YOM_KIPPUR_KATAN: 0x800000,\n /** Daily page of Jerusalem Talmud (Yerushalmi) */\n YERUSHALMI_YOMI: 0x1000000,\n /** Nach Yomi */\n NACH_YOMI: 0x2000000,\n /** Daily Learning */\n DAILY_LEARNING: 0x4000000,\n /** Yizkor */\n YIZKOR: 0x8000000,\n /** BeHaB fast days on Monday, Thursday and Monday after Pesach and Sukkot */\n BEHAB: 0x10000000,\n} as const;\n\nconst flagToCategory = [\n [flags.MAJOR_FAST, 'holiday', 'major', 'fast'],\n [flags.CHANUKAH_CANDLES, 'holiday', 'minor'],\n [flags.HEBREW_DATE, 'hebdate'],\n [flags.MINOR_FAST, 'holiday', 'fast'],\n [flags.MINOR_HOLIDAY, 'holiday', 'minor'],\n [flags.MODERN_HOLIDAY, 'holiday', 'modern'],\n [flags.MOLAD, 'molad'],\n [flags.OMER_COUNT, 'omer'],\n [flags.PARSHA_HASHAVUA, 'parashat'], // backwards-compat\n [flags.ROSH_CHODESH, 'roshchodesh'],\n [flags.SHABBAT_MEVARCHIM, 'mevarchim'],\n [flags.SPECIAL_SHABBAT, 'holiday', 'shabbat'],\n [flags.USER_EVENT, 'user'],\n [flags.YIZKOR, 'yizkor'],\n] as const;\n\n/**\n * Represents an Event with a title, date, and flags.\n *\n * Events are used to represent holidays, candle-lighting times,\n * Torah readings, Omer days, Hebrew dates, and more. Most concrete event\n * types are subclasses (e.g. {@link HolidayEvent}, {@link TimedEvent},\n * {@link ParshaEvent}, {@link OmerEvent}) and are produced by\n * {@link calendar}.\n *\n * To get the title of the event in a language other than English with\n * Sephardic transliterations, use the {@link Event.render} method.\n *\n * @example\n * import {Event, HDate, flags} from '@hebcal/core';\n * const ev = new Event(new HDate(6, 'Sivan', 5749), 'Shavuot', flags.CHAG);\n * ev.getDate().toString(); // '6 Sivan 5749'\n * ev.getDesc(); // 'Shavuot'\n * ev.render('he'); // 'שָׁבוּעוֹת'\n */\nexport class Event {\n /** Hebrew date of this event */\n readonly date: HDate;\n /**\n * Untranslated title of this event. Note that these description\n * strings are always in English and will remain stable across releases.\n * To get the title of the event in another language, use the\n * `render()` method.\n */\n readonly desc: string;\n /** Bitmask of optional event flags. See {@link flags} */\n readonly mask: number;\n /** Optional emoji character such as ✡️, 🕯️, 🕎, 🕍, 🌒 */\n emoji?: string;\n /** Optional longer description or memo text */\n memo?: string;\n /** Alarms are used by iCalendar feeds */\n alarm?: Date | string | boolean;\n /**\n * Constructs Event\n * @param date Hebrew date event occurs\n * @param desc Description (not translated)\n * @param [mask=0] optional bitmask of holiday flags (see {@link flags})\n * @param [attrs={}] optional additional attributes (e.g. `eventTimeStr`, `cholHaMoedDay`)\n */\n constructor(date: HDate, desc: string, mask = 0, attrs?: object) {\n if (!HDate.isHDate(date)) {\n throw new TypeError(`Invalid Event date: ${date}`);\n }\n if (typeof desc !== 'string') {\n throw new TypeError(`Invalid Event description: ${desc}`);\n }\n this.date = date;\n this.desc = desc;\n this.mask = +mask;\n if (typeof attrs === 'object' && attrs !== null) {\n Object.assign(this, attrs);\n }\n }\n /**\n * Hebrew date of this event\n */\n getDate(): HDate {\n return this.date;\n }\n /**\n * Gregorian date of this event\n */\n greg(): Date {\n return this.date.greg();\n }\n /**\n * Untranslated title of this event. Note that these description\n * strings are always in English and will remain stable across releases.\n * To get the title of the event in another language, use the\n * `render()` method.\n */\n getDesc(): string {\n return this.desc;\n }\n /**\n * Bitmask of optional event flags. See {@link flags}\n */\n getFlags(): number {\n return this.mask;\n }\n /**\n * Returns (translated) description of this event\n * @example\n * const ev = new Event(new HDate(6, 'Sivan', 5749), 'Shavuot', flags.CHAG);\n * ev.render('en'); // 'Shavuot'\n * ev.render('he'); // 'שָׁבוּעוֹת'\n * ev.render('ashkenazi'); // 'Shavuos'\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n return Locale.gettext(this.desc, locale);\n }\n /**\n * Returns a brief (translated) description of this event.\n *\n * For most events this is the same as {@link render}. Some subclasses\n * (e.g. {@link CandleLightingEvent}, {@link HavdalahEvent},\n * {@link OmerEvent}) produce shorter text without an attached time or\n * extra qualifier — useful for compact UI display.\n * @example\n * import {CandleLightingEvent} from '@hebcal/core';\n * // For a regular Event, renderBrief() == render():\n * const ev = new Event(new HDate(6, 'Sivan', 5749), 'Shavuot', flags.CHAG);\n * ev.renderBrief('en'); // 'Shavuot'\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n renderBrief(locale?: string): string {\n return this.render(locale);\n }\n /**\n * Returns the event's emoji character (e.g. `🕯️`, `🕎`, `🇮🇱`, `🍏🍯`),\n * or `null` if no emoji is associated with this event.\n * Subclasses override this to provide holiday-specific emoji.\n */\n getEmoji(): string | null {\n return this.emoji || null;\n }\n /**\n * Returns a simplified (untranslated) description for this event, suitable\n * for grouping related events under a single name.\n *\n * For example, {@link HolidayEvent} strips qualifiers so that\n * `\"Erev Pesach\"` → `\"Pesach\"` and `\"Sukkot III (CH''M)\"` → `\"Sukkot\"`.\n * For many events the basename and the event description are identical.\n * @example\n * import {HolidayEvent, HDate, months, flags} from '@hebcal/core';\n * const ev = new HolidayEvent(\n * new HDate(14, months.NISAN, 5784), 'Erev Pesach', flags.EREV);\n * ev.getDesc(); // 'Erev Pesach'\n * ev.basename(); // 'Pesach'\n */\n basename(): string {\n return this.getDesc();\n }\n /**\n * Returns a URL to hebcal.com or sefaria.org for more detail on the event,\n * or `undefined` for events with no detail page.\n *\n * Subclasses such as {@link HolidayEvent}, {@link ChanukahEvent},\n * {@link AsaraBTevetEvent}, {@link ParshaEvent}, and {@link OmerEvent}\n * override this with their own URL patterns.\n */\n url(): string | undefined {\n return undefined;\n }\n /**\n * Is this event observed in Israel?\n * @example\n * const ev1 = new Event(new HDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY);\n * ev1.observedInIsrael(); // false\n * const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);\n * ev2.observedInIsrael(); // true\n */\n observedInIsrael(): boolean {\n return !(this.mask & flags.CHUL_ONLY);\n }\n /**\n * Is this event observed in the Diaspora?\n * @example\n * const ev1 = new Event(new HDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY);\n * ev1.observedInDiaspora(); // true\n * const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);\n * ev2.observedInDiaspora(); // true\n */\n observedInDiaspora(): boolean {\n return !(this.mask & flags.IL_ONLY);\n }\n /**\n * Is this event observed in Israel/Diaspora?\n * @example\n * const ev1 = new Event(new HDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY);\n * ev1.observedIn(false); // true\n * ev1.observedIn(true); // false\n * const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);\n * ev2.observedIn(false); // true\n * ev2.observedIn(true); // true\n * @param il\n */\n observedIn(il: boolean): boolean {\n return il ? this.observedInIsrael() : this.observedInDiaspora();\n }\n /**\n * Returns an array of category strings classifying this event, derived\n * from its {@link flags} bitmask. The first element is the broad category\n * (e.g. `'holiday'`, `'roshchodesh'`, `'parashat'`, `'omer'`), followed\n * by zero or more refinements (e.g. `'major'`, `'minor'`, `'fast'`).\n *\n * Returns `['unknown']` if no flag maps to a known category.\n * @example\n * import {Event, HDate, flags} from '@hebcal/core';\n * new Event(new HDate(10, 'Tishrei', 5784), 'Yom Kippur', flags.MAJOR_FAST)\n * .getCategories(); // ['holiday', 'major', 'fast']\n * new Event(new HDate(1, 'Shvat', 5784), 'Rosh Chodesh Sh\\'vat', flags.ROSH_CHODESH)\n * .getCategories(); // ['roshchodesh']\n */\n getCategories(): string[] {\n const mask = this.getFlags();\n for (const attrs of flagToCategory) {\n const attr0 = attrs[0] as number;\n if (mask & attr0) {\n return attrs.slice(1) as string[];\n }\n }\n return ['unknown'];\n }\n}\n"],"names":[],"mappings":";;;;AAGA;;;AAGG;AACI,MAAM,KAAK,GAAG;;AAEnB,IAAA,IAAI,EAAE,QAAQ;;AAEd,IAAA,aAAa,EAAE,QA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AC,gBAAgB,EAAE,GAAG,IAAI,CAAC,kBAAkB,EAAE;IACjE;AACA;;;;;;;;;;;;;AAaG;IACH,aAAa,GAAA;AACX,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE;AAC5B,QAAA,KAAK,MAAM,KAAK,IAAI,cAAc,EAAE;AAClC,YAAA,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAW;AAChC,YAAA,IAAI,IAAI,GAAG,KAAK,EAAE;AAChB,gBAAA,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAa;YACnC;QACF;QACA,OAAO,CAAC,SAAS,CAAC;IACpB;AACD;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.8.2, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.9.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import { months, isDate, greg2abs, HDate, daysInGregMonth } from '@hebcal/hdate';
3
3
 
4
4
  const TISHREI = months.TISHREI;
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.8.2, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.9.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import { months } from '@hebcal/hdate';
3
3
  import { flags } from './event.js';
4
4
  import { holidayDesc } from './staticHolidays.js';
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.8.2, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.9.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  var noNikudOverride = { "headers": { "plural-forms": "nplurals=2; plural=(n != 1);", "language": "he-x-NoNikud" }, "contexts": { "": { "Korach": ["קורח"], "Chukat": ["חוקת"], "Erev Yom Kippur": ["ערב יום כיפור"], "Yom Kippur": ["יום כיפור"], "Yom Kippur Katan": ["יום כיפור קטן"], "Pesach Shabbat Chol ha-Moed": ["שבת חול המועד פסח"], "Sukkot Shabbat Chol ha-Moed": ["שבת חול המועד סוכות"], "Erev Sukkot": ["ערב סוכות"], "Sukkot": ["סוכות"], "Sukkot I": ["סוכות א׳"], "Sukkot II": ["סוכות ב׳"], "Sukkot II (CH''M)": ["סוכות ב׳ (חוה״מ)"], "Sukkot III (CH''M)": ["סוכות ג׳ (חוה״מ)"], "Sukkot IV (CH''M)": ["סוכות ד׳ (חוה״מ)"], "Sukkot V (CH''M)": ["סוכות ה׳ (חוה״מ)"], "Sukkot VI (CH''M)": ["סוכות ו׳ (חוה״מ)"], "Sukkot VII (Hoshana Raba)": ["סוכות ז׳ (הושענא רבה)"] } } };
3
3
 
4
4
  export { noNikudOverride as default };
package/dist/esm/he.po.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.8.2, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.9.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  var poHe = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);", "language": "he_IL" }, "contexts": { "": { "Shabbat": ["שַׁבָּת"], "Parashat": ["פָּרָשַׁת"], "Achrei Mot": ["אַחֲרֵי מוֹת"], "Balak": ["בָּלָק"], "Bamidbar": ["בְּמִדְבַּר"], "Bechukotai": ["בְּחֻקֹּתַי"], "Beha'alotcha": ["בְּהַעֲלֹתְךָ"], "Behar": ["בְּהַר"], "Bereshit": ["בְּרֵאשִׁית"], "Beshalach": ["בְּשַׁלַּח"], "Bo": ["בֹּא"], "Chayei Sara": ["חַיֵּי שָֹרָה"], "Chukat": ["חֻקַּת"], "Devarim": ["דְּבָרִים"], "Eikev": ["עֵקֶב"], "Emor": ["אֱמוֹר"], "Ha'azinu": ["הַאֲזִינוּ"], "Kedoshim": ["קְדֹשִׁים"], "Ki Tavo": ["כִּי־תָבוֹא"], "Ki Teitzei": ["כִּי־תֵצֵא"], "Ki Tisa": ["כִּי תִשָּׂא"], "Korach": ["קֹרַח"], "Lech-Lecha": ["לֶךְ־לְךָ"], "Masei": ["מַסְעֵי"], "Matot": ["מַטּוֹת"], "Metzora": ["מְצֹרָע"], "Miketz": ["מִקֵּץ"], "Mishpatim": ["מִשְׁפָּטִים"], "Nasso": ["נָשׂא"], "Nitzavim": ["נִצָּבִים"], "Noach": ["נֹחַ"], "Pekudei": ["פְקוּדֵי"], "Pinchas": ["פִּינְחָס"], "Re'eh": ["רְאֵה"], "Sh'lach": ["שְׁלַח־לְךָ"], "Shemot": ["שְׁמוֹת"], "Shmini": ["שְּׁמִינִי"], "Shoftim": ["שׁוֹפְטִים"], "Tazria": ["תַזְרִיעַ"], "Terumah": ["תְּרוּמָה"], "Tetzaveh": ["תְּצַוֶּה"], "Toldot": ["תּוֹלְדוֹת"], "Tzav": ["צַו"], "Vaera": ["וָאֵרָא"], "Vaetchanan": ["וָאֶתְחַנַּן"], "Vayakhel": ["וַיַּקְהֵל"], "Vayechi": ["וַיְחִי"], "Vayeilech": ["וַיֵּלֶךְ"], "Vayera": ["וַיֵּרָא"], "Vayeshev": ["וַיֵּשֶׁב"], "Vayetzei": ["וַיֵּצֵא"], "Vayigash": ["וַיִּגַּשׁ"], "Vayikra": ["וַיִּקְרָא"], "Vayishlach": ["וַיִּשְׁלַח"], "Vezot Haberakhah": ["וְזֹאת הַבְּרָכָה"], "Yitro": ["יִתְרוֹ"], "Asara B'Tevet": ["עֲשָׂרָה בְּטֵבֵת"], "Candle lighting": ["הַדְלָקַת נֵרוֹת"], "Chanukah": ["חֲנוּכָּה"], "Chanukah: 1 Candle": ["חֲנוּכָּה: א׳ נֵר"], "Chanukah: 2 Candles": ["חֲנוּכָּה: ב׳ נֵרוֹת"], "Chanukah: 3 Candles": ["חֲנוּכָּה: ג׳ נֵרוֹת"], "Chanukah: 4 Candles": ["חֲנוּכָּה: ד׳ נֵרוֹת"], "Chanukah: 5 Candles": ["חֲנוּכָּה: ה׳ נֵרוֹת"], "Chanukah: 6 Candles": ["חֲנוּכָּה: ו׳ נֵרוֹת"], "Chanukah: 7 Candles": ["חֲנוּכָּה: ז׳ נֵרוֹת"], "Chanukah: 8 Candles": ["חֲנוּכָּה: ח׳ נֵרוֹת"], "Chanukah: 8th Day": ["חֲנוּכָּה: יוֹם ח׳"], "Days of the Omer": ["סְפִירַת הָעוֹמֶר"], "Omer": ["עוֹמֶר"], "day of the Omer": ["בָּעוֹמֶר"], "Erev Pesach": ["עֶרֶב פֶּסַח"], "Erev Purim": ["עֶרֶב פּוּרִים"], "Erev Rosh Hashana": ["עֶרֶב רֹאשׁ הַשָּׁנָה"], "Erev Shavuot": ["עֶרֶב שָׁבוּעוֹת"], "Erev Simchat Torah": ["עֶרֶב שִׂמְחַת תּוֹרָה"], "Erev Sukkot": ["עֶרֶב סֻכּוֹת"], "Erev Tish'a B'Av": ["עֶרֶב תִּשְׁעָה בְּאָב"], "Erev Yom Kippur": ["עֶרֶב יוֹם כִּפּוּר"], "Havdalah": ["הַבְדָּלָה"], "Lag BaOmer": ["ל״ג בָּעוֹמֶר"], "Leil Selichot": ["סְלִיחוֹת"], "Pesach": ["פֶּסַח"], "Pesach I": ["פֶּסַח א׳"], "Pesach II": ["פֶּסַח ב׳"], "Pesach II (CH''M)": ["פֶּסַח ב׳ (חוה״מ)"], "Pesach III (CH''M)": ["פֶּסַח ג׳ (חוה״מ)"], "Pesach IV (CH''M)": ["פֶּסַח ד׳ (חוה״מ)"], "Pesach Sheni": ["פֶּסַח שֵׁנִי"], "Pesach V (CH''M)": ["פֶּסַח ה׳ (חוה״מ)"], "Pesach VI (CH''M)": ["פֶּסַח ו׳ (חוה״מ)"], "Pesach VII": ["פֶּסַח ז׳"], "Pesach VIII": ["פֶּסַח ח׳"], "Pesach Shabbat Chol ha-Moed": ["שַׁבַּת חֹל הַמּוֹעֵד פֶּסַח"], "Purim": ["פּוּרִים"], "Purim Katan": ["פּוּרִים קָטָן"], "Rosh Chodesh": ["רֹאשׁ חוֹדֶשׁ"], "Rosh Hashana": ["רֹאשׁ הַשָּׁנָה"], "Rosh Hashana I": ["רֹאשׁ הַשָּׁנָה א׳"], "Rosh Hashana II": ["רֹאשׁ הַשָּׁנָה ב׳"], "Shabbat Chazon": ["שַׁבַּת חֲזוֹן"], "Shabbat HaChodesh": ["שַׁבַּת הַחֹדֶשׁ"], "Shabbat HaGadol": ["שַׁבַּת הַגָּדוֹל"], "Shabbat Nachamu": ["שַׁבַּת נַחֲמוּ"], "Shabbat Parah": ["שַׁבַּת פָּרָה"], "Shabbat Shekalim": ["שַׁבַּת שְׁקָלִים"], "Shabbat Shuva": ["שַׁבַּת שׁוּבָה"], "Shabbat Zachor": ["שַׁבַּת זָכוֹר"], "Shavuot": ["שָׁבוּעוֹת"], "Shavuot I": ["שָׁבוּעוֹת א׳"], "Shavuot II": ["שָׁבוּעוֹת ב׳"], "Shmini Atzeret": ["שְׁמִינִי עֲצֶרֶת"], "Shushan Purim": ["שׁוּשָׁן פּוּרִים"], "Sigd": ["חַג הַסִּיגְד"], "Simchat Torah": ["שִׂמְחַת תּוֹרָה"], "Sukkot": ["סֻכּוֹת"], "Sukkot I": ["סֻכּוֹת א׳"], "Sukkot II": ["סֻכּוֹת ב׳"], "Sukkot II (CH''M)": ["סֻכּוֹת ב׳ (חוה״מ)"], "Sukkot III (CH''M)": ["סֻכּוֹת ג׳ (חוה״מ)"], "Sukkot IV (CH''M)": ["סֻכּוֹת ד׳ (חוה״מ)"], "Sukkot V (CH''M)": ["סֻכּוֹת ה׳ (חוה״מ)"], "Sukkot VI (CH''M)": ["סֻכּוֹת ו׳ (חוה״מ)"], "Sukkot VII (Hoshana Raba)": ["סֻכּוֹת ז׳ (הוֹשַׁעְנָא רַבָּה)"], "Sukkot Shabbat Chol ha-Moed": ["שַׁבַּת חֹל הַמּוֹעֵד סֻכּוֹת"], "Ta'anit Bechorot": ["תַּעֲנִית בְּכוֹרוֹת"], "Ta'anit BeHaB": ["תַּעֲנִית בה״ב"], "Ta'anit Esther": ["תַּעֲנִית אֶסְתֵּר"], "Tish'a B'Av": ["תִּשְׁעָה בְּאָב"], "Tu B'Av": ["ט״וּ בְּאָב"], "Tu BiShvat": ["ט״וּ בִּשְׁבָט"], "Tu B'Shvat": ["ט״וּ בִּשְׁבָט"], "Tzom Gedaliah": ["צוֹם גְּדַלְיָה"], "Tzom Tammuz": ["צוֹם י״ז בְּתַמּוּז"], "Yom HaAtzma'ut": ["יוֹם הָעַצְמָאוּת"], "Yom HaShoah": ["יוֹם הַשּׁוֹאָה"], "Yom HaZikaron": ["יוֹם הַזִּכָּרוֹן"], "Yom Kippur": ["יוֹם כִּפּוּר"], "Yom Yerushalayim": ["יוֹם יְרוּשָׁלַיִם"], "Yom HaAliyah": ["יוֹם הַעֲלִיָּה"], "Yom HaAliyah School Observance": ["שְׁמִירָת בֵּית הַסֵפֶר לְיוֹם הַעֲלִיָּה"], "Rosh Chodesh Adar": ["רֹאשׁ חוֹדֶשׁ אֲדָר"], "Rosh Chodesh Adar I": ["רֹאשׁ חוֹדֶשׁ אֲדָר א׳"], "Rosh Chodesh Adar II": ["רֹאשׁ חוֹדֶשׁ אֲדָר ב׳"], "Rosh Chodesh Av": ["רֹאשׁ חוֹדֶשׁ אָב"], "Rosh Chodesh Cheshvan": ["רֹאשׁ חוֹדֶשׁ חֶשְׁוָן"], "Rosh Chodesh Elul": ["רֹאשׁ חוֹדֶשׁ אֱלוּל"], "Rosh Chodesh Iyyar": ["רֹאשׁ חוֹדֶשׁ אִיָּיר"], "Rosh Chodesh Kislev": ["רֹאשׁ חוֹדֶשׁ כִּסְלֵו"], "Rosh Chodesh Nisan": ["רֹאשׁ חוֹדֶשׁ נִיסָן"], "Rosh Chodesh Sh'vat": ["רֹאשׁ חוֹדֶשׁ שְׁבָט"], "Rosh Chodesh Sivan": ["רֹאשׁ חוֹדֶשׁ סִיוָן"], "Rosh Chodesh Tamuz": ["רֹאשׁ חוֹדֶשׁ תַּמּוּז"], "Rosh Chodesh Tammuz": ["רֹאשׁ חוֹדֶשׁ תַּמּוּז"], "Rosh Chodesh Tevet": ["רֹאשׁ חוֹדֶשׁ טֵבֵת"], "min": ["דַּקּוֹת"], "Fast begins": ["תְּחִילַּת הַצוֹם"], "Fast ends": ["סִיּוּם הַצוֹם"], "Rosh Hashana LaBehemot": ["רֹאשׁ הַשָּׁנָה לְמַעְשַׂר בְּהֵמָה"], "Tish'a B'Av (observed)": ["(תִּשְׁעָה בְּאָב (נִדְחָה"], "Shabbat Mevarchim Chodesh": ["שַׁבַּת מְבָרְכִים חוֹדֶשׁ"], "Shabbat Shirah": ["שַׁבַּת שִׁירָה"], "Lovingkindness": ["חֶסֶד"], "Might": ["גְּבוּרָה"], "Beauty": ["תִּפְאֶרֶת"], "Eternity": ["נֶּצַח"], "Splendor": ["הוֹד"], "Foundation": ["יְּסוֹד"], "Majesty": ["מַּלְכוּת"], "day": ["יוֹם"], "Yom Kippur Katan": ["יוֹם כִּפּוּר קָטָן"], "Yizkor": ["יִזְכּוֹר"], "Family Day": ["יוֹם הַמִּשׁפָּחָה"], "Yitzhak Rabin Memorial Day": ["יוֹם הַזִּכָּרוֹן לְיִצְחָק רַבִּין"], "Jabotinsky Day": ["יוֹם זַ׳בּוֹטִינְסְקִי"], "Herzl Day": ["יוֹם הֶרְצְל"], "Ben-Gurion Day": ["יוֹם בֶּן־גּוּרִיּוֹן"], "Hebrew Language Day": ["יוֹם הַשָׂפָה הַעִברִית"], "Birkat Hachamah": ["בִּרְכַּת הַחַמָּה"], "Birkat HaChamah": ["בִּרְכַּת הַחַמָּה"], "Shushan Purim Katan": ["שׁוּשָׁן פּוּרִים קָטָן"], "Purim Meshulash": ["פּוּרִים מְשׁוּלָּשׁ"], "Chag HaBanot": ["חַג הַבָּנוֹת"], "Molad": ["מוֹלָד הָלְּבָנָה"], "chalakim": ["חֲלָקִים"], "Alot HaShachar": ["עֲלוֹת הַשַּׁחַר"], "Misheyakir": ["מִשֶּׁיַּכִּיר"], "Misheyakir Machmir": ["מִשֶּׁיַּכִּיר מַחְמִיר"], "Sunrise": ["נֵץ הַחַמָּה"], "Kriat Shema, sof zeman": ["סוֹף זְמַן קְרִיאַת שְׁמַע"], "Tefilah, sof zeman": ["סוֹף זְמַן תְּפִלָּה"], "Kriat Shema, sof zeman (MGA)": ["סוֹף זְמַן קְרִיאַת שְׁמַע (מג״א)"], "Kriat Shema, sof zeman (GRA)": ["סוֹף זְמַן קְרִיאַת שְׁמַע (גְּרָ״א)"], "Tefilah, sof zeman (MGA)": ["סוֹף זְמַן תְּפִלָּה (מג״א)"], "Tefilah, sof zeman (GRA)": ["סוֹף זְמַן תְּפִלָּה (גְּרָ״א)"], "Chatzot HaLailah": ["חֲצוֹת הַלַּיְלָה"], "Chatzot HaYom": ["חֲצוֹת הַיּוֹם"], "Chatzot hayom": ["חֲצוֹת הַיּוֹם"], "Mincha Gedolah": ["מִנְחָה גְּדוֹלָה"], "Mincha Ketanah": ["מִנְחָה קְטַנָּה"], "Plag HaMincha": ["פְּלַג הַמִּנְחָה"], "Sunset": ["שְׁקִיעַת הַחַמָּה"], "Bein HaShemashot": ["בֵּין הַשְּׁמָשׁוֹת"], "Tzeit HaKochavim": ["צֵאת הַכּוֹכָבִים"], "Biur Chametz": ["בִּעוּר חָמֵץ"], "Finish eating chametz": ["סוֹף זְמַן אֲכִילַת חָמֵץ"] } } };
3
3
 
4
4
  export { poHe as default };
@@ -21,92 +21,12 @@ export declare class HebrewCalendar {
21
21
  * a description, flags and optional attributes.
22
22
  * If given no options, returns holidays for the Diaspora for the current Gregorian year.
23
23
  *
24
- * The date range returned by this function can be controlled by:
25
- * * `options.year` - Gregorian (e.g. 1993) or Hebrew year (e.g. 5749)
26
- * * `options.isHebrewYear` - to interpret `year` as Hebrew year
27
- * * `options.numYears` - generate calendar for multiple years (default 1, maximum 2000)
28
- * * `options.month` - Gregorian or Hebrew month (to filter results to a single month)
29
- *
30
- * Alternatively, specify start and end days with `Date` or {@link HDate} instances:
31
- * * `options.start` - use specific start date (requires `end` date)
32
- * * `options.end` - use specific end date (requires `start` date)
33
- *
34
- * Unless `options.noHolidays == true`, default holidays include:
35
- * * Major holidays - Rosh Hashana, Yom Kippur, Pesach, Sukkot, etc.
36
- * * Minor holidays - Purim, Chanukah, Tu BiShvat, Lag BaOmer, etc.
37
- * * Minor fasts - Ta'anit Esther, Tzom Gedaliah, etc. (unless `options.noMinorFast`)
38
- * * Special Shabbatot - Shabbat Shekalim, Zachor, etc. (unless `options.noSpecialShabbat`)
39
- * * Modern Holidays - Yom HaShoah, Yom HaAtzma'ut, etc. (unless `options.noModern`)
40
- * * Rosh Chodesh (unless `options.noRoshChodesh`)
41
- *
42
- * Holiday and Torah reading schedules differ between Israel and the Disapora.
43
- * Set `options.il=true` to use the Israeli schedule.
44
- *
45
- * Additional non-default event types can be specified:
46
- * * Parashat HaShavua - weekly Torah Reading on Saturdays (`options.sedrot`)
47
- * * Counting of the Omer (`options.omer`)
48
- * * Shabbat Mevarchim HaChodesh on Saturday before Rosh Chodesh (`options.shabbatMevarchim`)
49
- * * Molad announcement on Saturday before Rosh Chodesh (`options.molad`)
50
- * * Yom Kippur Katan (`options.yomKippurKatan`)
51
- * * Yizkor (`options.yizkor`)
52
- *
53
- * Daily Study of texts are supported by the
54
- * {@link https://github.com/hebcal/hebcal-learning @hebcal/learning} package,
55
- * for example:
56
- * * Babylonian Talmud Daf Yomi (`options.dailyLearning.dafYomi`)
57
- * * Jerusalem Talmud (Yerushalmi) Yomi (`options.dailyLearning.yerushalmi`)
58
- * * Mishna Yomi (`options.dailyLearning.mishnaYomi`)
59
- * * Nach Yomi (`options.dailyLearning.nachYomi`)
60
- *
61
- * Candle-lighting and Havdalah times are approximated using latitude and longitude
62
- * specified by the {@link Location} class. The `Location` class contains a small
63
- * database of cities with their associated geographic information and time-zone information.
64
- * If you ever have any doubts about Hebcal's times, consult your local halachic authority.
65
- * If you enter geographic coordinates above the arctic circle or antarctic circle,
66
- * the times are guaranteed to be wrong.
67
- *
68
- * To add candle-lighting options, set `options.candlelighting=true` and set
69
- * `options.location` to an instance of `Location`. By default, candle lighting
70
- * time is 18 minutes before sundown (40 minutes for Jerusalem,
71
- * 30 minutes for Haifa and Zikhron Ya'akov) and Havdalah is
72
- * calculated according to Tzeit Hakochavim - Nightfall (the point when 3 small stars
73
- * are observable in the night time sky with the naked eye). The default Havdalah
74
- * option (Tzeit Hakochavim) is calculated when the sun is 8.5° below the horizon.
75
- * These defaults can be changed using these options:
76
- * * `options.candleLightingMins` - minutes before sundown to light candles
77
- * * `options.havdalahMins` - minutes after sundown for Havdalah (typical values are 42, 50, or 72).
78
- * Havdalah times are suppressed when `options.havdalahMins=0`.
79
- * * `options.havdalahDeg` - degrees for solar depression for Havdalah.
80
- * Default is 8.5 degrees for 3 small stars. Use 7.083 degrees for 3 medium-sized stars.
81
- * Havdalah times are suppressed when `options.havdalahDeg=0`.
82
- *
83
- * If both `options.candlelighting=true` and `options.location` is specified,
84
- * Chanukah candle-lighting times and minor fast start/end times will also be generated.
85
- * Chanukah candle-lighting is at Bein HaShmashos (13.5 minutes before
86
- * the sun is 7.083° below the horizon in the evening)
87
- * on weekdays, at regular candle-lighting time on Fridays, and at regular Havdalah time on
88
- * Saturday night (see above).
89
- *
90
- * Minor fasts begin at Alot HaShachar (sun is 16.1° below the horizon in the morning) and
91
- * end when 3 medium-sized stars are observable in the night sky (sun is 7.083° below the horizon
92
- * in the evening).
93
- *
94
- * Two options also exist for generating an Event with the Hebrew date:
95
- * * `options.addHebrewDates` - print the Hebrew date for the entire date range
96
- * * `options.addHebrewDatesForEvents` - print the Hebrew date for dates with some events
97
- *
98
- * Lastly, translation and transliteration of event titles is controlled by
99
- * `options.locale` and the {@link Locale} API.
100
- * `@hebcal/core` supports three locales by default:
101
- * * `en` - default, Sephardic transliterations (e.g. "Shabbat")
102
- * * `ashkenazi` - Ashkenazi transliterations (e.g. "Shabbos")
103
- * * `he` - Hebrew (e.g. "שַׁבָּת")
104
- *
105
- * Additional locales (such as `ru` or `fr`) are supported by the
106
- * {@link https://github.com/hebcal/hebcal-locales @hebcal/locales} package
24
+ * This is a convenience wrapper around the standalone {@link calendar} function.
25
+ * See {@link calendar} for the complete list of supported options, the
26
+ * candle-lighting and Havdalah defaults, and notes on locales.
107
27
  *
108
28
  * @example
109
- * import {HebrewCalendar, HDate, Location, Event} from '@hebcal/core';
29
+ * import {HebrewCalendar, Location} from '@hebcal/core';
110
30
  * const options: CalOptions = {
111
31
  * year: 1981,
112
32
  * isHebrewYear: false,
@@ -125,8 +45,12 @@ export declare class HebrewCalendar {
125
45
  static calendar(options?: CalOptions): Event[];
126
46
  /**
127
47
  * Calculates a birthday or anniversary (non-yahrzeit).
128
- * `hyear` must be after original `gdate` of anniversary.
129
- * Returns `undefined` when requested year preceeds or is same as original year.
48
+ * Returns `undefined` when `hyear` precedes the original year of `gdate`.
49
+ *
50
+ * When `hyear` is the original year, the original date is returned unchanged —
51
+ * a "0th birthday" is a meaningful thing to ask for. This differs from
52
+ * {@link getYahrzeit}, which returns `undefined` for the original year,
53
+ * because a yahrzeit only has meaning from the first anniversary onward.
130
54
  *
131
55
  * Hebcal uses the algorithm defined in "Calendrical Calculations"
132
56
  * by Edward M. Reingold and Nachum Dershowitz.
@@ -244,9 +168,12 @@ export declare class HebrewCalendar {
244
168
  * (Shabbat) to also be a sacred day.
245
169
  * @example
246
170
  * import {HebrewCalendar} from '@hebcal/core';
247
- * // Thursday April 25, 2024 — first day of Pesach 5784, with Shabbat
248
- * // chol ha-moed the next day, so Eruv Tavshilin is required:
249
- * HebrewCalendar.eruvTavshilin(new Date(2024, 3, 25), false); // true
171
+ * // Wednesday October 16, 2024 is Erev Sukkot 5785. In the Diaspora,
172
+ * // Sukkot I falls on Thursday and Sukkot II on Friday, so Eruv
173
+ * // Tavshilin is prepared on Wednesday:
174
+ * HebrewCalendar.eruvTavshilin(new Date(2024, 9, 16), false); // true
175
+ * // In Israel there is only one day of Yom Tov, so Friday is a weekday:
176
+ * HebrewCalendar.eruvTavshilin(new Date(2024, 9, 16), true); // false
250
177
  * @param date Gregorian or Hebrew date to test
251
178
  * @param il use the Israeli holiday schedule
252
179
  */
@@ -267,12 +194,12 @@ export declare class HebrewCalendar {
267
194
  * HebrewCalendar.reformatTimeStr('20:30', 'pm', {hour12: false}); // '20:30'
268
195
  * @param timeStr - original time like "20:30"
269
196
  * @param suffix - "p" or "pm" or " P.M.". Add leading space if you want it
270
- * @param options
197
+ * @param options optional; `location`, `locale` and `hour12` are consulted
271
198
  */
272
- static reformatTimeStr(timeStr: string, suffix: string, options: CalOptions): string;
199
+ static reformatTimeStr(timeStr: string, suffix: string, options?: CalOptions): string;
273
200
  /**
274
201
  * Returns the semantic version string of the `@hebcal/core` package
275
- * (e.g. `"5.10.0"`). Useful for logging or feature detection.
202
+ * (e.g. `"6.8.2"`). Useful for logging or feature detection.
276
203
  */
277
204
  static version(): string;
278
205
  /**
@@ -283,10 +210,10 @@ export declare class HebrewCalendar {
283
210
  * since an internal LRU cache (~120 entries) avoids recomputing the
284
211
  * keviyah-specific reading pattern.
285
212
  * @example
286
- * import {HebrewCalendar} from '@hebcal/core';
213
+ * import {HebrewCalendar, HDate} from '@hebcal/core';
287
214
  * const sedra = HebrewCalendar.getSedra(5784, false);
288
215
  * const result = sedra.lookup(new HDate(15, 'Cheshvan', 5784));
289
- * console.log(result.parsha); // ['Lech-Lecha']
216
+ * console.log(result.parsha); // ['Vayera']
290
217
  * @param hyear Hebrew year
291
218
  * @param il Use Israel sedra schedule (`false` for Diaspora)
292
219
  */
@@ -301,12 +228,14 @@ export declare class HebrewCalendar {
301
228
  * Yom Ha'atzmaut, and Yom Yerushalayim.
302
229
  *
303
230
  * Half Hallel is said on Rosh Chodesh (not Rosh Hashanah), and the last 6 days of Pesach.
304
- * @returns 0 for no Hallel, 1 for half Hallel, 2 for whole Hallel
305
231
  * @example
306
232
  * import {HebrewCalendar, HDate, months} from '@hebcal/core';
307
233
  * HebrewCalendar.hallel(new HDate(25, months.KISLEV, 5784), false); // 2 (Chanukah)
308
234
  * HebrewCalendar.hallel(new HDate(1, months.SHVAT, 5784), false); // 1 (Rosh Chodesh)
309
235
  * HebrewCalendar.hallel(new HDate(2, months.SHVAT, 5784), false); // 0
236
+ * @param hdate Hebrew date to test
237
+ * @param il use the Israeli holiday schedule
238
+ * @returns 0 for no Hallel, 1 for half Hallel, 2 for whole Hallel
310
239
  */
311
240
  static hallel(hdate: HDate, il: boolean): number;
312
241
  /**
@@ -327,12 +256,18 @@ export declare class HebrewCalendar {
327
256
  * @example
328
257
  * import {HebrewCalendar, HDate, months} from '@hebcal/core';
329
258
  * // Regular weekday — Tachanun is said at both services
330
- * HebrewCalendar.tachanun(new HDate(2, months.SHVAT, 5784), false);
259
+ * HebrewCalendar.tachanun(new HDate(4, months.SHVAT, 5784), false);
331
260
  * // => { shacharit: true, mincha: true, allCongs: true }
332
261
  *
262
+ * // Friday 2 Sh'vat — said at Shacharit, but not at Mincha (erev Shabbat)
263
+ * HebrewCalendar.tachanun(new HDate(2, months.SHVAT, 5784), false);
264
+ * // => { shacharit: true, mincha: false, allCongs: true }
265
+ *
333
266
  * // Rosh Chodesh — no Tachanun
334
267
  * HebrewCalendar.tachanun(new HDate(1, months.SHVAT, 5784), false);
335
268
  * // => { shacharit: false, mincha: false, allCongs: false }
269
+ * @param hdate Hebrew date to test
270
+ * @param il use the Israeli holiday schedule
336
271
  */
337
272
  static tachanun(hdate: HDate, il: boolean): TachanunResult;
338
273
  }
@@ -1,5 +1,5 @@
1
- /*! @hebcal/core v6.8.2, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
- import { getBirthdayHD, HDate, getYahrzeitHD } from '@hebcal/hdate';
1
+ /*! @hebcal/core v6.9.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
+ import { birthdayOrAnniversary, yahrzeit, HDate } from '@hebcal/hdate';
3
3
  import './locale.js';
4
4
  import { version } from './pkgVersion.js';
5
5
  import { flags } from './event.js';
@@ -45,92 +45,12 @@ class HebrewCalendar {
45
45
  * a description, flags and optional attributes.
46
46
  * If given no options, returns holidays for the Diaspora for the current Gregorian year.
47
47
  *
48
- * The date range returned by this function can be controlled by:
49
- * * `options.year` - Gregorian (e.g. 1993) or Hebrew year (e.g. 5749)
50
- * * `options.isHebrewYear` - to interpret `year` as Hebrew year
51
- * * `options.numYears` - generate calendar for multiple years (default 1, maximum 2000)
52
- * * `options.month` - Gregorian or Hebrew month (to filter results to a single month)
53
- *
54
- * Alternatively, specify start and end days with `Date` or {@link HDate} instances:
55
- * * `options.start` - use specific start date (requires `end` date)
56
- * * `options.end` - use specific end date (requires `start` date)
57
- *
58
- * Unless `options.noHolidays == true`, default holidays include:
59
- * * Major holidays - Rosh Hashana, Yom Kippur, Pesach, Sukkot, etc.
60
- * * Minor holidays - Purim, Chanukah, Tu BiShvat, Lag BaOmer, etc.
61
- * * Minor fasts - Ta'anit Esther, Tzom Gedaliah, etc. (unless `options.noMinorFast`)
62
- * * Special Shabbatot - Shabbat Shekalim, Zachor, etc. (unless `options.noSpecialShabbat`)
63
- * * Modern Holidays - Yom HaShoah, Yom HaAtzma'ut, etc. (unless `options.noModern`)
64
- * * Rosh Chodesh (unless `options.noRoshChodesh`)
65
- *
66
- * Holiday and Torah reading schedules differ between Israel and the Disapora.
67
- * Set `options.il=true` to use the Israeli schedule.
68
- *
69
- * Additional non-default event types can be specified:
70
- * * Parashat HaShavua - weekly Torah Reading on Saturdays (`options.sedrot`)
71
- * * Counting of the Omer (`options.omer`)
72
- * * Shabbat Mevarchim HaChodesh on Saturday before Rosh Chodesh (`options.shabbatMevarchim`)
73
- * * Molad announcement on Saturday before Rosh Chodesh (`options.molad`)
74
- * * Yom Kippur Katan (`options.yomKippurKatan`)
75
- * * Yizkor (`options.yizkor`)
76
- *
77
- * Daily Study of texts are supported by the
78
- * {@link https://github.com/hebcal/hebcal-learning @hebcal/learning} package,
79
- * for example:
80
- * * Babylonian Talmud Daf Yomi (`options.dailyLearning.dafYomi`)
81
- * * Jerusalem Talmud (Yerushalmi) Yomi (`options.dailyLearning.yerushalmi`)
82
- * * Mishna Yomi (`options.dailyLearning.mishnaYomi`)
83
- * * Nach Yomi (`options.dailyLearning.nachYomi`)
84
- *
85
- * Candle-lighting and Havdalah times are approximated using latitude and longitude
86
- * specified by the {@link Location} class. The `Location` class contains a small
87
- * database of cities with their associated geographic information and time-zone information.
88
- * If you ever have any doubts about Hebcal's times, consult your local halachic authority.
89
- * If you enter geographic coordinates above the arctic circle or antarctic circle,
90
- * the times are guaranteed to be wrong.
91
- *
92
- * To add candle-lighting options, set `options.candlelighting=true` and set
93
- * `options.location` to an instance of `Location`. By default, candle lighting
94
- * time is 18 minutes before sundown (40 minutes for Jerusalem,
95
- * 30 minutes for Haifa and Zikhron Ya'akov) and Havdalah is
96
- * calculated according to Tzeit Hakochavim - Nightfall (the point when 3 small stars
97
- * are observable in the night time sky with the naked eye). The default Havdalah
98
- * option (Tzeit Hakochavim) is calculated when the sun is 8.5° below the horizon.
99
- * These defaults can be changed using these options:
100
- * * `options.candleLightingMins` - minutes before sundown to light candles
101
- * * `options.havdalahMins` - minutes after sundown for Havdalah (typical values are 42, 50, or 72).
102
- * Havdalah times are suppressed when `options.havdalahMins=0`.
103
- * * `options.havdalahDeg` - degrees for solar depression for Havdalah.
104
- * Default is 8.5 degrees for 3 small stars. Use 7.083 degrees for 3 medium-sized stars.
105
- * Havdalah times are suppressed when `options.havdalahDeg=0`.
106
- *
107
- * If both `options.candlelighting=true` and `options.location` is specified,
108
- * Chanukah candle-lighting times and minor fast start/end times will also be generated.
109
- * Chanukah candle-lighting is at Bein HaShmashos (13.5 minutes before
110
- * the sun is 7.083° below the horizon in the evening)
111
- * on weekdays, at regular candle-lighting time on Fridays, and at regular Havdalah time on
112
- * Saturday night (see above).
113
- *
114
- * Minor fasts begin at Alot HaShachar (sun is 16.1° below the horizon in the morning) and
115
- * end when 3 medium-sized stars are observable in the night sky (sun is 7.083° below the horizon
116
- * in the evening).
117
- *
118
- * Two options also exist for generating an Event with the Hebrew date:
119
- * * `options.addHebrewDates` - print the Hebrew date for the entire date range
120
- * * `options.addHebrewDatesForEvents` - print the Hebrew date for dates with some events
121
- *
122
- * Lastly, translation and transliteration of event titles is controlled by
123
- * `options.locale` and the {@link Locale} API.
124
- * `@hebcal/core` supports three locales by default:
125
- * * `en` - default, Sephardic transliterations (e.g. "Shabbat")
126
- * * `ashkenazi` - Ashkenazi transliterations (e.g. "Shabbos")
127
- * * `he` - Hebrew (e.g. "שַׁבָּת")
128
- *
129
- * Additional locales (such as `ru` or `fr`) are supported by the
130
- * {@link https://github.com/hebcal/hebcal-locales @hebcal/locales} package
48
+ * This is a convenience wrapper around the standalone {@link calendar} function.
49
+ * See {@link calendar} for the complete list of supported options, the
50
+ * candle-lighting and Havdalah defaults, and notes on locales.
131
51
  *
132
52
  * @example
133
- * import {HebrewCalendar, HDate, Location, Event} from '@hebcal/core';
53
+ * import {HebrewCalendar, Location} from '@hebcal/core';
134
54
  * const options: CalOptions = {
135
55
  * year: 1981,
136
56
  * isHebrewYear: false,
@@ -151,8 +71,12 @@ class HebrewCalendar {
151
71
  }
152
72
  /**
153
73
  * Calculates a birthday or anniversary (non-yahrzeit).
154
- * `hyear` must be after original `gdate` of anniversary.
155
- * Returns `undefined` when requested year preceeds or is same as original year.
74
+ * Returns `undefined` when `hyear` precedes the original year of `gdate`.
75
+ *
76
+ * When `hyear` is the original year, the original date is returned unchanged —
77
+ * a "0th birthday" is a meaningful thing to ask for. This differs from
78
+ * {@link getYahrzeit}, which returns `undefined` for the original year,
79
+ * because a yahrzeit only has meaning from the first anniversary onward.
156
80
  *
157
81
  * Hebcal uses the algorithm defined in "Calendrical Calculations"
158
82
  * by Edward M. Reingold and Nachum Dershowitz.
@@ -176,11 +100,7 @@ class HebrewCalendar {
176
100
  * @returns anniversary occurring in `hyear`
177
101
  */
178
102
  static getBirthdayOrAnniversary(hyear, gdate) {
179
- const dt = getBirthdayHD(hyear, gdate);
180
- if (dt === undefined) {
181
- return dt;
182
- }
183
- return new HDate(dt);
103
+ return birthdayOrAnniversary(hyear, gdate);
184
104
  }
185
105
  /**
186
106
  * Calculates yahrzeit.
@@ -217,11 +137,7 @@ class HebrewCalendar {
217
137
  * @returns anniversary occurring in hyear
218
138
  */
219
139
  static getYahrzeit(hyear, gdate) {
220
- const dt = getYahrzeitHD(hyear, gdate);
221
- if (dt === undefined) {
222
- return dt;
223
- }
224
- return new HDate(dt);
140
+ return yahrzeit(hyear, gdate);
225
141
  }
226
142
  /**
227
143
  * Lower-level holidays interface, which returns a `Map` of `Event`s indexed by
@@ -288,9 +204,12 @@ class HebrewCalendar {
288
204
  * (Shabbat) to also be a sacred day.
289
205
  * @example
290
206
  * import {HebrewCalendar} from '@hebcal/core';
291
- * // Thursday April 25, 2024 — first day of Pesach 5784, with Shabbat
292
- * // chol ha-moed the next day, so Eruv Tavshilin is required:
293
- * HebrewCalendar.eruvTavshilin(new Date(2024, 3, 25), false); // true
207
+ * // Wednesday October 16, 2024 is Erev Sukkot 5785. In the Diaspora,
208
+ * // Sukkot I falls on Thursday and Sukkot II on Friday, so Eruv
209
+ * // Tavshilin is prepared on Wednesday:
210
+ * HebrewCalendar.eruvTavshilin(new Date(2024, 9, 16), false); // true
211
+ * // In Israel there is only one day of Yom Tov, so Friday is a weekday:
212
+ * HebrewCalendar.eruvTavshilin(new Date(2024, 9, 16), true); // false
294
213
  * @param date Gregorian or Hebrew date to test
295
214
  * @param il use the Israeli holiday schedule
296
215
  */
@@ -322,14 +241,14 @@ class HebrewCalendar {
322
241
  * HebrewCalendar.reformatTimeStr('20:30', 'pm', {hour12: false}); // '20:30'
323
242
  * @param timeStr - original time like "20:30"
324
243
  * @param suffix - "p" or "pm" or " P.M.". Add leading space if you want it
325
- * @param options
244
+ * @param options optional; `location`, `locale` and `hour12` are consulted
326
245
  */
327
246
  static reformatTimeStr(timeStr, suffix, options) {
328
247
  return reformatTimeStr(timeStr, suffix, options);
329
248
  }
330
249
  /**
331
250
  * Returns the semantic version string of the `@hebcal/core` package
332
- * (e.g. `"5.10.0"`). Useful for logging or feature detection.
251
+ * (e.g. `"6.8.2"`). Useful for logging or feature detection.
333
252
  */
334
253
  static version() {
335
254
  return version;
@@ -342,10 +261,10 @@ class HebrewCalendar {
342
261
  * since an internal LRU cache (~120 entries) avoids recomputing the
343
262
  * keviyah-specific reading pattern.
344
263
  * @example
345
- * import {HebrewCalendar} from '@hebcal/core';
264
+ * import {HebrewCalendar, HDate} from '@hebcal/core';
346
265
  * const sedra = HebrewCalendar.getSedra(5784, false);
347
266
  * const result = sedra.lookup(new HDate(15, 'Cheshvan', 5784));
348
- * console.log(result.parsha); // ['Lech-Lecha']
267
+ * console.log(result.parsha); // ['Vayera']
349
268
  * @param hyear Hebrew year
350
269
  * @param il Use Israel sedra schedule (`false` for Diaspora)
351
270
  */
@@ -362,12 +281,14 @@ class HebrewCalendar {
362
281
  * Yom Ha'atzmaut, and Yom Yerushalayim.
363
282
  *
364
283
  * Half Hallel is said on Rosh Chodesh (not Rosh Hashanah), and the last 6 days of Pesach.
365
- * @returns 0 for no Hallel, 1 for half Hallel, 2 for whole Hallel
366
284
  * @example
367
285
  * import {HebrewCalendar, HDate, months} from '@hebcal/core';
368
286
  * HebrewCalendar.hallel(new HDate(25, months.KISLEV, 5784), false); // 2 (Chanukah)
369
287
  * HebrewCalendar.hallel(new HDate(1, months.SHVAT, 5784), false); // 1 (Rosh Chodesh)
370
288
  * HebrewCalendar.hallel(new HDate(2, months.SHVAT, 5784), false); // 0
289
+ * @param hdate Hebrew date to test
290
+ * @param il use the Israeli holiday schedule
291
+ * @returns 0 for no Hallel, 1 for half Hallel, 2 for whole Hallel
371
292
  */
372
293
  static hallel(hdate, il) {
373
294
  const events = getHolidaysOnDate(hdate, il);
@@ -394,12 +315,18 @@ class HebrewCalendar {
394
315
  * @example
395
316
  * import {HebrewCalendar, HDate, months} from '@hebcal/core';
396
317
  * // Regular weekday — Tachanun is said at both services
397
- * HebrewCalendar.tachanun(new HDate(2, months.SHVAT, 5784), false);
318
+ * HebrewCalendar.tachanun(new HDate(4, months.SHVAT, 5784), false);
398
319
  * // => { shacharit: true, mincha: true, allCongs: true }
399
320
  *
321
+ * // Friday 2 Sh'vat — said at Shacharit, but not at Mincha (erev Shabbat)
322
+ * HebrewCalendar.tachanun(new HDate(2, months.SHVAT, 5784), false);
323
+ * // => { shacharit: true, mincha: false, allCongs: true }
324
+ *
400
325
  * // Rosh Chodesh — no Tachanun
401
326
  * HebrewCalendar.tachanun(new HDate(1, months.SHVAT, 5784), false);
402
327
  * // => { shacharit: false, mincha: false, allCongs: false }
328
+ * @param hdate Hebrew date to test
329
+ * @param il use the Israeli holiday schedule
403
330
  */
404
331
  static tachanun(hdate, il) {
405
332
  return tachanun(hdate, il);