@hebcal/core 6.15.0 → 6.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/README.md +2 -2
  2. package/dist/bundle.js +298 -228
  3. package/dist/bundle.js.map +1 -1
  4. package/dist/bundle.min.js +5 -5
  5. package/dist/bundle.min.js.map +1 -1
  6. package/dist/esm/DailyLearning.js +1 -1
  7. package/dist/esm/HebrewDateEvent.js +1 -1
  8. package/dist/esm/HolidayEvent.d.ts +1 -1
  9. package/dist/esm/HolidayEvent.js +3 -3
  10. package/dist/esm/HolidayEvent.js.map +1 -1
  11. package/dist/esm/KiddushLevanaEvent.js +1 -1
  12. package/dist/esm/MevarchimChodeshEvent.js +1 -1
  13. package/dist/esm/ParshaEvent.js +2 -2
  14. package/dist/esm/ParshaEvent.js.map +1 -1
  15. package/dist/esm/TimedEvent.js +1 -1
  16. package/dist/esm/YomKippurKatanEvent.js +1 -1
  17. package/dist/esm/ashkenazi.po.js +1 -1
  18. package/dist/esm/calendar.js +1 -1
  19. package/dist/esm/candles.js +8 -2
  20. package/dist/esm/candles.js.map +1 -1
  21. package/dist/esm/cities.json.js +1 -1
  22. package/dist/esm/event.js +1 -1
  23. package/dist/esm/getStartAndEnd.js +1 -1
  24. package/dist/esm/hallel.d.ts +26 -3
  25. package/dist/esm/hallel.js +86 -29
  26. package/dist/esm/hallel.js.map +1 -1
  27. package/dist/esm/he-x-NoNikud.po.js +1 -1
  28. package/dist/esm/he.po.js +1 -1
  29. package/dist/esm/hebcal.d.ts +3 -9
  30. package/dist/esm/hebcal.js +6 -16
  31. package/dist/esm/hebcal.js.map +1 -1
  32. package/dist/esm/holidays.js +1 -1
  33. package/dist/esm/horizon.js +1 -1
  34. package/dist/esm/index.d.ts +1 -0
  35. package/dist/esm/index.js +2 -1
  36. package/dist/esm/index.js.map +1 -1
  37. package/dist/esm/isAssurBemlacha.js +1 -1
  38. package/dist/esm/isAveilut.js +1 -1
  39. package/dist/esm/isFastDay.js +1 -1
  40. package/dist/esm/locale.js +1 -1
  41. package/dist/esm/location.js +1 -1
  42. package/dist/esm/modern.js +1 -1
  43. package/dist/esm/molad.js +1 -1
  44. package/dist/esm/moladBase.js +1 -1
  45. package/dist/esm/moladDate.js +1 -1
  46. package/dist/esm/omer.d.ts +4 -0
  47. package/dist/esm/omer.js +7 -12
  48. package/dist/esm/omer.js.map +1 -1
  49. package/dist/esm/parshaName.js +1 -1
  50. package/dist/esm/parshaYear.js +1 -1
  51. package/dist/esm/pkgVersion.d.ts +1 -1
  52. package/dist/esm/pkgVersion.js +2 -2
  53. package/dist/esm/pkgVersion.js.map +1 -1
  54. package/dist/esm/reformatTimeStr.js +1 -1
  55. package/dist/esm/sedra.js +1 -1
  56. package/dist/esm/sefira.json.js +1 -1
  57. package/dist/esm/staticHolidays.js +1 -1
  58. package/dist/esm/string.js +1 -1
  59. package/dist/esm/tachanun.js +1 -1
  60. package/dist/esm/zenith.js +1 -1
  61. package/dist/esm/zmanim.js +1 -1
  62. package/package.json +7 -7
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.15.0, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.16.1, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  const cals = new Map();
3
3
  /**
4
4
  * Plug-in registry for daily learning calendars such as Daf Yomi (Bavli),
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.15.0, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.16.1, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import { Locale, gematriya, months } from '@hebcal/hdate';
3
3
  import { Event, flags } from './event.js';
4
4
  import './locale.js';
@@ -44,7 +44,7 @@ export declare class HolidayEvent extends Event {
44
44
  /**
45
45
  * Returns a `https://www.hebcal.com/holidays/...` URL for more detail on
46
46
  * this holiday. Israel-only holidays get an `?i=on` query parameter.
47
- * Returns `undefined` for years outside `[100, 2999]` and for
47
+ * Returns `undefined` for Gregorian years outside `[1752, 2499]` and for
48
48
  * Ta'anit BeHaB, which has no holiday page.
49
49
  */
50
50
  url(): string | undefined;
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.15.0, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.16.1, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import { isoDateString, Locale } from '@hebcal/hdate';
3
3
  import { Event, flags } from './event.js';
4
4
  import { holidayDesc } from './staticHolidays.js';
@@ -63,7 +63,7 @@ class HolidayEvent extends Event {
63
63
  /**
64
64
  * Returns a `https://www.hebcal.com/holidays/...` URL for more detail on
65
65
  * this holiday. Israel-only holidays get an `?i=on` query parameter.
66
- * Returns `undefined` for years outside `[100, 2999]` and for
66
+ * Returns `undefined` for Gregorian years outside `[1752, 2499]` and for
67
67
  * Ta'anit BeHaB, which has no holiday page.
68
68
  */
69
69
  url() {
@@ -71,7 +71,7 @@ class HolidayEvent extends Event {
71
71
  return undefined;
72
72
  }
73
73
  const year = this.greg().getFullYear();
74
- if (year < 100 || year > 2999) {
74
+ if (year < 1752 || year > 2499) {
75
75
  return undefined;
76
76
  }
77
77
  const url = `https://www.hebcal.com/holidays/${urlFriendly(this.basename())}-${this.urlDateSuffix()}`;
@@ -1 +1 @@
1
- {"version":3,"file":"HolidayEvent.js","sources":["../../../src/HolidayEvent.ts"],"sourcesContent":["import {HDate, Locale, isoDateString} from '@hebcal/hdate';\nimport {Event, flags} from './event.js';\nimport {holidayDesc as hdesc} from './staticHolidays.js';\nimport {smartApostrophe, urlFriendly} from './string.js';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\n\n/**\n * Represents a built-in holiday like Pesach, Purim or Tu BiShvat.\n *\n * Most holiday-related events emitted by {@link calendar}\n * are instances of `HolidayEvent` or one of its subclasses\n * ({@link ChanukahEvent}, {@link AsaraBTevetEvent},\n * {@link RoshHashanaEvent}, {@link RoshChodeshEvent}).\n *\n * Adds two notable behaviors over the base {@link Event}:\n *\n * - {@link HolidayEvent.basename} strips qualifiers like `Erev `, ` I`/`II`,\n * `(CH''M)`, `(observed)`, candle counts, etc. (e.g. `\"Erev Pesach\"` →\n * `\"Pesach\"`).\n * - {@link HolidayEvent.url} returns a `https://www.hebcal.com/holidays/...`\n * link for the holiday.\n */\nexport class HolidayEvent extends Event {\n /** During Sukkot or Pesach */\n readonly cholHaMoedDay?: number;\n /**\n * `true` if the fast day was postponed a day to avoid Shabbat.\n * - Tish'a B'Av postponed from the 9th to the 10th\n * - Tzom Tammuz postponed from the 17th to the 18th\n */\n readonly observed?: boolean;\n constructor(date: HDate, desc: string, mask = 0, attrs?: object) {\n super(date, desc, mask, attrs);\n if (typeof attrs === 'object' && attrs !== null) {\n Object.assign(this, attrs);\n }\n }\n\n /**\n * Returns a simplified (untranslated) name for this holiday, stripping\n * qualifiers so that related events group under one name.\n *\n * Strips trailing 4-digit years, `(CH''M)`, `(observed)`, `(Hoshana Raba)`,\n * Roman-numeral day numbers (` I`, ` II`, ...), Chanukah candle counts,\n * `: 8th Day`, and a leading `\"Erev \"`.\n * @example\n * // 'Erev Pesach' => 'Pesach'\n * // 'Sukkot III (CH''M)' => 'Sukkot'\n * // 'Chanukah: 5 Candles' => 'Chanukah'\n * // 'Rosh Hashana 5784' => 'Rosh Hashana'\n */\n override basename(): string {\n return this.getDesc()\n .replace(/ \\d{4}$/, '')\n .replace(/ \\(CH''M\\)$/, '')\n .replace(/ \\(observed\\)$/, '')\n .replace(/ \\(Hoshana Raba\\)$/, '')\n .replace(/ [IV]+$/, '')\n .replace(/: \\d Candles?$/, '')\n .replace(/: 8th Day$/, '')\n .replace(/^Erev /, '');\n }\n\n /**\n * Returns a `https://www.hebcal.com/holidays/...` URL for more detail on\n * this holiday. Israel-only holidays get an `?i=on` query parameter.\n * Returns `undefined` for years outside `[100, 2999]` and for\n * Ta'anit BeHaB, which has no holiday page.\n */\n override url(): string | undefined {\n if (this.hasFlag('BEHAB')) {\n return undefined;\n }\n const year = this.greg().getFullYear();\n if (year < 100 || year > 2999) {\n return undefined;\n }\n const url = `https://www.hebcal.com/holidays/${urlFriendly(this.basename())}-${this.urlDateSuffix()}`;\n return this.hasFlag('IL_ONLY') ? `${url}?i=on` : url;\n }\n\n /**\n * The date portion of {@link url}. For most holidays this is just the\n * Gregorian year; subclasses override it when a year alone is ambiguous.\n */\n urlDateSuffix(): string {\n return String(this.greg().getFullYear());\n }\n\n override getEmoji(): string {\n if (this.emoji) {\n return this.emoji;\n }\n if (this.hasFlag('SPECIAL_SHABBAT')) {\n return '🕍';\n }\n return '✡️';\n }\n\n override getCategories(): string[] {\n if (this.cholHaMoedDay) {\n return ['holiday', 'major', 'cholhamoed'];\n }\n const cats = super.getCategories();\n if (cats[0] !== 'unknown') {\n return cats;\n }\n // Don't depend on flags.MINOR_HOLIDAY always being set. Look for minor holidays.\n const desc = this.getDesc();\n switch (desc) {\n case hdesc.LAG_BAOMER:\n case hdesc.LEIL_SELICHOT:\n case hdesc.PESACH_SHENI:\n case hdesc.EREV_PURIM:\n case hdesc.PURIM_KATAN:\n case hdesc.SHUSHAN_PURIM:\n case hdesc.TU_BAV:\n case hdesc.TU_BISHVAT:\n case hdesc.ROSH_HASHANA_LABEHEMOT:\n return ['holiday', 'minor'];\n }\n\n return ['holiday', 'major'];\n }\n /**\n * Returns (translated) description of this event\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n override render(locale?: string): string {\n const str = super.render(locale);\n return smartApostrophe(str);\n }\n /**\n * Returns a brief (translated) description of this event.\n * For most events, this is the same as render(). For some events, it procudes\n * a shorter text (e.g. without a time or added description).\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n override renderBrief(locale?: string): string {\n const str = super.renderBrief(locale);\n return smartApostrophe(str);\n }\n}\n\n/**\n * Because Asara B'Tevet often occurs twice in the same Gregorian year,\n * we subclass HolidayEvent to generate the correct URL.\n */\nexport class AsaraBTevetEvent extends HolidayEvent {\n /** Full `YYYYMMDD` date, since the Gregorian year alone is ambiguous here */\n override urlDateSuffix(): string {\n const isoDate = isoDateString(this.greg());\n return isoDate.replaceAll('-', '');\n }\n}\n\nconst chanukahEmoji = '🕎';\nconst KEYCAP_DIGITS = [\n '0️⃣',\n '1️⃣',\n '2️⃣',\n '3️⃣',\n '4️⃣',\n '5️⃣',\n '6️⃣',\n '7️⃣',\n '8️⃣',\n '9️⃣',\n] as const;\n\n/**\n * Because Chanukah sometimes starts in December and ends in January,\n * we subclass HolidayEvent to generate the correct URL.\n */\nexport class ChanukahEvent extends HolidayEvent {\n readonly chanukahDay?: number;\n /**\n * @param chanukahDay should be undefined for 1st night of Chanukah\n */\n constructor(date: HDate, desc: string, mask: number, chanukahDay?: number) {\n super(date, desc, mask);\n this.chanukahDay = chanukahDay;\n this.emoji = chanukahEmoji;\n if (chanukahDay !== 8) {\n const candles = chanukahDay ? chanukahDay + 1 : 1;\n this.emoji += KEYCAP_DIGITS[candles];\n }\n }\n override urlDateSuffix(): string {\n const dt = this.greg();\n let year = dt.getFullYear();\n if (dt.getMonth() === 0) {\n year--;\n }\n return String(year);\n }\n}\n\n/** Represents Rosh Hashana, the Jewish New Year */\nexport class RoshHashanaEvent extends HolidayEvent {\n private readonly hyear: number;\n /**\n * Normally created by {@link calendar} rather than directly.\n * @param date Hebrew date event occurs\n * @param hyear Hebrew year\n * @param mask optional holiday flags\n */\n constructor(date: HDate, hyear: number, mask: number) {\n super(date, `Rosh Hashana ${hyear}`, mask);\n this.hyear = hyear;\n }\n /**\n * Returns (translated) description of this event\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n override render(locale?: string): string {\n return `${Locale.gettext('Rosh Hashana', locale)} ${this.hyear}`;\n }\n\n override getEmoji(): string {\n return '🍏🍯';\n }\n}\n\nconst roshChodeshStr = 'Rosh Chodesh';\n\n/** Represents Rosh Chodesh, the beginning of a new month */\nexport class RoshChodeshEvent extends HolidayEvent {\n /**\n * Constructs Rosh Chodesh event\n * @param date Hebrew date event occurs\n * @param monthName Hebrew month name (not translated)\n */\n constructor(date: HDate, monthName: string) {\n super(date, `${roshChodeshStr} ${monthName}`, flags.ROSH_CHODESH);\n }\n /**\n * Returns (translated) description of this event\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n override render(locale?: string): string {\n const monthName = this.getDesc().substring(roshChodeshStr.length + 1);\n const monthName0 = Locale.gettext(monthName, locale);\n const monthName1 = smartApostrophe(monthName0);\n return `${Locale.gettext(roshChodeshStr, locale)} ${monthName1}`;\n }\n\n override basename(): string {\n return this.getDesc();\n }\n\n override getEmoji(): string {\n return this.emoji || '🌒';\n }\n}\n"],"names":["hdesc"],"mappings":";;;;;;;AAMA;;;;;;;;;;;;;;;AAeG;AACG,MAAO,YAAa,SAAQ,KAAK,CAAA;;AAE5B,IAAA,aAAa;AACtB;;;;AAIG;AACM,IAAA,QAAQ;IACjB,WAAA,CAAY,IAAW,EAAE,IAAY,EAAE,IAAI,GAAG,CAAC,EAAE,KAAc,EAAA;QAC7D,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC;QAC9B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE;AAC/C,YAAA,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC;QAC5B;IACF;AAEA;;;;;;;;;;;;AAYG;IACM,QAAQ,GAAA;QACf,OAAO,IAAI,CAAC,OAAO;AAChB,aAAA,OAAO,CAAC,SAAS,EAAE,EAAE;AACrB,aAAA,OAAO,CAAC,aAAa,EAAE,EAAE;AACzB,aAAA,OAAO,CAAC,gBAAgB,EAAE,EAAE;AAC5B,aAAA,OAAO,CAAC,oBAAoB,EAAE,EAAE;AAChC,aAAA,OAAO,CAAC,SAAS,EAAE,EAAE;AACrB,aAAA,OAAO,CAAC,gBAAgB,EAAE,EAAE;AA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AY,CAAA;AAChD;;;;AAIG;IACH,WAAA,CAAY,IAAW,EAAE,SAAiB,EAAA;AACxC,QAAA,KAAK,CAAC,IAAI,EAAE,CAAA,EAAG,cAAc,CAAA,CAAA,EAAI,SAAS,CAAA,CAAE,EAAE,KAAK,CAAC,YAAY,CAAC;IACnE;AACA;;;AAGG;AACM,IAAA,MAAM,CAAC,MAAe,EAAA;AAC7B,QAAA,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC;QACrE,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC;AACpD,QAAA,MAAM,UAAU,GAAG,eAAe,CAAC,UAAU,CAAC;AAC9C,QAAA,OAAO,CAAA,EAAG,MAAM,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA,CAAA,EAAI,UAAU,CAAA,CAAE;IAClE;IAES,QAAQ,GAAA;AACf,QAAA,OAAO,IAAI,CAAC,OAAO,EAAE;IACvB;IAES,QAAQ,GAAA;AACf,QAAA,OAAO,IAAI,CAAC,KAAK,IAAI,IAAI;IAC3B;AACD;;"}
1
+ {"version":3,"file":"HolidayEvent.js","sources":["../../../src/HolidayEvent.ts"],"sourcesContent":["import {HDate, Locale, isoDateString} from '@hebcal/hdate';\nimport {Event, flags} from './event.js';\nimport {holidayDesc as hdesc} from './staticHolidays.js';\nimport {smartApostrophe, urlFriendly} from './string.js';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\n\n/**\n * Represents a built-in holiday like Pesach, Purim or Tu BiShvat.\n *\n * Most holiday-related events emitted by {@link calendar}\n * are instances of `HolidayEvent` or one of its subclasses\n * ({@link ChanukahEvent}, {@link AsaraBTevetEvent},\n * {@link RoshHashanaEvent}, {@link RoshChodeshEvent}).\n *\n * Adds two notable behaviors over the base {@link Event}:\n *\n * - {@link HolidayEvent.basename} strips qualifiers like `Erev `, ` I`/`II`,\n * `(CH''M)`, `(observed)`, candle counts, etc. (e.g. `\"Erev Pesach\"` →\n * `\"Pesach\"`).\n * - {@link HolidayEvent.url} returns a `https://www.hebcal.com/holidays/...`\n * link for the holiday.\n */\nexport class HolidayEvent extends Event {\n /** During Sukkot or Pesach */\n readonly cholHaMoedDay?: number;\n /**\n * `true` if the fast day was postponed a day to avoid Shabbat.\n * - Tish'a B'Av postponed from the 9th to the 10th\n * - Tzom Tammuz postponed from the 17th to the 18th\n */\n readonly observed?: boolean;\n constructor(date: HDate, desc: string, mask = 0, attrs?: object) {\n super(date, desc, mask, attrs);\n if (typeof attrs === 'object' && attrs !== null) {\n Object.assign(this, attrs);\n }\n }\n\n /**\n * Returns a simplified (untranslated) name for this holiday, stripping\n * qualifiers so that related events group under one name.\n *\n * Strips trailing 4-digit years, `(CH''M)`, `(observed)`, `(Hoshana Raba)`,\n * Roman-numeral day numbers (` I`, ` II`, ...), Chanukah candle counts,\n * `: 8th Day`, and a leading `\"Erev \"`.\n * @example\n * // 'Erev Pesach' => 'Pesach'\n * // 'Sukkot III (CH''M)' => 'Sukkot'\n * // 'Chanukah: 5 Candles' => 'Chanukah'\n * // 'Rosh Hashana 5784' => 'Rosh Hashana'\n */\n override basename(): string {\n return this.getDesc()\n .replace(/ \\d{4}$/, '')\n .replace(/ \\(CH''M\\)$/, '')\n .replace(/ \\(observed\\)$/, '')\n .replace(/ \\(Hoshana Raba\\)$/, '')\n .replace(/ [IV]+$/, '')\n .replace(/: \\d Candles?$/, '')\n .replace(/: 8th Day$/, '')\n .replace(/^Erev /, '');\n }\n\n /**\n * Returns a `https://www.hebcal.com/holidays/...` URL for more detail on\n * this holiday. Israel-only holidays get an `?i=on` query parameter.\n * Returns `undefined` for Gregorian years outside `[1752, 2499]` and for\n * Ta'anit BeHaB, which has no holiday page.\n */\n override url(): string | undefined {\n if (this.hasFlag('BEHAB')) {\n return undefined;\n }\n const year = this.greg().getFullYear();\n if (year < 1752 || year > 2499) {\n return undefined;\n }\n const url = `https://www.hebcal.com/holidays/${urlFriendly(this.basename())}-${this.urlDateSuffix()}`;\n return this.hasFlag('IL_ONLY') ? `${url}?i=on` : url;\n }\n\n /**\n * The date portion of {@link url}. For most holidays this is just the\n * Gregorian year; subclasses override it when a year alone is ambiguous.\n */\n urlDateSuffix(): string {\n return String(this.greg().getFullYear());\n }\n\n override getEmoji(): string {\n if (this.emoji) {\n return this.emoji;\n }\n if (this.hasFlag('SPECIAL_SHABBAT')) {\n return '🕍';\n }\n return '✡️';\n }\n\n override getCategories(): string[] {\n if (this.cholHaMoedDay) {\n return ['holiday', 'major', 'cholhamoed'];\n }\n const cats = super.getCategories();\n if (cats[0] !== 'unknown') {\n return cats;\n }\n // Don't depend on flags.MINOR_HOLIDAY always being set. Look for minor holidays.\n const desc = this.getDesc();\n switch (desc) {\n case hdesc.LAG_BAOMER:\n case hdesc.LEIL_SELICHOT:\n case hdesc.PESACH_SHENI:\n case hdesc.EREV_PURIM:\n case hdesc.PURIM_KATAN:\n case hdesc.SHUSHAN_PURIM:\n case hdesc.TU_BAV:\n case hdesc.TU_BISHVAT:\n case hdesc.ROSH_HASHANA_LABEHEMOT:\n return ['holiday', 'minor'];\n }\n\n return ['holiday', 'major'];\n }\n /**\n * Returns (translated) description of this event\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n override render(locale?: string): string {\n const str = super.render(locale);\n return smartApostrophe(str);\n }\n /**\n * Returns a brief (translated) description of this event.\n * For most events, this is the same as render(). For some events, it procudes\n * a shorter text (e.g. without a time or added description).\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n override renderBrief(locale?: string): string {\n const str = super.renderBrief(locale);\n return smartApostrophe(str);\n }\n}\n\n/**\n * Because Asara B'Tevet often occurs twice in the same Gregorian year,\n * we subclass HolidayEvent to generate the correct URL.\n */\nexport class AsaraBTevetEvent extends HolidayEvent {\n /** Full `YYYYMMDD` date, since the Gregorian year alone is ambiguous here */\n override urlDateSuffix(): string {\n const isoDate = isoDateString(this.greg());\n return isoDate.replaceAll('-', '');\n }\n}\n\nconst chanukahEmoji = '🕎';\nconst KEYCAP_DIGITS = [\n '0️⃣',\n '1️⃣',\n '2️⃣',\n '3️⃣',\n '4️⃣',\n '5️⃣',\n '6️⃣',\n '7️⃣',\n '8️⃣',\n '9️⃣',\n] as const;\n\n/**\n * Because Chanukah sometimes starts in December and ends in January,\n * we subclass HolidayEvent to generate the correct URL.\n */\nexport class ChanukahEvent extends HolidayEvent {\n readonly chanukahDay?: number;\n /**\n * @param chanukahDay should be undefined for 1st night of Chanukah\n */\n constructor(date: HDate, desc: string, mask: number, chanukahDay?: number) {\n super(date, desc, mask);\n this.chanukahDay = chanukahDay;\n this.emoji = chanukahEmoji;\n if (chanukahDay !== 8) {\n const candles = chanukahDay ? chanukahDay + 1 : 1;\n this.emoji += KEYCAP_DIGITS[candles];\n }\n }\n override urlDateSuffix(): string {\n const dt = this.greg();\n let year = dt.getFullYear();\n if (dt.getMonth() === 0) {\n year--;\n }\n return String(year);\n }\n}\n\n/** Represents Rosh Hashana, the Jewish New Year */\nexport class RoshHashanaEvent extends HolidayEvent {\n private readonly hyear: number;\n /**\n * Normally created by {@link calendar} rather than directly.\n * @param date Hebrew date event occurs\n * @param hyear Hebrew year\n * @param mask optional holiday flags\n */\n constructor(date: HDate, hyear: number, mask: number) {\n super(date, `Rosh Hashana ${hyear}`, mask);\n this.hyear = hyear;\n }\n /**\n * Returns (translated) description of this event\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n override render(locale?: string): string {\n return `${Locale.gettext('Rosh Hashana', locale)} ${this.hyear}`;\n }\n\n override getEmoji(): string {\n return '🍏🍯';\n }\n}\n\nconst roshChodeshStr = 'Rosh Chodesh';\n\n/** Represents Rosh Chodesh, the beginning of a new month */\nexport class RoshChodeshEvent extends HolidayEvent {\n /**\n * Constructs Rosh Chodesh event\n * @param date Hebrew date event occurs\n * @param monthName Hebrew month name (not translated)\n */\n constructor(date: HDate, monthName: string) {\n super(date, `${roshChodeshStr} ${monthName}`, flags.ROSH_CHODESH);\n }\n /**\n * Returns (translated) description of this event\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n override render(locale?: string): string {\n const monthName = this.getDesc().substring(roshChodeshStr.length + 1);\n const monthName0 = Locale.gettext(monthName, locale);\n const monthName1 = smartApostrophe(monthName0);\n return `${Locale.gettext(roshChodeshStr, locale)} ${monthName1}`;\n }\n\n override basename(): string {\n return this.getDesc();\n }\n\n override getEmoji(): string {\n return this.emoji || '🌒';\n }\n}\n"],"names":["hdesc"],"mappings":";;;;;;;AAMA;;;;;;;;;;;;;;;AAeG;AACG,MAAO,YAAa,SAAQ,KAAK,CAAA;;AAE5B,IAAA,aAAa;AACtB;;;;AAIG;AACM,IAAA,QAAQ;IACjB,WAAA,CAAY,IAAW,EAAE,IAAY,EAAE,IAAI,GAAG,CAAC,EAAE,KAAc,EAAA;QAC7D,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC;QAC9B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE;AAC/C,YAAA,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC;QAC5B;IACF;AAEA;;;;;;;;;;;;AAYG;IACM,QAAQ,GAAA;QACf,OAAO,IAAI,CAAC,OAAO;AAChB,aAAA,OAAO,CAAC,SAAS,EAAE,EAAE;AACrB,aAAA,OAAO,CAAC,aAAa,EAAE,EAAE;AACzB,aAAA,OAAO,CAAC,gBAAgB,EAAE,EAAE;AAC5B,aAAA,OAAO,CAAC,oBAAoB,EAAE,EAAE;AAChC,aAAA,OAAO,CAAC,SAAS,EAAE,EAAE;AACrB,aAAA,OAAO,CAAC,gBAAgB,EAAE,EAAE;AAC5B,aAAA,OAAO,CAAC,YAAY,EAAE,EAAE;AACxB,aAAA,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;IAC1B;AAEA;;;;;AAKG;IACM,GAAG,GAAA;AACV,QAAA,IAAI,IA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,CAAE,EAAE,KAAK,CAAC,YAAY,CAAC;IACnE;AACA;;;AAGG;AACM,IAAA,MAAM,CAAC,MAAe,EAAA;AAC7B,QAAA,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC;QACrE,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC;AACpD,QAAA,MAAM,UAAU,GAAG,eAAe,CAAC,UAAU,CAAC;AAC9C,QAAA,OAAO,CAAA,EAAG,MAAM,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA,CAAA,EAAI,UAAU,CAAA,CAAE;IAClE;IAES,QAAQ,GAAA;AACf,QAAA,OAAO,IAAI,CAAC,OAAO,EAAE;IACvB;IAES,QAAQ,GAAA;AACf,QAAA,OAAO,IAAI,CAAC,KAAK,IAAI,IAAI;IAC3B;AACD;;"}
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.15.0, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.16.1, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import 'temporal-polyfill/global';
3
3
  import { HDate } from '@hebcal/hdate';
4
4
  import { flags } from './event.js';
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.15.0, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.16.1, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import { Locale, HDate, months } from '@hebcal/hdate';
3
3
  import { Event, flags } from './event.js';
4
4
  import { Molad } from './molad.js';
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.15.0, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.16.1, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import { Event, flags } from './event.js';
3
3
  import { HDate, isoDateString } from '@hebcal/hdate';
4
4
  import { renderParshaName } from './parshaName.js';
@@ -53,7 +53,7 @@ class ParshaEvent extends Event {
53
53
  }
54
54
  url() {
55
55
  const year = this.greg().getFullYear();
56
- if (year < 100 || year > 2999) {
56
+ if (year < 1752 || year > 2499) {
57
57
  return undefined;
58
58
  }
59
59
  const dt = this.urlDateSuffix();
@@ -1 +1 @@
1
- {"version":3,"file":"ParshaEvent.js","sources":["../../../src/ParshaEvent.ts"],"sourcesContent":["import {Event, flags} from './event.js';\nimport {HDate, isoDateString} from '@hebcal/hdate';\nimport {renderParshaName} from './parshaName.js';\nimport {urlFriendly} from './string.js';\nimport {SedraResult} from './sedra.js';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\n\n/**\n * Represents one of 54 weekly Torah portions, always on a Saturday.\n *\n * `ParshaEvent` is for regular Parashat HaShavua readings. For Shabbatot\n * with holiday readings such as Shabbat Chol ha-Moed, use\n * `getHolidaysOnDate()` from `@hebcal/core`, or `getLeyningOnDate()` from\n * `@hebcal/leyning` when the display title and exact Torah readings are needed.\n */\nexport class ParshaEvent extends Event {\n /** The parsha name(s) and date this event was constructed from */\n readonly p: SedraResult;\n /**\n * Normally created by {@link calendar} (via `options.sedrot`)\n * rather than directly.\n * @param parsha result from {@link Sedra.lookup}\n * @throws {TypeError} if called with anything other than exactly one argument\n * @throws {TypeError} if `parsha` is not a valid {@link SedraResult} — it must\n * have an `HDate` and one or two parsha names\n */\n constructor(parsha: SedraResult) {\n // eslint-disable-next-line prefer-rest-params\n if (arguments.length !== 1) {\n throw new TypeError(\n `ParshaEvent constructor takes a single SedraResult argument; ` +\n `got ${arguments.length} arguments`\n );\n }\n if (\n typeof parsha !== 'object' ||\n parsha === null ||\n !Array.isArray(parsha.parsha) ||\n parsha.parsha.length === 0 ||\n parsha.parsha.length > 2 ||\n !HDate.isHDate(parsha.hdate)\n ) {\n throw new TypeError(\n `Invalid SedraResult argument: ${JSON.stringify(parsha)}`\n );\n }\n const desc = `Parashat ${parsha.parsha.join('-')}`;\n super(parsha.hdate, desc, flags.PARSHA_HASHAVUA);\n this.p = parsha;\n }\n /**\n * @param [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to empty locale.\n */\n override render(locale?: string): string {\n return renderParshaName(this.p.parsha, locale);\n }\n\n override basename(): string {\n return this.p.parsha.join('-');\n }\n\n override url(): string | undefined {\n const year = this.greg().getFullYear();\n if (year < 100 || year > 2999) {\n return undefined;\n }\n const dt = this.urlDateSuffix();\n const url = `https://www.hebcal.com/sedrot/${urlFriendly(this.basename())}-${dt}`;\n return this.p.il ? `${url}?i=on` : url;\n }\n\n /**\n * The date portion of {@link url}, as `YYYYMMDD` — a parsha name recurs every\n * year, so the full date is needed to identify the reading.\n */\n urlDateSuffix(): string {\n const isoDate = isoDateString(this.greg());\n return isoDate.replaceAll('-', '');\n }\n\n /** convenience function for compatibility with previous implementation */\n get parsha(): string[] {\n return this.p.parsha;\n }\n}\n"],"names":[],"mappings":";;;;;;;AAOA;;;;;;;AAOG;AACG,MAAO,WAAY,SAAQ,KAAK,CAAA;;AAE3B,IAAA,CAAC;AACV;;;;;;;AAOG;AACH,IAAA,WAAA,CAAY,MAAmB,EAAA;;AAE7B,QAAA,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;YAC1B,MAAM,IAAI,SAAS,CACjB,CAAA,6DAAA,CAA+D;AAC7D,gBAAA,CAAA,IAAA,EAAO,SAAS,CAAC,MAAM,CAAA,UAAA,CAAY,CACtC;QACH;QACA,IACE,OAAO,MAAM,KAAK,QAAQ;AAC1B,YAAA,MAAM,KAAK,IAAI;AACf,YAAA,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;AAC7B,YAAA,MAAM,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC;AAC1B,YAAA,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;YACxB,CAAC,KAAK,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,CAAC;IACpC;;AAGA,IAAA,IAAI,MAAM,GAAA;AACR,QAAA,OAAO,IAAI,CAAC,CAAC,CAAC,MAAM;IACtB;AACD;;"}
1
+ {"version":3,"file":"ParshaEvent.js","sources":["../../../src/ParshaEvent.ts"],"sourcesContent":["import {Event, flags} from './event.js';\nimport {HDate, isoDateString} from '@hebcal/hdate';\nimport {renderParshaName} from './parshaName.js';\nimport {urlFriendly} from './string.js';\nimport {SedraResult} from './sedra.js';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\n\n/**\n * Represents one of 54 weekly Torah portions, always on a Saturday.\n *\n * `ParshaEvent` is for regular Parashat HaShavua readings. For Shabbatot\n * with holiday readings such as Shabbat Chol ha-Moed, use\n * `getHolidaysOnDate()` from `@hebcal/core`, or `getLeyningOnDate()` from\n * `@hebcal/leyning` when the display title and exact Torah readings are needed.\n */\nexport class ParshaEvent extends Event {\n /** The parsha name(s) and date this event was constructed from */\n readonly p: SedraResult;\n /**\n * Normally created by {@link calendar} (via `options.sedrot`)\n * rather than directly.\n * @param parsha result from {@link Sedra.lookup}\n * @throws {TypeError} if called with anything other than exactly one argument\n * @throws {TypeError} if `parsha` is not a valid {@link SedraResult} — it must\n * have an `HDate` and one or two parsha names\n */\n constructor(parsha: SedraResult) {\n // eslint-disable-next-line prefer-rest-params\n if (arguments.length !== 1) {\n throw new TypeError(\n `ParshaEvent constructor takes a single SedraResult argument; ` +\n `got ${arguments.length} arguments`\n );\n }\n if (\n typeof parsha !== 'object' ||\n parsha === null ||\n !Array.isArray(parsha.parsha) ||\n parsha.parsha.length === 0 ||\n parsha.parsha.length > 2 ||\n !HDate.isHDate(parsha.hdate)\n ) {\n throw new TypeError(\n `Invalid SedraResult argument: ${JSON.stringify(parsha)}`\n );\n }\n const desc = `Parashat ${parsha.parsha.join('-')}`;\n super(parsha.hdate, desc, flags.PARSHA_HASHAVUA);\n this.p = parsha;\n }\n /**\n * @param [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to empty locale.\n */\n override render(locale?: string): string {\n return renderParshaName(this.p.parsha, locale);\n }\n\n override basename(): string {\n return this.p.parsha.join('-');\n }\n\n override url(): string | undefined {\n const year = this.greg().getFullYear();\n if (year < 1752 || year > 2499) {\n return undefined;\n }\n const dt = this.urlDateSuffix();\n const url = `https://www.hebcal.com/sedrot/${urlFriendly(this.basename())}-${dt}`;\n return this.p.il ? `${url}?i=on` : url;\n }\n\n /**\n * The date portion of {@link url}, as `YYYYMMDD` — a parsha name recurs every\n * year, so the full date is needed to identify the reading.\n */\n urlDateSuffix(): string {\n const isoDate = isoDateString(this.greg());\n return isoDate.replaceAll('-', '');\n }\n\n /** convenience function for compatibility with previous implementation */\n get parsha(): string[] {\n return this.p.parsha;\n }\n}\n"],"names":[],"mappings":";;;;;;;AAOA;;;;;;;AAOG;AACG,MAAO,WAAY,SAAQ,KAAK,CAAA;;AAE3B,IAAA,CAAC;AACV;;;;;;;AAOG;AACH,IAAA,WAAA,CAAY,MAAmB,EAAA;;AAE7B,QAAA,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;YAC1B,MAAM,IAAI,SAAS,CACjB,CAAA,6DAAA,CAA+D;AAC7D,gBAAA,CAAA,IAAA,EAAO,SAAS,CAAC,MAAM,CAAA,UAAA,CAAY,CACtC;QACH;QACA,IACE,OAAO,MAAM,KAAK,QAAQ;AAC1B,YAAA,MAAM,KAAK,IAAI;AACf,YAAA,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;AAC7B,YAAA,MAAM,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC;AAC1B,YAAA,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;YACxB,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,EAC5B;AACA,YAAA,MAAM,IAAI,SAAS,CACjB,CAAA,8BAAA,EAAiC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA,CAAE,CAC1D;QACH;AACA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.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.16.1, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import { Locale } from '@hebcal/hdate';
3
3
  import { Event } from './event.js';
4
4
  import { reformatTimeStr } from './reformatTimeStr.js';
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.15.0, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.16.1, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import { Locale } from '@hebcal/hdate';
3
3
  import { flags } from './event.js';
4
4
  import { HolidayEvent } from './HolidayEvent.js';
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.15.0, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.16.1, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  var poAshkenazi = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);", "language": "und-x-ashkenaz" }, "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"], "Pesach Shabbat Chol ha-Moed": ["Pesach Shabbos Chol ha-Moed"], "Purim Katan": ["Purim Koton"], "Rosh Hashana LaBehemot": ["Rosh Hashana LaBeheimos"], "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)"], "Sukkot Shabbat Chol ha-Moed": ["Sukkos Shabbos Chol ha-Moed"], "Ta'anit Bechorot": ["Ta’anis Bechoros"], "Ta'anit BeHaB": ["Ta’anis BeHaB"], "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"], "Birkat Hachamah": ["Birkas HaChamah"], "Birkat HaChamah": ["Birkas HaChamah"], "Shushan Purim Katan": ["Shushan Purim Koton"], "Alot HaShachar": ["Alos HaShachar"], "Misheyakir": ["Misheyakir"], "Misheyakir Machmir": ["Misheyakir Machmir"], "Sunrise": ["Sunrise"], "Kriat Shema, sof zeman": ["Krias Shema, sof zman"], "Tefilah, sof zeman": ["Tefilah, sof zman"], "Kriat Shema, sof zeman (MGA)": ["Krias Shema, sof zman (MGA)"], "Kriat Shema, sof zeman (GRA)": ["Krias Shema, sof zman (GRA)"], "Tefilah, sof zeman (MGA)": ["Tefilah, sof zman (MGA)"], "Tefilah, sof zeman (GRA)": ["Tefilah, sof zman (GRA)"], "Chatzot HaLailah": ["Chatzos HaLailah"], "Chatzot HaYom": ["Chatzos"], "Chatzot hayom": ["Chatzos"], "Mincha Gedolah": ["Mincha Gedolah"], "Mincha Ketanah": ["Mincha Ketanah"], "Plag HaMincha": ["Plag HaMincha"], "Sunset": ["Sunset"], "Bein HaShemashot": ["Bein HaShemashos"], "Tzeit HaKochavim": ["Tzeis HaKochavim"], "Latest Kiddush Levana": ["Latest Kiddush Levanah"] } } };
3
3
 
4
4
  export { poAshkenazi as default };
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.15.0, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.16.1, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import './locale.js';
3
3
  import { months, Locale, abs2greg, HDate } from '@hebcal/hdate';
4
4
  import { makeCandleEvent, makeFastStartEnd, makeWeekdayChanukahCandleLighting } from './candles.js';
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.15.0, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.16.1, distributed under GPLv2 or later 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 { HolidayEvent, ChanukahEvent } from './HolidayEvent.js';
@@ -47,7 +47,13 @@ function makeCandleEvent(ev, hd, options, isFriday, isSaturday) {
47
47
  return new HavdalahEvent(hd, mask, time, location, options.havdalahMins, ev, options);
48
48
  }
49
49
  else {
50
- mask |= LIGHT_CANDLES;
50
+ // Exactly one of the two candle-lighting flags, chosen by how the time
51
+ // was computed: LIGHT_CANDLES for minutes before sunset (Shabbat or the
52
+ // start of a chag), LIGHT_CANDLES_TZEIS for nightfall / Havdalah time
53
+ // (the second night of Yom Tov, or a chag that begins Saturday night).
54
+ mask = useHavdalahOffset
55
+ ? (mask & ~LIGHT_CANDLES) | LIGHT_CANDLES_TZEIS
56
+ : (mask & ~LIGHT_CANDLES_TZEIS) | LIGHT_CANDLES;
51
57
  return new CandleLightingEvent(hd, mask, time, location, ev, options);
52
58
  }
53
59
  }
@@ -1 +1 @@
1
- {"version":3,"file":"candles.js","sources":["../../../src/candles.ts"],"sourcesContent":["import {HDate, months} from '@hebcal/hdate';\nimport {CalOptions} from './CalOptions.js';\nimport {Location} from './location.js';\nimport {Event, flags} from './event.js';\nimport {ChanukahEvent, HolidayEvent} from './HolidayEvent.js';\nimport {Zmanim} from './zmanim.js';\nimport {TimedEvent, CandleLightingEvent, HavdalahEvent} from './TimedEvent.js';\nimport {holidayDesc as hdesc} from './staticHolidays.js';\nimport {DEG_6_POINT_45, DEG_7_POINT_083, DEG_16_POINT_1} from './zenith.js';\n\nconst {LIGHT_CANDLES, LIGHT_CANDLES_TZEIS} = flags;\nconst {FAST_BEGINS, FAST_ENDS} = hdesc;\n\n/** @internal */\nexport function makeCandleEvent(\n ev: Event | undefined,\n hd: HDate,\n options: CalOptions,\n isFriday: boolean,\n isSaturday: boolean\n): TimedEvent | undefined {\n let havdalahTitle = false;\n let useHavdalahOffset = isSaturday;\n let mask = ev ? ev.mask : LIGHT_CANDLES;\n if (ev !== undefined) {\n // if linked event && dow == FRI, use Candle lighting time & title\n if (!isFriday) {\n if (ev.hasAnyFlag('LIGHT_CANDLES_TZEIS', 'CHANUKAH_CANDLES')) {\n useHavdalahOffset = true;\n } else if (ev.hasFlag('YOM_TOV_ENDS')) {\n havdalahTitle = true;\n useHavdalahOffset = true;\n }\n }\n } else if (isSaturday) {\n havdalahTitle = true;\n mask = LIGHT_CANDLES_TZEIS;\n }\n // if Havdalah offset is 0 or undefined, we'll use tzeit time\n const offset = useHavdalahOffset\n ? Number(options.havdalahMins)\n : Number(options.candleLightingMins);\n const location = options.location as Location;\n const useElevation = Boolean(options.useElevation);\n const zmanim = new Zmanim(location, hd, useElevation);\n const time =\n useHavdalahOffset && !offset\n ? zmanim.tzeit(options.havdalahDeg)\n : zmanim.sunsetOffset(offset, true);\n if (Number.isNaN(time.getTime())) {\n return undefined; // no sunset\n }\n if (havdalahTitle) {\n return new HavdalahEvent(\n hd,\n mask,\n time,\n location,\n options.havdalahMins,\n ev,\n options\n );\n } else {\n mask |= LIGHT_CANDLES;\n return new CandleLightingEvent(hd, mask, time, location, ev, options);\n }\n}\n\n/**\n * Minutes after sunset that minor fasts (including Yom Kippur Katan) end in\n * Israel by default, following Rabbi Deblitzky's practice.\n * @see {https://www.yeshiva.org.il/calendar/timeprinciples}\n */\nconst MINOR_FAST_END_MINUTES_IL = 15;\n\n/**\n * Returns `val` when it is a finite nonzero number, otherwise `undefined`\n */\nfunction nonzero(val: number | undefined): number | undefined {\n return typeof val === 'number' && isFinite(val) && val !== 0 ? val : undefined;\n}\n\n/**\n * Computes the \"Fast begins\" time for a minor fast (one that begins at dawn).\n *\n * When `options.fastStartMins` is a nonzero number, the fast begins that many\n * minutes before sunrise; otherwise, when `options.fastStartDeg` is a nonzero\n * number, the fast begins when the sun is that many degrees below the horizon\n * in the morning. By default, minor fasts begin at Alot HaShachar (16.1°).\n */\nfunction makeFastStartTime(zmanim: Zmanim, options: CalOptions): Date {\n const fastStartMins = nonzero(options.fastStartMins);\n if (fastStartMins !== undefined) {\n return zmanim.sunriseOffset(-Math.abs(fastStartMins), true);\n }\n const fastStartDeg = nonzero(options.fastStartDeg);\n return zmanim.timeAtAngle(\n fastStartDeg === undefined ? DEG_16_POINT_1 : Math.abs(fastStartDeg),\n true\n );\n}\n\n/**\n * Computes the \"Fast ends\" time for a fast day.\n *\n * Tish'a B'Av ends `options.tishaBavEndMins` minutes after sunset or at tzeit\n * `options.tishaBavEndDeg` when either is a nonzero number, and otherwise at\n * tzeit 6.45° (Rabbi Yechiel Michel Tucazinsky). It is not affected by\n * `options.fastEndDeg`, `options.fastEndMins` or `options.il`.\n *\n * For minor fasts: when `options.fastEndMins` is a nonzero number, the fast\n * ends that many minutes after sunset; otherwise, when `options.fastEndDeg` is\n * a nonzero number, the fast ends at tzeit for that solar depression angle.\n * When neither is specified, the default depends on `options.il`:\n * - In Israel, minor fasts end 15 minutes after sunset (Rabbi Deblitzky's practice).\n * - Elsewhere, minor fasts end at tzeit 7.083° (3 medium-sized stars).\n */\nfunction makeFastEndTime(\n zmanim: Zmanim,\n isTishaBav: boolean,\n options: CalOptions\n): Date {\n if (isTishaBav) {\n const tishaBavEndMins = nonzero(options.tishaBavEndMins);\n if (tishaBavEndMins !== undefined) {\n return zmanim.sunsetOffset(Math.abs(tishaBavEndMins), true);\n }\n const tishaBavEndDeg = nonzero(options.tishaBavEndDeg);\n return zmanim.tzeit(\n tishaBavEndDeg === undefined ? DEG_6_POINT_45 : Math.abs(tishaBavEndDeg)\n );\n }\n const fastEndMins = options.fastEndMins;\n if (typeof fastEndMins === 'number' && fastEndMins !== 0) {\n return zmanim.sunsetOffset(Math.abs(fastEndMins), true);\n }\n const fastEndDeg = options.fastEndDeg;\n if (typeof fastEndDeg === 'number' && fastEndDeg !== 0) {\n return zmanim.tzeit(Math.abs(fastEndDeg));\n }\n if (options.il) {\n return zmanim.sunsetOffset(MINOR_FAST_END_MINUTES_IL, true);\n }\n return zmanim.tzeit(DEG_7_POINT_083);\n}\n\n/**\n * A fast day holiday with attached start and end time events.\n *\n * Wraps an underlying fast-day {@link HolidayEvent} and (when computable\n * for the given location) exposes a \"Fast begins\" and \"Fast ends\"\n * {@link TimedEvent}. Generated by {@link calendar} when\n * `options.candlelighting` is `true` and `options.location` is provided.\n *\n * - Minor fasts (including Yom Kippur Katan) begin at *Alot HaShachar*\n * (16.1° below horizon in the morning), which can be overridden via\n * `options.fastStartDeg` or `options.fastStartMins`. By default they end at\n * tzeit 7.083° (3 medium-sized stars) in the Diaspora, or 15 minutes after\n * sunset in Israel (Rabbi Deblitzky's practice). This can be overridden\n * via `options.fastEndDeg` or `options.fastEndMins`.\n * - Tish'a B'Av begins at sunset on the previous day, regardless of\n * `options.fastStartDeg` / `options.fastStartMins`. By default it ends at\n * tzeit 6.45° below horizon (Rabbi Yechiel Michel Tucazinsky), which can be\n * overridden via `options.tishaBavEndDeg` or `options.tishaBavEndMins`\n * (but not by `options.fastEndDeg` / `options.fastEndMins`).\n * - When a minor fast falls on a Friday, the end time is suppressed\n * (Shabbat begins before nightfall).\n */\nexport class FastDayEvent extends HolidayEvent {\n /** original event */\n readonly linkedEvent: HolidayEvent;\n /** this will be a \"Fast begins\" event */\n readonly startEvent?: TimedEvent;\n /** this will be a \"Fast ends\" event */\n readonly endEvent?: TimedEvent;\n constructor(\n linkedEvent: HolidayEvent,\n startEvent?: TimedEvent,\n endEvent?: TimedEvent\n ) {\n super(linkedEvent.getDate(), linkedEvent.getDesc(), linkedEvent.mask);\n this.linkedEvent = linkedEvent;\n this.startEvent = startEvent;\n this.endEvent = endEvent;\n }\n override render(locale?: string): string {\n return this.linkedEvent.render(locale);\n }\n override renderBrief(locale?: string): string {\n return this.linkedEvent.renderBrief(locale);\n }\n override urlDateSuffix(): string {\n return this.linkedEvent.urlDateSuffix();\n }\n override url(): string | undefined {\n return this.linkedEvent.url();\n }\n override getEmoji(): string {\n return this.linkedEvent.getEmoji();\n }\n override getCategories(): string[] {\n return this.linkedEvent.getCategories();\n }\n}\n\n/**\n * Makes a pair of events representing fast start and end times\n * @internal\n */\nexport function makeFastStartEnd(\n ev: HolidayEvent,\n options: CalOptions\n): FastDayEvent {\n const desc = ev.getDesc();\n if (desc === 'Yom Kippur') {\n throw new RangeError('YK does not require this function');\n }\n const hd = ev.getDate();\n const dt = hd.greg();\n const location = options.location as Location;\n const useElevation = Boolean(options.useElevation);\n const zmanim = new Zmanim(location, dt, useElevation);\n let startEvent: TimedEvent | undefined;\n let endEvent: TimedEvent | undefined;\n if (desc === \"Erev Tish'a B'Av\") {\n const sunset = zmanim.sunset();\n if (!Number.isNaN(sunset.getTime())) {\n startEvent = makeTimedEvent(ev, sunset, FAST_BEGINS, options);\n }\n } else if (desc.startsWith(\"Tish'a B'Av\")) {\n const fastEnd = makeFastEndTime(zmanim, true, options);\n if (!Number.isNaN(fastEnd.getTime())) {\n endEvent = makeTimedEvent(ev, fastEnd, FAST_ENDS, options);\n }\n } else {\n const fastStart = makeFastStartTime(zmanim, options);\n if (!Number.isNaN(fastStart.getTime())) {\n startEvent = makeTimedEvent(ev, fastStart, FAST_BEGINS, options);\n }\n if (\n dt.getDay() !== 5 &&\n !(hd.getDate() === 14 && hd.getMonth() === months.NISAN)\n ) {\n const fastEnd = makeFastEndTime(zmanim, false, options);\n if (!Number.isNaN(fastEnd.getTime())) {\n endEvent = makeTimedEvent(ev, fastEnd, FAST_ENDS, options);\n }\n }\n }\n const ev2 = new FastDayEvent(ev, startEvent, endEvent);\n // copy properties such as memo or emoji\n Object.assign(ev2, ev);\n return ev2;\n}\n\nfunction makeTimedEvent(\n ev: Event,\n time: Date,\n desc: string,\n options: CalOptions\n): TimedEvent {\n const location = options.location as Location;\n const hd = ev.getDate();\n return new TimedEvent(hd, desc, ev.mask, time, location, ev, options);\n}\n\n/**\n * A Chanukah candle-lighting event that carries a specific time of day.\n *\n * Generated by {@link calendar} when both `options.candlelighting`\n * and `options.location` are set. On weekdays the time is Bein HaShmashos\n * (13.5 minutes before the sun is 7.083° below the horizon in the evening);\n * on Friday it is regular candle-lighting time, and on Saturday night it is\n * regular Havdalah time.\n */\nexport class TimedChanukahEvent extends ChanukahEvent {\n /** Time at which candles are lit, rounded to the nearest minute */\n eventTime: Date;\n /** {@link eventTime} formatted for the event's location, e.g. `'4:31pm'` */\n eventTimeStr: string;\n /** Location used to calculate {@link eventTime} */\n readonly location: Location;\n /**\n * Normally created by {@link calendar} rather than directly.\n * @param ev the untimed Chanukah event this is derived from\n * @param eventTime time at which candles are lit\n * @param location location used to format the time\n */\n constructor(ev: ChanukahEvent, eventTime: Date, location: Location) {\n super(ev.getDate(), ev.getDesc(), ev.mask, ev.chanukahDay);\n this.eventTime = Zmanim.roundTime(eventTime);\n const timeFormat = location.getTimeFormatter();\n this.eventTimeStr = Zmanim.formatTime(this.eventTime, timeFormat);\n this.location = location;\n this.emoji = ev.emoji;\n }\n}\n\n/**\n * Makes a candle-lighting event for Chankah (not on Friday/Saturday).\n * At one point this used civil dusk (6 degrees below horizon).\n * Another source suggests 4.6667 degrees below horizon.\n * @internal\n */\nexport function makeWeekdayChanukahCandleLighting(\n ev: ChanukahEvent,\n options: CalOptions\n): TimedChanukahEvent | null {\n const hd = ev.getDate();\n const location = options.location as Location;\n const useElevation = Boolean(options.useElevation);\n const zmanim = new Zmanim(location, hd.greg(), useElevation);\n const candleLightingTime = zmanim.beinHaShmashos();\n if (Number.isNaN(candleLightingTime.getTime())) {\n return null;\n }\n return new TimedChanukahEvent(ev, candleLightingTime, location);\n}\n"],"names":["hdesc"],"mappings":";;;;;;;;;AAUA,MAAM,EAAC,aAAa,EAAE,mBAAmB,EAAC,GAAG,KAAK;AAClD,MAAM,EAAC,WAAW,EAAE,SAAS,EAAC,GAAGA,WAAK;AAEtC;AACM,SAAU,eAAe,CAC7B,EAAqB,EACrB,EAAS,EACT,OAAmB,EACnB,QAAiB,EACjB,UAAmB,EAAA;IAEnB,IAAI,aAAa,GAAG,KAAK;IACzB,IAAI,iBAAiB,GAAG,UAAU;AAClC,IAAA,IAAI,IAAI,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,GAAG,aAAa;AACvC,IAAA,IAAI,EAAE,KAAK,SAAS,EAAE;;QAEpB,IAAI,CAAC,QAAQ,EAAE;YACb,IAAI,EAAE,CAAC,UAAU,CAAC,qBAAqB,EAAE,kBAAkB,CAAC,EAAE;gBAC5D,iBAAiB,GAAG,IAAI;YAC1B;AAAO,iBAAA,IAAI,EAAE,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE;gBACrC,aAAa,GAAG,IAAI;gBACpB,iBAAiB,GAAG,IAAI;YAC1B;QACF;IACF;SAAO,IAAI,UAAU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AAK,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC;QAC1D,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC;AAC5C,QAAA,MAAM,UAAU,GAAG,QAAQ,CAAC,gBAAgB,EAAE;AAC9C,QAAA,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;AACjE,QAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ;AACxB,QAAA,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC,KAAK;IACvB;AACD;AAED;;;;;AAKG;AACG,SAAU,iCAAiC,CAC/C,EAAiB,EACjB,OAAmB,EAAA;AAEnB,IAAA,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE;AACvB,IAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAoB;IAC7C,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC;AAClD,IAAA,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC;AAC5D,IAAA,MAAM,kBAAkB,GAAG,MAAM,CAAC,cAAc,EAAE;IAClD,IAAI,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,OAAO,EAAE,CAAC,EAAE;AAC9C,QAAA,OAAO,IAAI;IACb;IACA,OAAO,IAAI,kBAAkB,CAAC,EAAE,EAAE,kBAAkB,EAAE,QAAQ,CAAC;AACjE;;"}
1
+ {"version":3,"file":"candles.js","sources":["../../../src/candles.ts"],"sourcesContent":["import {HDate, months} from '@hebcal/hdate';\nimport {CalOptions} from './CalOptions.js';\nimport {Location} from './location.js';\nimport {Event, flags} from './event.js';\nimport {ChanukahEvent, HolidayEvent} from './HolidayEvent.js';\nimport {Zmanim} from './zmanim.js';\nimport {TimedEvent, CandleLightingEvent, HavdalahEvent} from './TimedEvent.js';\nimport {holidayDesc as hdesc} from './staticHolidays.js';\nimport {DEG_6_POINT_45, DEG_7_POINT_083, DEG_16_POINT_1} from './zenith.js';\n\nconst {LIGHT_CANDLES, LIGHT_CANDLES_TZEIS} = flags;\nconst {FAST_BEGINS, FAST_ENDS} = hdesc;\n\n/** @internal */\nexport function makeCandleEvent(\n ev: Event | undefined,\n hd: HDate,\n options: CalOptions,\n isFriday: boolean,\n isSaturday: boolean\n): TimedEvent | undefined {\n let havdalahTitle = false;\n let useHavdalahOffset = isSaturday;\n let mask = ev ? ev.mask : LIGHT_CANDLES;\n if (ev !== undefined) {\n // if linked event && dow == FRI, use Candle lighting time & title\n if (!isFriday) {\n if (ev.hasAnyFlag('LIGHT_CANDLES_TZEIS', 'CHANUKAH_CANDLES')) {\n useHavdalahOffset = true;\n } else if (ev.hasFlag('YOM_TOV_ENDS')) {\n havdalahTitle = true;\n useHavdalahOffset = true;\n }\n }\n } else if (isSaturday) {\n havdalahTitle = true;\n mask = LIGHT_CANDLES_TZEIS;\n }\n // if Havdalah offset is 0 or undefined, we'll use tzeit time\n const offset = useHavdalahOffset\n ? Number(options.havdalahMins)\n : Number(options.candleLightingMins);\n const location = options.location as Location;\n const useElevation = Boolean(options.useElevation);\n const zmanim = new Zmanim(location, hd, useElevation);\n const time =\n useHavdalahOffset && !offset\n ? zmanim.tzeit(options.havdalahDeg)\n : zmanim.sunsetOffset(offset, true);\n if (Number.isNaN(time.getTime())) {\n return undefined; // no sunset\n }\n if (havdalahTitle) {\n return new HavdalahEvent(\n hd,\n mask,\n time,\n location,\n options.havdalahMins,\n ev,\n options\n );\n } else {\n // Exactly one of the two candle-lighting flags, chosen by how the time\n // was computed: LIGHT_CANDLES for minutes before sunset (Shabbat or the\n // start of a chag), LIGHT_CANDLES_TZEIS for nightfall / Havdalah time\n // (the second night of Yom Tov, or a chag that begins Saturday night).\n mask = useHavdalahOffset\n ? (mask & ~LIGHT_CANDLES) | LIGHT_CANDLES_TZEIS\n : (mask & ~LIGHT_CANDLES_TZEIS) | LIGHT_CANDLES;\n return new CandleLightingEvent(hd, mask, time, location, ev, options);\n }\n}\n\n/**\n * Minutes after sunset that minor fasts (including Yom Kippur Katan) end in\n * Israel by default, following Rabbi Deblitzky's practice.\n * @see {https://www.yeshiva.org.il/calendar/timeprinciples}\n */\nconst MINOR_FAST_END_MINUTES_IL = 15;\n\n/**\n * Returns `val` when it is a finite nonzero number, otherwise `undefined`\n */\nfunction nonzero(val: number | undefined): number | undefined {\n return typeof val === 'number' && isFinite(val) && val !== 0 ? val : undefined;\n}\n\n/**\n * Computes the \"Fast begins\" time for a minor fast (one that begins at dawn).\n *\n * When `options.fastStartMins` is a nonzero number, the fast begins that many\n * minutes before sunrise; otherwise, when `options.fastStartDeg` is a nonzero\n * number, the fast begins when the sun is that many degrees below the horizon\n * in the morning. By default, minor fasts begin at Alot HaShachar (16.1°).\n */\nfunction makeFastStartTime(zmanim: Zmanim, options: CalOptions): Date {\n const fastStartMins = nonzero(options.fastStartMins);\n if (fastStartMins !== undefined) {\n return zmanim.sunriseOffset(-Math.abs(fastStartMins), true);\n }\n const fastStartDeg = nonzero(options.fastStartDeg);\n return zmanim.timeAtAngle(\n fastStartDeg === undefined ? DEG_16_POINT_1 : Math.abs(fastStartDeg),\n true\n );\n}\n\n/**\n * Computes the \"Fast ends\" time for a fast day.\n *\n * Tish'a B'Av ends `options.tishaBavEndMins` minutes after sunset or at tzeit\n * `options.tishaBavEndDeg` when either is a nonzero number, and otherwise at\n * tzeit 6.45° (Rabbi Yechiel Michel Tucazinsky). It is not affected by\n * `options.fastEndDeg`, `options.fastEndMins` or `options.il`.\n *\n * For minor fasts: when `options.fastEndMins` is a nonzero number, the fast\n * ends that many minutes after sunset; otherwise, when `options.fastEndDeg` is\n * a nonzero number, the fast ends at tzeit for that solar depression angle.\n * When neither is specified, the default depends on `options.il`:\n * - In Israel, minor fasts end 15 minutes after sunset (Rabbi Deblitzky's practice).\n * - Elsewhere, minor fasts end at tzeit 7.083° (3 medium-sized stars).\n */\nfunction makeFastEndTime(\n zmanim: Zmanim,\n isTishaBav: boolean,\n options: CalOptions\n): Date {\n if (isTishaBav) {\n const tishaBavEndMins = nonzero(options.tishaBavEndMins);\n if (tishaBavEndMins !== undefined) {\n return zmanim.sunsetOffset(Math.abs(tishaBavEndMins), true);\n }\n const tishaBavEndDeg = nonzero(options.tishaBavEndDeg);\n return zmanim.tzeit(\n tishaBavEndDeg === undefined ? DEG_6_POINT_45 : Math.abs(tishaBavEndDeg)\n );\n }\n const fastEndMins = options.fastEndMins;\n if (typeof fastEndMins === 'number' && fastEndMins !== 0) {\n return zmanim.sunsetOffset(Math.abs(fastEndMins), true);\n }\n const fastEndDeg = options.fastEndDeg;\n if (typeof fastEndDeg === 'number' && fastEndDeg !== 0) {\n return zmanim.tzeit(Math.abs(fastEndDeg));\n }\n if (options.il) {\n return zmanim.sunsetOffset(MINOR_FAST_END_MINUTES_IL, true);\n }\n return zmanim.tzeit(DEG_7_POINT_083);\n}\n\n/**\n * A fast day holiday with attached start and end time events.\n *\n * Wraps an underlying fast-day {@link HolidayEvent} and (when computable\n * for the given location) exposes a \"Fast begins\" and \"Fast ends\"\n * {@link TimedEvent}. Generated by {@link calendar} when\n * `options.candlelighting` is `true` and `options.location` is provided.\n *\n * - Minor fasts (including Yom Kippur Katan) begin at *Alot HaShachar*\n * (16.1° below horizon in the morning), which can be overridden via\n * `options.fastStartDeg` or `options.fastStartMins`. By default they end at\n * tzeit 7.083° (3 medium-sized stars) in the Diaspora, or 15 minutes after\n * sunset in Israel (Rabbi Deblitzky's practice). This can be overridden\n * via `options.fastEndDeg` or `options.fastEndMins`.\n * - Tish'a B'Av begins at sunset on the previous day, regardless of\n * `options.fastStartDeg` / `options.fastStartMins`. By default it ends at\n * tzeit 6.45° below horizon (Rabbi Yechiel Michel Tucazinsky), which can be\n * overridden via `options.tishaBavEndDeg` or `options.tishaBavEndMins`\n * (but not by `options.fastEndDeg` / `options.fastEndMins`).\n * - When a minor fast falls on a Friday, the end time is suppressed\n * (Shabbat begins before nightfall).\n */\nexport class FastDayEvent extends HolidayEvent {\n /** original event */\n readonly linkedEvent: HolidayEvent;\n /** this will be a \"Fast begins\" event */\n readonly startEvent?: TimedEvent;\n /** this will be a \"Fast ends\" event */\n readonly endEvent?: TimedEvent;\n constructor(\n linkedEvent: HolidayEvent,\n startEvent?: TimedEvent,\n endEvent?: TimedEvent\n ) {\n super(linkedEvent.getDate(), linkedEvent.getDesc(), linkedEvent.mask);\n this.linkedEvent = linkedEvent;\n this.startEvent = startEvent;\n this.endEvent = endEvent;\n }\n override render(locale?: string): string {\n return this.linkedEvent.render(locale);\n }\n override renderBrief(locale?: string): string {\n return this.linkedEvent.renderBrief(locale);\n }\n override urlDateSuffix(): string {\n return this.linkedEvent.urlDateSuffix();\n }\n override url(): string | undefined {\n return this.linkedEvent.url();\n }\n override getEmoji(): string {\n return this.linkedEvent.getEmoji();\n }\n override getCategories(): string[] {\n return this.linkedEvent.getCategories();\n }\n}\n\n/**\n * Makes a pair of events representing fast start and end times\n * @internal\n */\nexport function makeFastStartEnd(\n ev: HolidayEvent,\n options: CalOptions\n): FastDayEvent {\n const desc = ev.getDesc();\n if (desc === 'Yom Kippur') {\n throw new RangeError('YK does not require this function');\n }\n const hd = ev.getDate();\n const dt = hd.greg();\n const location = options.location as Location;\n const useElevation = Boolean(options.useElevation);\n const zmanim = new Zmanim(location, dt, useElevation);\n let startEvent: TimedEvent | undefined;\n let endEvent: TimedEvent | undefined;\n if (desc === \"Erev Tish'a B'Av\") {\n const sunset = zmanim.sunset();\n if (!Number.isNaN(sunset.getTime())) {\n startEvent = makeTimedEvent(ev, sunset, FAST_BEGINS, options);\n }\n } else if (desc.startsWith(\"Tish'a B'Av\")) {\n const fastEnd = makeFastEndTime(zmanim, true, options);\n if (!Number.isNaN(fastEnd.getTime())) {\n endEvent = makeTimedEvent(ev, fastEnd, FAST_ENDS, options);\n }\n } else {\n const fastStart = makeFastStartTime(zmanim, options);\n if (!Number.isNaN(fastStart.getTime())) {\n startEvent = makeTimedEvent(ev, fastStart, FAST_BEGINS, options);\n }\n if (\n dt.getDay() !== 5 &&\n !(hd.getDate() === 14 && hd.getMonth() === months.NISAN)\n ) {\n const fastEnd = makeFastEndTime(zmanim, false, options);\n if (!Number.isNaN(fastEnd.getTime())) {\n endEvent = makeTimedEvent(ev, fastEnd, FAST_ENDS, options);\n }\n }\n }\n const ev2 = new FastDayEvent(ev, startEvent, endEvent);\n // copy properties such as memo or emoji\n Object.assign(ev2, ev);\n return ev2;\n}\n\nfunction makeTimedEvent(\n ev: Event,\n time: Date,\n desc: string,\n options: CalOptions\n): TimedEvent {\n const location = options.location as Location;\n const hd = ev.getDate();\n return new TimedEvent(hd, desc, ev.mask, time, location, ev, options);\n}\n\n/**\n * A Chanukah candle-lighting event that carries a specific time of day.\n *\n * Generated by {@link calendar} when both `options.candlelighting`\n * and `options.location` are set. On weekdays the time is Bein HaShmashos\n * (13.5 minutes before the sun is 7.083° below the horizon in the evening);\n * on Friday it is regular candle-lighting time, and on Saturday night it is\n * regular Havdalah time.\n */\nexport class TimedChanukahEvent extends ChanukahEvent {\n /** Time at which candles are lit, rounded to the nearest minute */\n eventTime: Date;\n /** {@link eventTime} formatted for the event's location, e.g. `'4:31pm'` */\n eventTimeStr: string;\n /** Location used to calculate {@link eventTime} */\n readonly location: Location;\n /**\n * Normally created by {@link calendar} rather than directly.\n * @param ev the untimed Chanukah event this is derived from\n * @param eventTime time at which candles are lit\n * @param location location used to format the time\n */\n constructor(ev: ChanukahEvent, eventTime: Date, location: Location) {\n super(ev.getDate(), ev.getDesc(), ev.mask, ev.chanukahDay);\n this.eventTime = Zmanim.roundTime(eventTime);\n const timeFormat = location.getTimeFormatter();\n this.eventTimeStr = Zmanim.formatTime(this.eventTime, timeFormat);\n this.location = location;\n this.emoji = ev.emoji;\n }\n}\n\n/**\n * Makes a candle-lighting event for Chankah (not on Friday/Saturday).\n * At one point this used civil dusk (6 degrees below horizon).\n * Another source suggests 4.6667 degrees below horizon.\n * @internal\n */\nexport function makeWeekdayChanukahCandleLighting(\n ev: ChanukahEvent,\n options: CalOptions\n): TimedChanukahEvent | null {\n const hd = ev.getDate();\n const location = options.location as Location;\n const useElevation = Boolean(options.useElevation);\n const zmanim = new Zmanim(location, hd.greg(), useElevation);\n const candleLightingTime = zmanim.beinHaShmashos();\n if (Number.isNaN(candleLightingTime.getTime())) {\n return null;\n }\n return new TimedChanukahEvent(ev, candleLightingTime, location);\n}\n"],"names":["hdesc"],"mappings":";;;;;;;;;AAUA,MAAM,EAAC,aAAa,EAAE,mBAAmB,EAAC,GAAG,KAAK;AAClD,MAAM,EAAC,WAAW,EAAE,SAAS,EAAC,GAAGA,WAAK;AAEtC;AACM,SAAU,eAAe,CAC7B,EAAqB,EACrB,EAAS,EACT,OAAmB,EACnB,QAAiB,EACjB,UAAmB,EAAA;IAEnB,IAAI,aAAa,GAAG,KAAK;IACzB,IAAI,iBAAiB,GAAG,UAAU;AAClC,IAAA,IAAI,IAAI,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,GAAG,aAAa;AACvC,IAAA,IAAI,EAAE,KAAK,SAAS,EAAE;;QAEpB,IAAI,CAAC,QAAQ,EAAE;YACb,IAAI,EAAE,CAAC,UAAU,CAAC,qBAAqB,EAAE,kBAAkB,CAAC,EAAE;gBAC5D,iBAAiB,GAAG,IAAI;YAC1B;AAAO,iBAAA,IAAI,EAAE,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE;gBACrC,aAAa,GAAG,IAAI;gBACpB,iBAAiB,GAAG,IAAI;YAC1B;QACF;IACF;SAAO,IAAI,UAAU,EAAE;QACrB,aAAa,GAAG,IAAI;QACpB,IAAI,GAAG,mBAAmB;IAC5B;;IAEA,MAAM,MAAM,GAAG;AACb,UAAE,MAAM,CAAC,OAAO,CAAC,YAAY;AAC7B,UAAE,MAAM,CAAC,OAAO,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,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC;QAC1D,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC;AAC5C,QAAA,MAAM,UAAU,GAAG,QAAQ,CAAC,gBAAgB,EAAE;AAC9C,QAAA,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;AACjE,QAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ;AACxB,QAAA,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC,KAAK;IACvB;AACD;AAED;;;;;AAKG;AACG,SAAU,iCAAiC,CAC/C,EAAiB,EACjB,OAAmB,EAAA;AAEnB,IAAA,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE;AACvB,IAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAoB;IAC7C,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC;AAClD,IAAA,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC;AAC5D,IAAA,MAAM,kBAAkB,GAAG,MAAM,CAAC,cAAc,EAAE;IAClD,IAAI,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,OAAO,EAAE,CAAC,EAAE;AAC9C,QAAA,OAAO,IAAI;IACb;IACA,OAAO,IAAI,kBAAkB,CAAC,EAAE,EAAE,kBAAkB,EAAE,QAAQ,CAAC;AACjE;;"}
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.15.0, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.16.1, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  var citiesJson = [
3
3
  "Ashdod|IL|31.79213|34.64966|Asia/Jerusalem|27",
4
4
  "Atlanta|US|33.749|-84.38798|America/New_York|336",
package/dist/esm/event.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.15.0, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.16.1, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import { HDate, Locale } from '@hebcal/hdate';
3
3
  import './locale.js';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.15.0, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.16.1, distributed under GPLv2 or later 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;
@@ -1,4 +1,27 @@
1
1
  import { HDate } from '@hebcal/hdate';
2
- import { Event } from './event.js';
3
- /** @internal */
4
- export declare function hallel_(events: Event[], hdate: HDate): number;
2
+ /**
3
+ * Determines which form of Hallel (if any) is recited
4
+ * on a given Hebrew date.
5
+ *
6
+ * Returns 0 (none), 1 (half Hallel), or 2 (whole Hallel).
7
+ *
8
+ * Whole Hallel is said on Chanukah, the first Yom Tov of Pesach, Shavuot, Sukkot,
9
+ * Shmini Atzeret, Simchat Torah, Yom Ha'atzmaut, and Yom Yerushalayim.
10
+ *
11
+ * Half Hallel is said on Rosh Chodesh (not Rosh Hashanah), and the last 6 days of Pesach.
12
+ * Rosh Chodesh Tevet falls during Chanukah, so whole Hallel is said then.
13
+ *
14
+ * The result is computed directly from the Hebrew month and day,
15
+ * without generating holiday events.
16
+ * @example
17
+ * import {hallel, HDate, months} from '@hebcal/core';
18
+ * hallel(new HDate(25, months.KISLEV, 5784), false); // 2 (Chanukah)
19
+ * hallel(new HDate(1, months.SHVAT, 5784), false); // 1 (Rosh Chodesh)
20
+ * hallel(new HDate(2, months.SHVAT, 5784), false); // 0
21
+ * hallel(new HDate(16, months.NISAN, 5784), false); // 2 (Pesach II, Diaspora)
22
+ * hallel(new HDate(16, months.NISAN, 5784), true); // 1 (Chol HaMoed, Israel)
23
+ * @param hdate Hebrew date to test
24
+ * @param il use the Israeli holiday schedule
25
+ * @returns 0 for no Hallel, 1 for half Hallel, 2 for whole Hallel
26
+ */
27
+ export declare function hallel(hdate: HDate, il: boolean): number;
@@ -1,40 +1,97 @@
1
- /*! @hebcal/core v6.15.0, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
2
- import { months } from '@hebcal/hdate';
3
- import { holidayDesc } from './staticHolidays.js';
1
+ /*! @hebcal/core v6.16.1, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
2
+ import { months, HDate } from '@hebcal/hdate';
3
+ import { dateYomHaZikaron } from './modern.js';
4
4
 
5
5
  const NONE = 0;
6
6
  const HALF = 1;
7
7
  const WHOLE = 2;
8
- /** @internal */
9
- function hallel_(events, hdate) {
10
- const abs = hdate.abs();
11
- for (const ev of events) {
12
- const hd = ev.getDate();
13
- if (hd.abs() !== abs) {
14
- continue;
8
+ /**
9
+ * Determines which form of Hallel (if any) is recited
10
+ * on a given Hebrew date.
11
+ *
12
+ * Returns 0 (none), 1 (half Hallel), or 2 (whole Hallel).
13
+ *
14
+ * Whole Hallel is said on Chanukah, the first Yom Tov of Pesach, Shavuot, Sukkot,
15
+ * Shmini Atzeret, Simchat Torah, Yom Ha'atzmaut, and Yom Yerushalayim.
16
+ *
17
+ * Half Hallel is said on Rosh Chodesh (not Rosh Hashanah), and the last 6 days of Pesach.
18
+ * Rosh Chodesh Tevet falls during Chanukah, so whole Hallel is said then.
19
+ *
20
+ * The result is computed directly from the Hebrew month and day,
21
+ * without generating holiday events.
22
+ * @example
23
+ * import {hallel, HDate, months} from '@hebcal/core';
24
+ * hallel(new HDate(25, months.KISLEV, 5784), false); // 2 (Chanukah)
25
+ * hallel(new HDate(1, months.SHVAT, 5784), false); // 1 (Rosh Chodesh)
26
+ * hallel(new HDate(2, months.SHVAT, 5784), false); // 0
27
+ * hallel(new HDate(16, months.NISAN, 5784), false); // 2 (Pesach II, Diaspora)
28
+ * hallel(new HDate(16, months.NISAN, 5784), true); // 1 (Chol HaMoed, Israel)
29
+ * @param hdate Hebrew date to test
30
+ * @param il use the Israeli holiday schedule
31
+ * @returns 0 for no Hallel, 1 for half Hallel, 2 for whole Hallel
32
+ */
33
+ function hallel(hdate, il) {
34
+ const mm = hdate.getMonth();
35
+ const dd = hdate.getDate();
36
+ switch (mm) {
37
+ case months.TISHREI:
38
+ // Sukkot (15-21), Shmini Atzeret (22), Simchat Torah (23, Diaspora)
39
+ if (dd >= 15 && dd <= (il ? 22 : 23)) {
40
+ return WHOLE;
41
+ }
42
+ break;
43
+ case months.KISLEV:
44
+ // Chanukah begins 25 Kislev; the first candle on the evening of
45
+ // 24 Kislev precedes the first morning of Chanukah
46
+ if (dd >= 25) {
47
+ return WHOLE;
48
+ }
49
+ break;
50
+ case months.TEVET: {
51
+ // Chanukah lasts 8 days, ending on 2 Tevet (3 Tevet if Kislev is short)
52
+ const lastDay = HDate.shortKislev(hdate.getFullYear()) ? 3 : 2;
53
+ if (dd <= lastDay) {
54
+ return WHOLE;
55
+ }
56
+ break;
15
57
  }
16
- const desc = ev.getDesc();
17
- const month = hd.getMonth();
18
- const mday = hd.getDate();
19
- if (desc.startsWith('Chanukah') ||
20
- desc.startsWith('Shavuot') ||
21
- desc.startsWith('Sukkot') ||
22
- (month === months.NISAN &&
23
- (mday === 15 || mday === 16) &&
24
- ev.hasFlag('CHAG')) || // Pesach
25
- desc === holidayDesc.YOM_HAATZMA_UT ||
26
- desc === holidayDesc.YOM_YERUSHALAYIM) {
27
- return WHOLE;
28
- }
29
- if (ev.hasFlag('ROSH_CHODESH') ||
30
- (desc.startsWith('Pesach') &&
31
- desc !== holidayDesc.PESACH_I &&
32
- desc !== holidayDesc.PESACH_II)) {
33
- return HALF;
58
+ case months.NISAN:
59
+ // First day(s) of Pesach
60
+ if (dd === 15 || (dd === 16 && !il)) {
61
+ return WHOLE;
62
+ }
63
+ // Remaining days of Pesach
64
+ if (dd >= 16 && dd <= (il ? 21 : 22)) {
65
+ return HALF;
66
+ }
67
+ break;
68
+ case months.IYYAR: {
69
+ const year = hdate.getFullYear();
70
+ // Yom Yerushalayim
71
+ if (dd === 28 && year >= 5727) {
72
+ return WHOLE;
73
+ }
74
+ // Yom Ha'atzmaut, the day after Yom HaZikaron
75
+ const yomHaZikaron = dateYomHaZikaron(year);
76
+ if (yomHaZikaron !== null && dd === yomHaZikaron.getDate() + 1) {
77
+ return WHOLE;
78
+ }
79
+ break;
34
80
  }
81
+ case months.SIVAN:
82
+ // Shavuot
83
+ if (dd === 6 || (dd === 7 && !il)) {
84
+ return WHOLE;
85
+ }
86
+ break;
87
+ }
88
+ // Rosh Chodesh: the 30th of any month, or the 1st of any month
89
+ // other than Tishrei (Rosh Hashana)
90
+ if (dd === 30 || (dd === 1 && mm !== months.TISHREI)) {
91
+ return HALF;
35
92
  }
36
93
  return NONE;
37
94
  }
38
95
 
39
- export { hallel_ };
96
+ export { hallel };
40
97
  //# sourceMappingURL=hallel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hallel.js","sources":["../../../src/hallel.ts"],"sourcesContent":["import {HDate, months} from '@hebcal/hdate';\nimport {Event} from './event.js';\nimport {holidayDesc as hdesc} from './staticHolidays.js';\n\nconst NONE = 0;\nconst HALF = 1;\nconst WHOLE = 2;\n\n/** @internal */\nexport function hallel_(events: Event[], hdate: HDate): number {\n const abs = hdate.abs();\n for (const ev of events) {\n const hd: HDate = ev.getDate();\n if (hd.abs() !== abs) {\n continue;\n }\n const desc = ev.getDesc();\n const month = hd.getMonth();\n const mday = hd.getDate();\n if (\n desc.startsWith('Chanukah') ||\n desc.startsWith('Shavuot') ||\n desc.startsWith('Sukkot') ||\n (month === months.NISAN &&\n (mday === 15 || mday === 16) &&\n ev.hasFlag('CHAG')) || // Pesach\n desc === hdesc.YOM_HAATZMA_UT ||\n desc === hdesc.YOM_YERUSHALAYIM\n ) {\n return WHOLE;\n }\n\n if (\n ev.hasFlag('ROSH_CHODESH') ||\n (desc.startsWith('Pesach') &&\n desc !== hdesc.PESACH_I &&\n desc !== hdesc.PESACH_II)\n ) {\n return HALF;\n }\n }\n\n return NONE;\n}\n"],"names":["hdesc"],"mappings":";;;;AAIA,MAAM,IAAI,GAAG,CAAC;AACd,MAAM,IAAI,GAAG,CAAC;AACd,MAAM,KAAK,GAAG,CAAC;AAEf;AACM,SAAU,OAAO,CAAC,MAAe,EAAE,KAAY,EAAA;AACnD,IAAA,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,EAAE;AACvB,IAAA,KAAK,MAAM,EAAE,IAAI,MAAM,EAAE;AACvB,QAAA,MAAM,EAAE,GAAU,EAAE,CAAC,OAAO,EAAE;AAC9B,QAAA,IAAI,EAAE,CAAC,GAAG,EAAE,KAAK,GAAG,EAAE;YACpB;QACF;AACA,QAAA,MAAM,IAAI,GAAG,EAAE,CAAC,OAAO,EAAE;AACzB,QAAA,MAAM,KAAK,GAAG,EAAE,CAAC,QAAQ,EAAE;AAC3B,QAAA,MAAM,IAAI,GAAG,EAAE,CAAC,OAAO,EAAE;AACzB,QAAA,IACE,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;AAC3B,YAAA,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC;AAC1B,YAAA,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;AACzB,aAAC,KAAK,KAAK,MAAM,CAAC,KAAK;AACrB,iBAAC,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,EAAE,CAAC;AAC5B,gBAAA,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YACrB,IAAI,KAAKA,WAAK,CAAC,cAAc;AAC7B,YAAA,IAAI,KAAKA,WAAK,CAAC,gBAAgB,EAC/B;AACA,YAAA,OAAO,KAAK;QACd;AAEA,QAAA,IACE,EAAE,CAAC,OAAO,CAAC,cAAc,CAAC;AAC1B,aAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;gBACxB,IAAI,KAAKA,WAAK,CAAC,QAAQ;AACvB,gBAAA,IAAI,KAAKA,WAAK,CAAC,SAAS,CAAC,EAC3B;AACA,YAAA,OAAO,IAAI;QACb;IACF;AAEA,IAAA,OAAO,IAAI;AACb;;"}
1
+ {"version":3,"file":"hallel.js","sources":["../../../src/hallel.ts"],"sourcesContent":["import {HDate, months} from '@hebcal/hdate';\nimport {dateYomHaZikaron} from './modern.js';\n\nconst NONE = 0;\nconst HALF = 1;\nconst WHOLE = 2;\n\n/**\n * Determines which form of Hallel (if any) is recited\n * on a given Hebrew date.\n *\n * Returns 0 (none), 1 (half Hallel), or 2 (whole Hallel).\n *\n * Whole Hallel is said on Chanukah, the first Yom Tov of Pesach, Shavuot, Sukkot,\n * Shmini Atzeret, Simchat Torah, 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 * Rosh Chodesh Tevet falls during Chanukah, so whole Hallel is said then.\n *\n * The result is computed directly from the Hebrew month and day,\n * without generating holiday events.\n * @example\n * import {hallel, HDate, months} from '@hebcal/core';\n * hallel(new HDate(25, months.KISLEV, 5784), false); // 2 (Chanukah)\n * hallel(new HDate(1, months.SHVAT, 5784), false); // 1 (Rosh Chodesh)\n * hallel(new HDate(2, months.SHVAT, 5784), false); // 0\n * hallel(new HDate(16, months.NISAN, 5784), false); // 2 (Pesach II, Diaspora)\n * hallel(new HDate(16, months.NISAN, 5784), true); // 1 (Chol HaMoed, Israel)\n * @param hdate Hebrew date to test\n * @param il use the Israeli holiday schedule\n * @returns 0 for no Hallel, 1 for half Hallel, 2 for whole Hallel\n */\nexport function hallel(hdate: HDate, il: boolean): number {\n const mm = hdate.getMonth();\n const dd = hdate.getDate();\n switch (mm) {\n case months.TISHREI:\n // Sukkot (15-21), Shmini Atzeret (22), Simchat Torah (23, Diaspora)\n if (dd >= 15 && dd <= (il ? 22 : 23)) {\n return WHOLE;\n }\n break;\n case months.KISLEV:\n // Chanukah begins 25 Kislev; the first candle on the evening of\n // 24 Kislev precedes the first morning of Chanukah\n if (dd >= 25) {\n return WHOLE;\n }\n break;\n case months.TEVET: {\n // Chanukah lasts 8 days, ending on 2 Tevet (3 Tevet if Kislev is short)\n const lastDay = HDate.shortKislev(hdate.getFullYear()) ? 3 : 2;\n if (dd <= lastDay) {\n return WHOLE;\n }\n break;\n }\n case months.NISAN:\n // First day(s) of Pesach\n if (dd === 15 || (dd === 16 && !il)) {\n return WHOLE;\n }\n // Remaining days of Pesach\n if (dd >= 16 && dd <= (il ? 21 : 22)) {\n return HALF;\n }\n break;\n case months.IYYAR: {\n const year = hdate.getFullYear();\n // Yom Yerushalayim\n if (dd === 28 && year >= 5727) {\n return WHOLE;\n }\n // Yom Ha'atzmaut, the day after Yom HaZikaron\n const yomHaZikaron = dateYomHaZikaron(year);\n if (yomHaZikaron !== null && dd === yomHaZikaron.getDate() + 1) {\n return WHOLE;\n }\n break;\n }\n case months.SIVAN:\n // Shavuot\n if (dd === 6 || (dd === 7 && !il)) {\n return WHOLE;\n }\n break;\n default:\n break;\n }\n\n // Rosh Chodesh: the 30th of any month, or the 1st of any month\n // other than Tishrei (Rosh Hashana)\n if (dd === 30 || (dd === 1 && mm !== months.TISHREI)) {\n return HALF;\n }\n\n return NONE;\n}\n"],"names":[],"mappings":";;;;AAGA,MAAM,IAAI,GAAG,CAAC;AACd,MAAM,IAAI,GAAG,CAAC;AACd,MAAM,KAAK,GAAG,CAAC;AAEf;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;AACG,SAAU,MAAM,CAAC,KAAY,EAAE,EAAW,EAAA;AAC9C,IAAA,MAAM,EAAE,GAAG,KAAK,CAAC,QAAQ,EAAE;AAC3B,IAAA,MAAM,EAAE,GAAG,KAAK,CAAC,OAAO,EAAE;IAC1B,QAAQ,EAAE;QACR,KAAK,MAAM,CAAC,OAAO;;AAEjB,YAAA,IAAI,EAAE,IAAI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E;AACjC,gBAAA,OAAO,KAAK;YACd;YACA;;;;AAOJ,IAAA,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,MAAM,CAAC,OAAO,CAAC,EAAE;AACpD,QAAA,OAAO,IAAI;IACb;AAEA,IAAA,OAAO,IAAI;AACb;;"}
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.15.0, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.16.1, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  var noNikudOverride = { "headers": { "plural-forms": "nplurals=2; plural=(n != 1);", "language": "he-x-NoNikud" }, "contexts": { "": { "Korach": ["קורח"], "Chukat": ["חוקת"], "Erev Yom Kippur": ["ערב יום כיפור"], "Yom Kippur": ["יום כיפור"], "Yom Kippur Katan": ["יום כיפור קטן"], "Pesach Shabbat Chol ha-Moed": ["שבת חול המועד פסח"], "Sukkot Shabbat Chol ha-Moed": ["שבת חול המועד סוכות"], "Erev Sukkot": ["ערב סוכות"], "Sukkot": ["סוכות"], "Sukkot I": ["סוכות א׳"], "Sukkot II": ["סוכות ב׳"], "Sukkot II (CH''M)": ["סוכות ב׳ (חוה״מ)"], "Sukkot III (CH''M)": ["סוכות ג׳ (חוה״מ)"], "Sukkot IV (CH''M)": ["סוכות ד׳ (חוה״מ)"], "Sukkot V (CH''M)": ["סוכות ה׳ (חוה״מ)"], "Sukkot VI (CH''M)": ["סוכות ו׳ (חוה״מ)"], "Sukkot VII (Hoshana Raba)": ["סוכות ז׳ (הושענא רבה)"], "Swords of Iron War Memorial Day": ["יום הזיכרון לחללי מלחמת חרבות ברזל"], "Latest Kiddush Levana": ["סוף זמן קידוש לבנה"] } } };
3
3
 
4
4
  export { noNikudOverride as default };
package/dist/esm/he.po.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.15.0, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.16.1, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  var poHe = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);", "language": "he_IL" }, "contexts": { "": { "Shabbat": ["שַׁבָּת"], "Parashat": ["פָּרָשַׁת"], "Achrei Mot": ["אַחֲרֵי מוֹת"], "Balak": ["בָּלָק"], "Bamidbar": ["בְּמִדְבַּר"], "Bechukotai": ["בְּחֻקֹּתַי"], "Beha'alotcha": ["בְּהַעֲלֹתְךָ"], "Behar": ["בְּהַר"], "Bereshit": ["בְּרֵאשִׁית"], "Beshalach": ["בְּשַׁלַּח"], "Bo": ["בֹּא"], "Chayei Sara": ["חַיֵּי שָֹרָה"], "Chukat": ["חֻקַּת"], "Devarim": ["דְּבָרִים"], "Eikev": ["עֵקֶב"], "Emor": ["אֱמוֹר"], "Ha'azinu": ["הַאֲזִינוּ"], "Kedoshim": ["קְדֹשִׁים"], "Ki Tavo": ["כִּי־תָבוֹא"], "Ki Teitzei": ["כִּי־תֵצֵא"], "Ki Tisa": ["כִּי תִשָּׂא"], "Korach": ["קֹרַח"], "Lech-Lecha": ["לֶךְ־לְךָ"], "Masei": ["מַסְעֵי"], "Matot": ["מַטּוֹת"], "Metzora": ["מְצֹרָע"], "Miketz": ["מִקֵּץ"], "Mishpatim": ["מִשְׁפָּטִים"], "Nasso": ["נָשׂא"], "Nitzavim": ["נִצָּבִים"], "Noach": ["נֹחַ"], "Pekudei": ["פְקוּדֵי"], "Pinchas": ["פִּינְחָס"], "Re'eh": ["רְאֵה"], "Sh'lach": ["שְׁלַח־לְךָ"], "Shemot": ["שְׁמוֹת"], "Shmini": ["שְּׁמִינִי"], "Shoftim": ["שׁוֹפְטִים"], "Tazria": ["תַזְרִיעַ"], "Terumah": ["תְּרוּמָה"], "Tetzaveh": ["תְּצַוֶּה"], "Toldot": ["תּוֹלְדוֹת"], "Tzav": ["צַו"], "Vaera": ["וָאֵרָא"], "Vaetchanan": ["וָאֶתְחַנַּן"], "Vayakhel": ["וַיַּקְהֵל"], "Vayechi": ["וַיְחִי"], "Vayeilech": ["וַיֵּלֶךְ"], "Vayera": ["וַיֵּרָא"], "Vayeshev": ["וַיֵּשֶׁב"], "Vayetzei": ["וַיֵּצֵא"], "Vayigash": ["וַיִּגַּשׁ"], "Vayikra": ["וַיִּקְרָא"], "Vayishlach": ["וַיִּשְׁלַח"], "Vezot Haberakhah": ["וְזֹאת הַבְּרָכָה"], "Yitro": ["יִתְרוֹ"], "Asara B'Tevet": ["עֲשָׂרָה בְּטֵבֵת"], "Candle lighting": ["הַדְלָקַת נֵרוֹת"], "Chanukah": ["חֲנוּכָּה"], "Chanukah: 1 Candle": ["חֲנוּכָּה: א׳ נֵר"], "Chanukah: 2 Candles": ["חֲנוּכָּה: ב׳ נֵרוֹת"], "Chanukah: 3 Candles": ["חֲנוּכָּה: ג׳ נֵרוֹת"], "Chanukah: 4 Candles": ["חֲנוּכָּה: ד׳ נֵרוֹת"], "Chanukah: 5 Candles": ["חֲנוּכָּה: ה׳ נֵרוֹת"], "Chanukah: 6 Candles": ["חֲנוּכָּה: ו׳ נֵרוֹת"], "Chanukah: 7 Candles": ["חֲנוּכָּה: ז׳ נֵרוֹת"], "Chanukah: 8 Candles": ["חֲנוּכָּה: ח׳ נֵרוֹת"], "Chanukah: 8th Day": ["חֲנוּכָּה: יוֹם ח׳"], "Days of the Omer": ["סְפִירַת הָעוֹמֶר"], "Omer": ["עוֹמֶר"], "day of the Omer": ["בָּעוֹמֶר"], "Erev Pesach": ["עֶרֶב פֶּסַח"], "Erev Purim": ["עֶרֶב פּוּרִים"], "Erev Rosh Hashana": ["עֶרֶב רֹאשׁ הַשָּׁנָה"], "Erev Shavuot": ["עֶרֶב שָׁבוּעוֹת"], "Erev Simchat Torah": ["עֶרֶב שִׂמְחַת תּוֹרָה"], "Erev Sukkot": ["עֶרֶב סֻכּוֹת"], "Erev Tish'a B'Av": ["עֶרֶב תִּשְׁעָה בְּאָב"], "Erev Yom Kippur": ["עֶרֶב יוֹם כִּפּוּר"], "Havdalah": ["הַבְדָּלָה"], "Lag BaOmer": ["ל״ג בָּעוֹמֶר"], "Leil Selichot": ["סְלִיחוֹת"], "Pesach": ["פֶּסַח"], "Pesach I": ["פֶּסַח א׳"], "Pesach II": ["פֶּסַח ב׳"], "Pesach II (CH''M)": ["פֶּסַח ב׳ (חוה״מ)"], "Pesach III (CH''M)": ["פֶּסַח ג׳ (חוה״מ)"], "Pesach IV (CH''M)": ["פֶּסַח ד׳ (חוה״מ)"], "Pesach Sheni": ["פֶּסַח שֵׁנִי"], "Pesach V (CH''M)": ["פֶּסַח ה׳ (חוה״מ)"], "Pesach VI (CH''M)": ["פֶּסַח ו׳ (חוה״מ)"], "Pesach VII": ["פֶּסַח ז׳"], "Pesach VIII": ["פֶּסַח ח׳"], "Pesach Shabbat Chol ha-Moed": ["שַׁבַּת חֹל הַמּוֹעֵד פֶּסַח"], "Purim": ["פּוּרִים"], "Purim Katan": ["פּוּרִים קָטָן"], "Rosh Chodesh": ["רֹאשׁ חוֹדֶשׁ"], "Rosh Hashana": ["רֹאשׁ הַשָּׁנָה"], "Rosh Hashana I": ["רֹאשׁ הַשָּׁנָה א׳"], "Rosh Hashana II": ["רֹאשׁ הַשָּׁנָה ב׳"], "Shabbat Chazon": ["שַׁבַּת חֲזוֹן"], "Shabbat HaChodesh": ["שַׁבַּת הַחֹדֶשׁ"], "Shabbat HaGadol": ["שַׁבַּת הַגָּדוֹל"], "Shabbat Nachamu": ["שַׁבַּת נַחֲמוּ"], "Shabbat Parah": ["שַׁבַּת פָּרָה"], "Shabbat Shekalim": ["שַׁבַּת שְׁקָלִים"], "Shabbat Shuva": ["שַׁבַּת שׁוּבָה"], "Shabbat Zachor": ["שַׁבַּת זָכוֹר"], "Shavuot": ["שָׁבוּעוֹת"], "Shavuot I": ["שָׁבוּעוֹת א׳"], "Shavuot II": ["שָׁבוּעוֹת ב׳"], "Shmini Atzeret": ["שְׁמִינִי עֲצֶרֶת"], "Shushan Purim": ["שׁוּשָׁן פּוּרִים"], "Sigd": ["חַג הַסִּיגְד"], "Simchat Torah": ["שִׂמְחַת תּוֹרָה"], "Sukkot": ["סֻכּוֹת"], "Sukkot I": ["סֻכּוֹת א׳"], "Sukkot II": ["סֻכּוֹת ב׳"], "Sukkot II (CH''M)": ["סֻכּוֹת ב׳ (חוה״מ)"], "Sukkot III (CH''M)": ["סֻכּוֹת ג׳ (חוה״מ)"], "Sukkot IV (CH''M)": ["סֻכּוֹת ד׳ (חוה״מ)"], "Sukkot V (CH''M)": ["סֻכּוֹת ה׳ (חוה״מ)"], "Sukkot VI (CH''M)": ["סֻכּוֹת ו׳ (חוה״מ)"], "Sukkot VII (Hoshana Raba)": ["סֻכּוֹת ז׳ (הוֹשַׁעְנָא רַבָּה)"], "Sukkot Shabbat Chol ha-Moed": ["שַׁבַּת חֹל הַמּוֹעֵד סֻכּוֹת"], "Ta'anit Bechorot": ["תַּעֲנִית בְּכוֹרוֹת"], "Ta'anit BeHaB": ["תַּעֲנִית בה״ב"], "Ta'anit Esther": ["תַּעֲנִית אֶסְתֵּר"], "Tish'a B'Av": ["תִּשְׁעָה בְּאָב"], "Tu B'Av": ["ט״וּ בְּאָב"], "Tu BiShvat": ["ט״וּ בִּשְׁבָט"], "Tu B'Shvat": ["ט״וּ בִּשְׁבָט"], "Tzom Gedaliah": ["צוֹם גְּדַלְיָה"], "Tzom Tammuz": ["צוֹם י״ז בְּתַמּוּז"], "Yom HaAtzma'ut": ["יוֹם הָעַצְמָאוּת"], "Yom HaShoah": ["יוֹם הַשּׁוֹאָה"], "Yom HaZikaron": ["יוֹם הַזִּכָּרוֹן"], "Yom Kippur": ["יוֹם כִּפּוּר"], "Yom Yerushalayim": ["יוֹם יְרוּשָׁלַיִם"], "Yom HaAliyah": ["יוֹם הַעֲלִיָּה"], "Yom HaAliyah School Observance": ["שְׁמִירָת בֵּית הַסֵפֶר לְיוֹם הַעֲלִיָּה"], "Rosh Chodesh Adar": ["רֹאשׁ חוֹדֶשׁ אֲדָר"], "Rosh Chodesh Adar I": ["רֹאשׁ חוֹדֶשׁ אֲדָר א׳"], "Rosh Chodesh Adar II": ["רֹאשׁ חוֹדֶשׁ אֲדָר ב׳"], "Rosh Chodesh Av": ["רֹאשׁ חוֹדֶשׁ אָב"], "Rosh Chodesh Cheshvan": ["רֹאשׁ חוֹדֶשׁ חֶשְׁוָן"], "Rosh Chodesh Elul": ["רֹאשׁ חוֹדֶשׁ אֱלוּל"], "Rosh Chodesh Iyyar": ["רֹאשׁ חוֹדֶשׁ אִיָּיר"], "Rosh Chodesh Kislev": ["רֹאשׁ חוֹדֶשׁ כִּסְלֵו"], "Rosh Chodesh Nisan": ["רֹאשׁ חוֹדֶשׁ נִיסָן"], "Rosh Chodesh Sh'vat": ["רֹאשׁ חוֹדֶשׁ שְׁבָט"], "Rosh Chodesh Sivan": ["רֹאשׁ חוֹדֶשׁ סִיוָן"], "Rosh Chodesh Tamuz": ["רֹאשׁ חוֹדֶשׁ תַּמּוּז"], "Rosh Chodesh Tammuz": ["רֹאשׁ חוֹדֶשׁ תַּמּוּז"], "Rosh Chodesh Tevet": ["רֹאשׁ חוֹדֶשׁ טֵבֵת"], "min": ["דַּקּוֹת"], "Fast begins": ["תְּחִילַּת הַצוֹם"], "Fast ends": ["סִיּוּם הַצוֹם"], "Rosh Hashana LaBehemot": ["רֹאשׁ הַשָּׁנָה לְמַעְשַׂר בְּהֵמָה"], "Tish'a B'Av (observed)": ["(תִּשְׁעָה בְּאָב (נִדְחָה"], "Shabbat Mevarchim Chodesh": ["שַׁבַּת מְבָרְכִים חוֹדֶשׁ"], "Shabbat Shirah": ["שַׁבַּת שִׁירָה"], "Lovingkindness": ["חֶסֶד"], "Might": ["גְּבוּרָה"], "Beauty": ["תִּפְאֶרֶת"], "Eternity": ["נֶּצַח"], "Splendor": ["הוֹד"], "Foundation": ["יְּסוֹד"], "Majesty": ["מַּלְכוּת"], "day": ["יוֹם"], "Yom Kippur Katan": ["יוֹם כִּפּוּר קָטָן"], "Yizkor": ["יִזְכּוֹר"], "Family Day": ["יוֹם הַמִּשׁפָּחָה"], "Yitzhak Rabin Memorial Day": ["יוֹם הַזִּכָּרוֹן לְיִצְחָק רַבִּין"], "Jabotinsky Day": ["יוֹם זַ׳בּוֹטִינְסְקִי"], "Herzl Day": ["יוֹם הֶרְצְל"], "Ben-Gurion Day": ["יוֹם בֶּן־גּוּרִיּוֹן"], "Hebrew Language Day": ["יוֹם הַשָׂפָה הַעִברִית"], "Birkat Hachamah": ["בִּרְכַּת הַחַמָּה"], "Birkat HaChamah": ["בִּרְכַּת הַחַמָּה"], "Shushan Purim Katan": ["שׁוּשָׁן פּוּרִים קָטָן"], "Purim Meshulash": ["פּוּרִים מְשׁוּלָּשׁ"], "Chag HaBanot": ["חַג הַבָּנוֹת"], "Molad": ["מוֹלָד הָלְּבָנָה"], "chalakim": ["חֲלָקִים"], "Alot HaShachar": ["עֲלוֹת הַשַּׁחַר"], "Misheyakir": ["מִשֶּׁיַּכִּיר"], "Misheyakir Machmir": ["מִשֶּׁיַּכִּיר מַחְמִיר"], "Sunrise": ["נֵץ הַחַמָּה"], "Kriat Shema, sof zeman": ["סוֹף זְמַן קְרִיאַת שְׁמַע"], "Tefilah, sof zeman": ["סוֹף זְמַן תְּפִלָּה"], "Kriat Shema, sof zeman (MGA)": ["סוֹף זְמַן קְרִיאַת שְׁמַע (מג״א)"], "Kriat Shema, sof zeman (GRA)": ["סוֹף זְמַן קְרִיאַת שְׁמַע (גְּרָ״א)"], "Tefilah, sof zeman (MGA)": ["סוֹף זְמַן תְּפִלָּה (מג״א)"], "Tefilah, sof zeman (GRA)": ["סוֹף זְמַן תְּפִלָּה (גְּרָ״א)"], "Chatzot HaLailah": ["חֲצוֹת הַלַּיְלָה"], "Chatzot HaYom": ["חֲצוֹת הַיּוֹם"], "Chatzot hayom": ["חֲצוֹת הַיּוֹם"], "Mincha Gedolah": ["מִנְחָה גְּדוֹלָה"], "Mincha Ketanah": ["מִנְחָה קְטַנָּה"], "Plag HaMincha": ["פְּלַג הַמִּנְחָה"], "Sunset": ["שְׁקִיעַת הַחַמָּה"], "Bein HaShemashot": ["בֵּין הַשְּׁמָשׁוֹת"], "Tzeit HaKochavim": ["צֵאת הַכּוֹכָבִים"], "Biur Chametz": ["בִּעוּר חָמֵץ"], "Finish eating chametz": ["סוֹף זְמַן אֲכִילַת חָמֵץ"], "Swords of Iron War Memorial Day": ["יוֹם הַזִּכָּרוֹן לְחַלְלֵי מִלְחֶמֶת חַרְבוֹת בַּרְזֶל"], "Latest Kiddush Levana": ["סוֹף זְמַן קִדּוּשׁ לְבָנָה"] } } };
3
3
 
4
4
  export { poHe as default };