@hebcal/core 6.9.3 → 6.11.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 (89) hide show
  1. package/README.md +21 -12
  2. package/dist/bundle.js +1205 -1006
  3. package/dist/bundle.js.map +1 -1
  4. package/dist/bundle.min.js +13 -13
  5. package/dist/bundle.min.js.map +1 -1
  6. package/dist/esm/CalOptions.d.ts +35 -2
  7. package/dist/esm/DailyLearning.js +1 -1
  8. package/dist/esm/DailyLearning.js.map +1 -1
  9. package/dist/esm/HebrewDateEvent.js +1 -1
  10. package/dist/esm/HebrewDateEvent.js.map +1 -1
  11. package/dist/esm/HolidayEvent.js +3 -3
  12. package/dist/esm/HolidayEvent.js.map +1 -1
  13. package/dist/esm/MevarchimChodeshEvent.js +1 -1
  14. package/dist/esm/MevarchimChodeshEvent.js.map +1 -1
  15. package/dist/esm/ParshaEvent.js +1 -1
  16. package/dist/esm/ParshaEvent.js.map +1 -1
  17. package/dist/esm/TimedEvent.js +1 -1
  18. package/dist/esm/TimedEvent.js.map +1 -1
  19. package/dist/esm/YomKippurKatanEvent.js +1 -1
  20. package/dist/esm/YomKippurKatanEvent.js.map +1 -1
  21. package/dist/esm/ashkenazi.po.js +1 -1
  22. package/dist/esm/ashkenazi.po.js.map +1 -1
  23. package/dist/esm/calendar.d.ts +11 -3
  24. package/dist/esm/calendar.js +50 -15
  25. package/dist/esm/calendar.js.map +1 -1
  26. package/dist/esm/candles.d.ts +8 -5
  27. package/dist/esm/candles.js +58 -18
  28. package/dist/esm/candles.js.map +1 -1
  29. package/dist/esm/cities.json.js +1 -1
  30. package/dist/esm/cities.json.js.map +1 -1
  31. package/dist/esm/event.d.ts +47 -0
  32. package/dist/esm/event.js +63 -4
  33. package/dist/esm/event.js.map +1 -1
  34. package/dist/esm/getStartAndEnd.js +1 -1
  35. package/dist/esm/getStartAndEnd.js.map +1 -1
  36. package/dist/esm/hallel.js +3 -5
  37. package/dist/esm/hallel.js.map +1 -1
  38. package/dist/esm/he-x-NoNikud.po.js +1 -1
  39. package/dist/esm/he-x-NoNikud.po.js.map +1 -1
  40. package/dist/esm/he.po.js +1 -1
  41. package/dist/esm/he.po.js.map +1 -1
  42. package/dist/esm/hebcal.d.ts +2 -2
  43. package/dist/esm/hebcal.js +4 -5
  44. package/dist/esm/hebcal.js.map +1 -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 +8 -8
  48. package/dist/esm/index.js +1 -1
  49. package/dist/esm/isAssurBemlacha.js +3 -5
  50. package/dist/esm/isAssurBemlacha.js.map +1 -1
  51. package/dist/esm/isAveilut.js +1 -1
  52. package/dist/esm/isAveilut.js.map +1 -1
  53. package/dist/esm/isFastDay.js +2 -8
  54. package/dist/esm/isFastDay.js.map +1 -1
  55. package/dist/esm/locale.js +1 -1
  56. package/dist/esm/location.js +1 -1
  57. package/dist/esm/location.js.map +1 -1
  58. package/dist/esm/modern.js +1 -1
  59. package/dist/esm/modern.js.map +1 -1
  60. package/dist/esm/molad.js +1 -1
  61. package/dist/esm/molad.js.map +1 -1
  62. package/dist/esm/moladBase.js +1 -1
  63. package/dist/esm/moladBase.js.map +1 -1
  64. package/dist/esm/moladDate.js +1 -1
  65. package/dist/esm/moladDate.js.map +1 -1
  66. package/dist/esm/omer.js +1 -1
  67. package/dist/esm/omer.js.map +1 -1
  68. package/dist/esm/parshaName.js +1 -1
  69. package/dist/esm/parshaName.js.map +1 -1
  70. package/dist/esm/parshaYear.js +1 -1
  71. package/dist/esm/parshaYear.js.map +1 -1
  72. package/dist/esm/pkgVersion.d.ts +1 -1
  73. package/dist/esm/pkgVersion.js +2 -2
  74. package/dist/esm/pkgVersion.js.map +1 -1
  75. package/dist/esm/reformatTimeStr.js +1 -1
  76. package/dist/esm/reformatTimeStr.js.map +1 -1
  77. package/dist/esm/sedra.js +1 -1
  78. package/dist/esm/sedra.js.map +1 -1
  79. package/dist/esm/sefira.json.js +1 -1
  80. package/dist/esm/sefira.json.js.map +1 -1
  81. package/dist/esm/staticHolidays.js +1 -1
  82. package/dist/esm/staticHolidays.js.map +1 -1
  83. package/dist/esm/string.js +1 -1
  84. package/dist/esm/string.js.map +1 -1
  85. package/dist/esm/tachanun.js +1 -1
  86. package/dist/esm/tachanun.js.map +1 -1
  87. package/dist/esm/zmanim.js +1 -1
  88. package/dist/esm/zmanim.js.map +1 -1
  89. package/package.json +10 -10
@@ -72,16 +72,49 @@ export type CalOptions = {
72
72
  * Rabbi Yechiel Michel Tucazinsky. Mutually exclusive with `fastEndMins`.
73
73
  * If neither is specified, minor fasts end at 7.083 degrees in the Diaspora,
74
74
  * or 15 minutes after sunset in Israel (Rabbi Deblitzky's practice).
75
- * Note: Tish'a B'Av always ends at 6.45 degrees and is not affected by this option.
75
+ * Note: Tish'a B'Av is not affected by this option; see `tishaBavEndDeg`.
76
76
  */
77
77
  fastEndDeg?: number;
78
78
  /**
79
79
  * minutes after sunset for the end of minor fasts.
80
80
  * When set to a nonzero value, minor fasts (including Yom Kippur Katan) end
81
81
  * this many minutes after sunset. Mutually exclusive with `fastEndDeg`.
82
- * Note: Tish'a B'Av always ends at 6.45 degrees and is not affected by this option.
82
+ * Note: Tish'a B'Av is not affected by this option; see `tishaBavEndMins`.
83
83
  */
84
84
  fastEndMins?: number;
85
+ /**
86
+ * degrees for solar depression for the start of minor fasts.
87
+ * When set to a nonzero value, minor fasts (including Yom Kippur Katan) begin
88
+ * when the sun is this many degrees below the horizon in the morning.
89
+ * Mutually exclusive with `fastStartMins`.
90
+ * If neither is specified, minor fasts begin at Alot HaShachar, 16.1 degrees.
91
+ * Note: Tish'a B'Av begins at sunset on the previous day and is not affected
92
+ * by this option.
93
+ */
94
+ fastStartDeg?: number;
95
+ /**
96
+ * minutes before sunrise for the start of minor fasts (typical values are
97
+ * 72 or 90). When set to a nonzero value, minor fasts (including
98
+ * Yom Kippur Katan) begin this many minutes before sunrise.
99
+ * Mutually exclusive with `fastStartDeg`.
100
+ * Note: Tish'a B'Av begins at sunset on the previous day and is not affected
101
+ * by this option.
102
+ */
103
+ fastStartMins?: number;
104
+ /**
105
+ * degrees for solar depression for the end of Tish'a B'Av.
106
+ * When set to a nonzero value, Tish'a B'Av ends when the sun is this many
107
+ * degrees below the horizon in the evening. Mutually exclusive with
108
+ * `tishaBavEndMins`. If neither is specified, Tish'a B'Av ends at 6.45 degrees,
109
+ * as calculated by Rabbi Yechiel Michel Tucazinsky.
110
+ */
111
+ tishaBavEndDeg?: number;
112
+ /**
113
+ * minutes after sunset for the end of Tish'a B'Av.
114
+ * When set to a nonzero value, Tish'a B'Av ends this many minutes after sunset.
115
+ * Mutually exclusive with `tishaBavEndDeg`.
116
+ */
117
+ tishaBavEndMins?: number;
85
118
  /**
86
119
  * use elevation for calculations (default `false`).
87
120
  * If `true`, use elevation to affect the calculation of all sunrise/sunset based zmanim.
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.9.3, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.11.0, distributed under GPLv2 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 +1 @@
1
- {"version":3,"file":"DailyLearning.js","sources":["../../../src/DailyLearning.ts"],"sourcesContent":["import {HDate} from '@hebcal/hdate';\nimport {Event} from './event.js';\n\ntype LearningCalendar = {\n fn: (hd: HDate, il: boolean) => Event | null;\n startDate?: HDate;\n};\nconst cals = new Map<string, LearningCalendar>();\n\n/**\n * Plug-in registry for daily learning calendars such as Daf Yomi (Bavli),\n * Yerushalmi Yomi, Mishna Yomi, Nach Yomi, etc.\n *\n * `@hebcal/core` itself contains no learning schedules — they are provided\n * by the {@link https://github.com/hebcal/hebcal-learning @hebcal/learning}\n * package, which calls {@link DailyLearning.addCalendar} on import. After\n * `@hebcal/learning` is loaded, `calendar()` will emit\n * learning events when the corresponding `options.dailyLearning` flag is set.\n *\n * @example\n * import '@hebcal/learning';\n * import {DailyLearning, HDate} from '@hebcal/core';\n *\n * const ev = DailyLearning.lookup('dafYomi', new HDate(), false);\n * console.log(ev?.render('en')); // e.g. 'Daf Yomi: Berakhot 2'\n */\nexport class DailyLearning {\n /**\n * Registers a new learning calendar.\n *\n * The provided function is called whenever a caller asks for an event\n * from this calendar; if no learning occurs that day (e.g. the date is\n * before the cycle's start) it should return `null`.\n * @example\n * DailyLearning.addCalendar(\n * 'myCalendar',\n * (hd, il) => new Event(hd, 'Today\\'s learning', 0),\n * new HDate(1, 'Tishrei', 5780),\n * );\n * @param name case insensitive\n * @param calendar a function that returns an `Event` or `null`\n * @param startDate the first date for which this calendar is valid\n */\n static addCalendar(\n name: string,\n calendar: (hd: HDate, il: boolean) => Event | null,\n startDate?: HDate\n ) {\n if (typeof calendar !== 'function') {\n throw new TypeError(`Invalid calendar function: ${calendar}`);\n }\n cals.set(name.toLowerCase(), {\n fn: calendar,\n startDate: startDate,\n });\n }\n\n /**\n * Returns the learning event for the given date from the named calendar,\n * or `null` if there is no learning that day (or the named calendar is\n * not registered).\n * @example\n * import '@hebcal/learning';\n * import {DailyLearning, HDate, months} from '@hebcal/core';\n * DailyLearning.lookup('dafYomi', new HDate(15, months.CHESHVAN, 5784), false);\n * @param name case insensitive\n * @param hd Hebrew Date\n * @param il true for Israel, false for Diaspora\n */\n static lookup(name: string, hd: HDate, il: boolean): Event | null {\n const cal = cals.get(name.toLowerCase());\n if (typeof cal === 'object') {\n return cal.fn(hd, il);\n }\n return null;\n }\n\n /**\n * Returns the first Hebrew date for which the named learning calendar\n * is valid (as registered by {@link addCalendar}), or `undefined` if the\n * calendar was not registered with a start date or is not registered at all.\n * @param name case insensitive\n */\n static getStartDate(name: string): HDate | undefined {\n const cal = cals.get(name.toLowerCase());\n if (typeof cal === 'object') {\n return cal.startDate;\n }\n return undefined;\n }\n\n /**\n * Returns `true` if a learning calendar with the given name has been\n * registered via {@link addCalendar}.\n * @param name case insensitive\n */\n static has(name: string): boolean {\n return cals.has(name.toLowerCase());\n }\n\n /**\n * Returns the (lower-cased) names of all currently-registered learning\n * calendars.\n */\n static getCalendars(): string[] {\n return Array.from(cals.keys());\n }\n}\n"],"names":[],"mappings":";AAOA,MAAM,IAAI,GAAG,IAAI,GAAG,EAA4B;AAEhD;;;;;;;;;;;;;;;;AAgBG;MACU,aAAa,CAAA;AACxB;;;;;;;;;;;;;;;AAeG;AACH,IAAA,OAAO,WAAW,CAChB,IAAY,EACZ,QAAkD,EAClD,SAAiB,EAAA;AAEjB,QAAA,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;AAClC,YAAA,MAAM,IAAI,SAAS,CAAC,8BAA8B,QAAQ,CAAA,CAAE,CAAC;QAC/D;AACA,QAAA,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE;AAC3B,YAAA,EAAE,EAAE,QAAQ;AACZ,YAAA,SAAS,EAAE,SAAS;AACrB,SAAA,CAAC;IACJ;AAEA;;;;;;;;;;;AAWG;AACH,IAAA,OAAO,MAAM,CAAC,IAAY,EAAE,EAAS,EAAE,EAAW,EAAA;QAChD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;AACxC,QAAA,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;YAC3B,OAAO,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;QACvB;AACA,QAAA,OAAO,IAAI;IACb;AAEA;;;;;AAKG;IACH,OAAO,YAAY,CAAC,IAAY,EAAA;QAC9B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;AACxC,QAAA,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;YAC3B,OAAO,GAAG,CAAC,SAAS;QACtB;AACA,QAAA,OAAO,SAAS;IAClB;AAEA;;;;AAIG;IACH,OAAO,GAAG,CAAC,IAAY,EAAA;QACrB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;IACrC;AAEA;;;AAGG;AACH,IAAA,OAAO,YAAY,GAAA;QACjB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IAChC;AACD;;;;"}
1
+ {"version":3,"file":"DailyLearning.js","sources":["../../../src/DailyLearning.ts"],"sourcesContent":["import {HDate} from '@hebcal/hdate';\nimport {Event} from './event.js';\n\ntype LearningCalendar = {\n fn: (hd: HDate, il: boolean) => Event | null;\n startDate?: HDate;\n};\nconst cals = new Map<string, LearningCalendar>();\n\n/**\n * Plug-in registry for daily learning calendars such as Daf Yomi (Bavli),\n * Yerushalmi Yomi, Mishna Yomi, Nach Yomi, etc.\n *\n * `@hebcal/core` itself contains no learning schedules — they are provided\n * by the {@link https://github.com/hebcal/hebcal-learning @hebcal/learning}\n * package, which calls {@link DailyLearning.addCalendar} on import. After\n * `@hebcal/learning` is loaded, `calendar()` will emit\n * learning events when the corresponding `options.dailyLearning` flag is set.\n *\n * @example\n * import '@hebcal/learning';\n * import {DailyLearning, HDate} from '@hebcal/core';\n *\n * const ev = DailyLearning.lookup('dafYomi', new HDate(), false);\n * console.log(ev?.render('en')); // e.g. 'Daf Yomi: Berakhot 2'\n */\nexport class DailyLearning {\n /**\n * Registers a new learning calendar.\n *\n * The provided function is called whenever a caller asks for an event\n * from this calendar; if no learning occurs that day (e.g. the date is\n * before the cycle's start) it should return `null`.\n * @example\n * DailyLearning.addCalendar(\n * 'myCalendar',\n * (hd, il) => new Event(hd, 'Today\\'s learning', 0),\n * new HDate(1, 'Tishrei', 5780),\n * );\n * @param name case insensitive\n * @param calendar a function that returns an `Event` or `null`\n * @param startDate the first date for which this calendar is valid\n */\n static addCalendar(\n name: string,\n calendar: (hd: HDate, il: boolean) => Event | null,\n startDate?: HDate\n ) {\n if (typeof calendar !== 'function') {\n throw new TypeError(`Invalid calendar function: ${calendar}`);\n }\n cals.set(name.toLowerCase(), {\n fn: calendar,\n startDate: startDate,\n });\n }\n\n /**\n * Returns the learning event for the given date from the named calendar,\n * or `null` if there is no learning that day (or the named calendar is\n * not registered).\n * @example\n * import '@hebcal/learning';\n * import {DailyLearning, HDate, months} from '@hebcal/core';\n * DailyLearning.lookup('dafYomi', new HDate(15, months.CHESHVAN, 5784), false);\n * @param name case insensitive\n * @param hd Hebrew Date\n * @param il true for Israel, false for Diaspora\n */\n static lookup(name: string, hd: HDate, il: boolean): Event | null {\n const cal = cals.get(name.toLowerCase());\n if (typeof cal === 'object') {\n return cal.fn(hd, il);\n }\n return null;\n }\n\n /**\n * Returns the first Hebrew date for which the named learning calendar\n * is valid (as registered by {@link addCalendar}), or `undefined` if the\n * calendar was not registered with a start date or is not registered at all.\n * @param name case insensitive\n */\n static getStartDate(name: string): HDate | undefined {\n const cal = cals.get(name.toLowerCase());\n if (typeof cal === 'object') {\n return cal.startDate;\n }\n return undefined;\n }\n\n /**\n * Returns `true` if a learning calendar with the given name has been\n * registered via {@link addCalendar}.\n * @param name case insensitive\n */\n static has(name: string): boolean {\n return cals.has(name.toLowerCase());\n }\n\n /**\n * Returns the (lower-cased) names of all currently-registered learning\n * calendars.\n */\n static getCalendars(): string[] {\n return Array.from(cals.keys());\n }\n}\n"],"names":[],"mappings":";AAOA,MAAM,IAAI,GAAG,IAAI,GAAG,EAA4B;AAEhD;;;;;;;;;;;;;;;;AAgBG;MACU,aAAa,CAAA;AACxB;;;;;;;;;;;;;;;AAeG;AACH,IAAA,OAAO,WAAW,CAChB,IAAY,EACZ,QAAkD,EAClD,SAAiB,EAAA;AAEjB,QAAA,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;AAClC,YAAA,MAAM,IAAI,SAAS,CAAC,8BAA8B,QAAQ,CAAA,CAAE,CAAC;QAC/D;AACA,QAAA,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE;AAC3B,YAAA,EAAE,EAAE,QAAQ;AACZ,YAAA,SAAS,EAAE,SAAS;AACrB,SAAA,CAAC;IACJ;AAEA;;;;;;;;;;;AAWG;AACH,IAAA,OAAO,MAAM,CAAC,IAAY,EAAE,EAAS,EAAE,EAAW,EAAA;QAChD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;AACxC,QAAA,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;YAC3B,OAAO,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;QACvB;AACA,QAAA,OAAO,IAAI;IACb;AAEA;;;;;AAKG;IACH,OAAO,YAAY,CAAC,IAAY,EAAA;QAC9B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;AACxC,QAAA,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;YAC3B,OAAO,GAAG,CAAC,SAAS;QACtB;AACA,QAAA,OAAO,SAAS;IAClB;AAEA;;;;AAIG;IACH,OAAO,GAAG,CAAC,IAAY,EAAA;QACrB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;IACrC;AAEA;;;AAGG;AACH,IAAA,OAAO,YAAY,GAAA;QACjB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IAChC;AACD;;"}
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.9.3, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.11.0, distributed under GPLv2 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';
@@ -1 +1 @@
1
- {"version":3,"file":"HebrewDateEvent.js","sources":["../../../src/HebrewDateEvent.ts"],"sourcesContent":["import {HDate, gematriya, months, Locale} from '@hebcal/hdate';\nimport {Event, flags} from './event.js';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\n\n/** Daily Hebrew date (\"11th of Sivan, 5780\") */\nexport class HebrewDateEvent extends Event {\n /**\n * @param date\n */\n constructor(date: HDate) {\n super(date, date.toString(), flags.HEBREW_DATE);\n }\n /**\n * @param [locale] Optional locale name (defaults to empty locale)\n * @example\n * import {HDate, HebrewDateEvent, months} from '@hebcal/core';\n *\n * const hd = new HDate(15, months.CHESHVAN, 5769);\n * const ev = new HebrewDateEvent(hd);\n * console.log(ev.render('en')); // '15th of Cheshvan, 5769'\n * console.log(ev.render('he')); // 'ט״ו חֶשְׁוָן תשס״ט'\n */\n render(locale?: string): string {\n const locale1 = locale?.toLowerCase();\n const locale0 = locale1 ?? 'en';\n const hd = this.getDate();\n switch (locale0) {\n case 'h':\n case 'he':\n return hd.renderGematriya(false);\n case 'he-x-nonikud':\n return hd.renderGematriya(true);\n default:\n return hd.render(locale0, true);\n }\n }\n /**\n * @private\n * @param locale\n */\n private renderBriefHebrew(locale: string): string {\n const hd = this.getDate();\n const dd = hd.getDate();\n const mm = Locale.gettext(hd.getMonthName(), locale);\n return gematriya(dd) + ' ' + mm;\n }\n /**\n * @param [locale] Optional locale name (defaults to empty locale)\n * @example\n * import {HDate, HebrewDateEvent, months} from '@hebcal/core';\n *\n * const hd = new HDate(15, months.CHESHVAN, 5769);\n * const ev = new HebrewDateEvent(hd);\n * console.log(ev.renderBrief()); // '15th of Cheshvan'\n * console.log(ev.renderBrief('he')); // 'ט״ו חֶשְׁוָן'\n */\n renderBrief(locale?: string): string {\n const locale1 = locale?.toLowerCase();\n const locale0 = locale1 ?? 'en';\n const hd = this.getDate();\n if (hd.getMonth() === months.TISHREI && hd.getDate() === 1) {\n return this.render(locale0);\n }\n switch (locale0) {\n case 'h':\n case 'he':\n case 'he-x-nonikud':\n return this.renderBriefHebrew(locale0);\n default:\n return hd.render(locale0, false);\n }\n }\n}\n"],"names":[],"mappings":";;;;;AAIA;AACM,MAAO,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EAAE,KAAK,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE;AAC1D,YAAA,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;QAC7B;QACA,QAAQ,OAAO;AACb,YAAA,KAAK,GAAG;AACR,YAAA,KAAK,IAAI;AACT,YAAA,KAAK,cAAc;AACjB,gBAAA,OAAO,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC;AACxC,YAAA;gBACE,OAAO,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC;;IAEtC;AACD;;;;"}
1
+ {"version":3,"file":"HebrewDateEvent.js","sources":["../../../src/HebrewDateEvent.ts"],"sourcesContent":["import {HDate, gematriya, months, Locale} from '@hebcal/hdate';\nimport {Event, flags} from './event.js';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\n\n/** Daily Hebrew date (\"11th of Sivan, 5780\") */\nexport class HebrewDateEvent extends Event {\n /**\n * @param date\n */\n constructor(date: HDate) {\n super(date, date.toString(), flags.HEBREW_DATE);\n }\n /**\n * @param [locale] Optional locale name (defaults to empty locale)\n * @example\n * import {HDate, HebrewDateEvent, months} from '@hebcal/core';\n *\n * const hd = new HDate(15, months.CHESHVAN, 5769);\n * const ev = new HebrewDateEvent(hd);\n * console.log(ev.render('en')); // '15th of Cheshvan, 5769'\n * console.log(ev.render('he')); // 'ט״ו חֶשְׁוָן תשס״ט'\n */\n render(locale?: string): string {\n const locale1 = locale?.toLowerCase();\n const locale0 = locale1 ?? 'en';\n const hd = this.getDate();\n switch (locale0) {\n case 'h':\n case 'he':\n return hd.renderGematriya(false);\n case 'he-x-nonikud':\n return hd.renderGematriya(true);\n default:\n return hd.render(locale0, true);\n }\n }\n /**\n * @private\n * @param locale\n */\n private renderBriefHebrew(locale: string): string {\n const hd = this.getDate();\n const dd = hd.getDate();\n const mm = Locale.gettext(hd.getMonthName(), locale);\n return gematriya(dd) + ' ' + mm;\n }\n /**\n * @param [locale] Optional locale name (defaults to empty locale)\n * @example\n * import {HDate, HebrewDateEvent, months} from '@hebcal/core';\n *\n * const hd = new HDate(15, months.CHESHVAN, 5769);\n * const ev = new HebrewDateEvent(hd);\n * console.log(ev.renderBrief()); // '15th of Cheshvan'\n * console.log(ev.renderBrief('he')); // 'ט״ו חֶשְׁוָן'\n */\n renderBrief(locale?: string): string {\n const locale1 = locale?.toLowerCase();\n const locale0 = locale1 ?? 'en';\n const hd = this.getDate();\n if (hd.getMonth() === months.TISHREI && hd.getDate() === 1) {\n return this.render(locale0);\n }\n switch (locale0) {\n case 'h':\n case 'he':\n case 'he-x-nonikud':\n return this.renderBriefHebrew(locale0);\n default:\n return hd.render(locale0, false);\n }\n }\n}\n"],"names":[],"mappings":";;;;;AAIA;AACM,MAAO,eAAgB,SAAQ,KAAK,CAAA;AACxC;;AAEG;AACH,IAAA,WAAA,CAAY,IAAW,EAAA;AACrB,QAAA,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC,WAAW,CAAC;IACjD;AACA;;;;;;;;;AASG;AACH,IAAA,MAAM,CAAC,MAAe,EAAA;AACpB,QAAA,MAAM,OAAO,GAAG,MAAM,EAAE,WAAW,EAAE;AACrC,QAAA,MAAM,OAAO,GAAG,OAAO,IAAI,IAAI;AAC/B,QAAA,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE;QACzB,QAAQ,OAAO;AACb,YAAA,KAAK,GAAG;AACR,YAAA,KAAK,IAAI;AACP,gBAAA,OAAO,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC;AAClC,YAAA,KAAK,cAAc;AACjB,gBAAA,OAAO,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC;AACjC,YAAA;gBACE,OAAO,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC;;IAErC;AACA;;;AAGG;AACK,IAAA,iBAAiB,CAAC,MAAc,EAAA;AACtC,QAAA,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE;AACzB,QAAA,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE;AACvB,QAAA,MAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,EAAE,MAAM,CAAC;QACpD,OAAO,SAAS,CAAC,EAAE,CAAC,GAAG,GAAG,GAAG,EAAE;IACjC;AACA;;;;;;;;;AASG;AACH,IAAA,WAAW,CAAC,MAAe,EAAA;AACzB,QAAA,MAAM,OAAO,GAAG,MAAM,EAAE,WAAW,EAAE;AACrC,QAAA,MAAM,OAAO,GAAG,OAAO,IAAI,IAAI;AAC/B,QAAA,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE;AACzB,QAAA,IAAI,EAAE,CAAC,QAAQ,EAAE,KAAK,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE;AAC1D,YAAA,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;QAC7B;QACA,QAAQ,OAAO;AACb,YAAA,KAAK,GAAG;AACR,YAAA,KAAK,IAAI;AACT,YAAA,KAAK,cAAc;AACjB,gBAAA,OAAO,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC;AACxC,YAAA;gBACE,OAAO,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC;;IAEtC;AACD;;"}
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.9.3, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.11.0, distributed under GPLv2 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';
@@ -74,7 +74,7 @@ class HolidayEvent extends Event {
74
74
  urlFriendly(this.basename()) +
75
75
  '-' +
76
76
  this.urlDateSuffix();
77
- return this.getFlags() & flags.IL_ONLY ? url + '?i=on' : url;
77
+ return this.hasFlag('IL_ONLY') ? url + '?i=on' : url;
78
78
  }
79
79
  /**
80
80
  * The date portion of {@link url}. For most holidays this is just the
@@ -88,7 +88,7 @@ class HolidayEvent extends Event {
88
88
  if (this.emoji) {
89
89
  return this.emoji;
90
90
  }
91
- if (this.getFlags() & flags.SPECIAL_SHABBAT) {
91
+ if (this.hasFlag('SPECIAL_SHABBAT')) {
92
92
  return '🕍';
93
93
  }
94
94
  return '✡️';
@@ -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 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]`.\n */\n url(): string | undefined {\n const year = this.greg().getFullYear();\n if (year < 100 || year > 2999) {\n return undefined;\n }\n const url =\n 'https://www.hebcal.com/holidays/' +\n urlFriendly(this.basename()) +\n '-' +\n this.urlDateSuffix();\n return this.getFlags() & flags.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 const year = this.greg().getFullYear();\n return String(year);\n }\n\n getEmoji(): string {\n if (this.emoji) {\n return this.emoji;\n }\n if (this.getFlags() & flags.SPECIAL_SHABBAT) {\n return '🕍';\n }\n return '✡️';\n }\n\n 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 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 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 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 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 render(locale?: string): string {\n return Locale.gettext('Rosh Hashana', locale) + ' ' + this.hyear;\n }\n\n 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 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 basename(): string {\n return this.getDesc();\n }\n\n 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,IA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+ {"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 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]`.\n */\n url(): string | undefined {\n const year = this.greg().getFullYear();\n if (year < 100 || year > 2999) {\n return undefined;\n }\n const url =\n 'https://www.hebcal.com/holidays/' +\n urlFriendly(this.basename()) +\n '-' +\n 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 const year = this.greg().getFullYear();\n return String(year);\n }\n\n 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 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 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 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 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 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 render(locale?: string): string {\n return Locale.gettext('Rosh Hashana', locale) + ' ' + this.hyear;\n }\n\n 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 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 basename(): string {\n return this.getDesc();\n }\n\n 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;IACH,QAAQ,GAAA;QACN,OAAO,IAAI,CAAC,OAAO;AA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M,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,KAAK;IAClE;IAEA,QAAQ,GAAA;AACN,QAAA,OAAO,MAAM;IACf;AACD;AAED,MAAM,cAAc,GAAG,cAAc;AAErC;AACM,MAAO,gBAAiB,SAAQ,YAAY,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;AACH,IAAA,MAAM,CAAC,MAAe,EAAA;AACpB,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,MAAM,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC,GAAG,GAAG,GAAG,UAAU;IAClE;IAEA,QAAQ,GAAA;AACN,QAAA,OAAO,IAAI,CAAC,OAAO,EAAE;IACvB;IAEA,QAAQ,GAAA;AACN,QAAA,OAAO,IAAI,CAAC,KAAK,IAAI,IAAI;IAC3B;AACD;;"}
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.9.3, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.11.0, distributed under GPLv2 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 +1 @@
1
- {"version":3,"file":"MevarchimChodeshEvent.js","sources":["../../../src/MevarchimChodeshEvent.ts"],"sourcesContent":["import {HDate, Locale, months} from '@hebcal/hdate';\nimport {Event, flags} from './event.js';\nimport {Molad} from './molad.js';\nimport {smartApostrophe} from './string.js';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\n\nconst mevarchimChodeshStr = 'Shabbat Mevarchim Chodesh';\n\n/** Represents Mevarchim haChodesh, the announcement of the new month */\nexport class MevarchimChodeshEvent extends Event {\n readonly monthName: string;\n /**\n * Constructs Mevarchim haChodesh event\n * @param date Hebrew date event occurs\n * @param monthName Hebrew month name (not translated)\n * @param memo text for the event memo. When falsy, a memo announcing the\n * molad of the upcoming month is generated automatically\n * @param locale Optional locale name\n */\n constructor(date: HDate, monthName: string, memo: string, locale?: string) {\n super(date, `${mevarchimChodeshStr} ${monthName}`, flags.SHABBAT_MEVARCHIM);\n this.monthName = Locale.gettext(monthName, locale);\n if (memo) {\n this.memo = memo;\n } else {\n const hyear = date.getFullYear();\n const hmonth = date.getMonth();\n const monNext =\n hmonth === HDate.monthsInYear(hyear) ? months.NISAN : hmonth + 1;\n const molad = new Molad(hyear, monNext);\n this.memo = molad.render('en', {hour12: false});\n }\n }\n\n basename(): string {\n return this.getDesc();\n }\n /**\n * Returns (translated) description of this event\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n const monthName0 = Locale.gettext(this.monthName, locale);\n const monthName = smartApostrophe(monthName0);\n return Locale.gettext(mevarchimChodeshStr, locale) + ' ' + monthName;\n }\n /**\n * Returns (translated) description of this event\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n renderBrief(locale?: string): string {\n const str = this.render(locale);\n const space = str.indexOf(' ');\n return str.substring(space + 1);\n }\n}\n"],"names":[],"mappings":";;;;;;;AAMA,MAAM,mBAAmB,GAAG,2BAA2B;AAEvD;AACM,MAAO,qBAAsB,SAAQ,KAAK,CAAA;AACrC,IAAA,SAAS;AAClB;;;;;;;AAOG;AACH,IAAA,WAAA,CAAY,IAAW,EAAE,SAAiB,EAAE,IAAY,EAAE,MAAe,EAAA;AACvE,QAAA,KAA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,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC;IACjC;AACD;;;;"}
1
+ {"version":3,"file":"MevarchimChodeshEvent.js","sources":["../../../src/MevarchimChodeshEvent.ts"],"sourcesContent":["import {HDate, Locale, months} from '@hebcal/hdate';\nimport {Event, flags} from './event.js';\nimport {Molad} from './molad.js';\nimport {smartApostrophe} from './string.js';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\n\nconst mevarchimChodeshStr = 'Shabbat Mevarchim Chodesh';\n\n/** Represents Mevarchim haChodesh, the announcement of the new month */\nexport class MevarchimChodeshEvent extends Event {\n readonly monthName: string;\n /**\n * Constructs Mevarchim haChodesh event\n * @param date Hebrew date event occurs\n * @param monthName Hebrew month name (not translated)\n * @param memo text for the event memo. When falsy, a memo announcing the\n * molad of the upcoming month is generated automatically\n * @param locale Optional locale name\n */\n constructor(date: HDate, monthName: string, memo: string, locale?: string) {\n super(date, `${mevarchimChodeshStr} ${monthName}`, flags.SHABBAT_MEVARCHIM);\n this.monthName = Locale.gettext(monthName, locale);\n if (memo) {\n this.memo = memo;\n } else {\n const hyear = date.getFullYear();\n const hmonth = date.getMonth();\n const monNext =\n hmonth === HDate.monthsInYear(hyear) ? months.NISAN : hmonth + 1;\n const molad = new Molad(hyear, monNext);\n this.memo = molad.render('en', {hour12: false});\n }\n }\n\n basename(): string {\n return this.getDesc();\n }\n /**\n * Returns (translated) description of this event\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n const monthName0 = Locale.gettext(this.monthName, locale);\n const monthName = smartApostrophe(monthName0);\n return Locale.gettext(mevarchimChodeshStr, locale) + ' ' + monthName;\n }\n /**\n * Returns (translated) description of this event\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n renderBrief(locale?: string): string {\n const str = this.render(locale);\n const space = str.indexOf(' ');\n return str.substring(space + 1);\n }\n}\n"],"names":[],"mappings":";;;;;;;AAMA,MAAM,mBAAmB,GAAG,2BAA2B;AAEvD;AACM,MAAO,qBAAs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;QACzB,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;QAC/B,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC;QAC9B,OAAO,GAAG,CAAC,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC;IACjC;AACD;;"}
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.9.3, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.11.0, distributed under GPLv2 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';
@@ -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 render(locale?: string): string {\n return renderParshaName(this.p.parsha, locale);\n }\n\n basename(): string {\n return this.p.parsha.join('-');\n }\n\n 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 =\n '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,CA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H,aAAa,GAAA;QACX,MAAM,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAC1C,OAAO,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,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 render(locale?: string): string {\n return renderParshaName(this.p.parsha, locale);\n }\n\n basename(): string {\n return this.p.parsha.join('-');\n }\n\n 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 =\n '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,KAA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AAC,MAAM;IACtB;AACD;;"}
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.9.3, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.11.0, distributed under GPLv2 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 +1 @@
1
- {"version":3,"file":"TimedEvent.js","sources":["../../../src/TimedEvent.ts"],"sourcesContent":["import {HDate, Locale} from '@hebcal/hdate';\nimport {CalOptions} from './CalOptions.js';\nimport {Location} from './location.js';\nimport {Event} from './event.js';\nimport {reformatTimeStr} from './reformatTimeStr.js';\nimport {Zmanim} from './zmanim.js';\nimport {holidayDesc as hdesc} from './staticHolidays.js';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\n\nconst HAVDALAH = hdesc.HAVDALAH;\nconst CANDLE_LIGHTING = hdesc.CANDLE_LIGHTING;\n\n/**\n * Base class for events that have an associated wall-clock time and\n * geographic location — for example, candle lighting, havdalah, and\n * fast begin/end times.\n *\n * Stores both a `Date` (`eventTime`) and pre-formatted 24-hour\n * (`eventTimeStr`) and locale-aware (`fmtTime`) strings. May reference a\n * \"linked\" event such as the holiday whose candle-lighting time this\n * represents.\n */\nexport class TimedEvent extends Event {\n /** The exact moment of the event, rounded to the nearest minute */\n readonly eventTime: Date;\n /** Geographic location used to compute `eventTime` */\n readonly location: Location;\n /** 24-hour formatted time string in the location's timezone (e.g. `\"19:42\"`) */\n readonly eventTimeStr: string;\n /** Locale-aware formatted time string (e.g. `\"7:42pm\"` in US locale) */\n readonly fmtTime: string;\n /** Optional event this time is associated with (e.g. the Yom Tov being lit for) */\n readonly linkedEvent?: Event;\n /**\n * Optional length of the event in minutes. Not computed or validated by\n * this class; it's a plain count of minutes for downstream renderers\n * (e.g. `@hebcal/icalendar`) to add to the event's start wall-clock time\n * when producing a non-zero-duration `DTEND`. Undefined means no\n * duration was specified.\n */\n duration?: number;\n /**\n * Normally created by {@link calendar} rather than directly.\n * @param date Hebrew date the event occurs\n * @param desc Description (not translated)\n * @param mask optional holiday flags\n * @param eventTime the exact moment of the event\n * @param location geographic location used to format the time\n * @param linkedEvent optional event this time is associated with\n * @param options optional; `locale` and `hour12` affect {@link fmtTime}\n */\n constructor(\n date: HDate,\n desc: string,\n mask: number,\n eventTime: Date,\n location: Location,\n linkedEvent?: Event,\n options?: CalOptions\n ) {\n super(date, desc, mask);\n this.eventTime = Zmanim.roundTime(eventTime);\n this.location = location;\n const timeFormat = location.getTimeFormatter();\n this.eventTimeStr = Zmanim.formatTime(this.eventTime, timeFormat);\n const opts = {...options, location};\n this.fmtTime = reformatTimeStr(this.eventTimeStr, 'pm', opts);\n if (linkedEvent !== undefined) {\n this.linkedEvent = linkedEvent;\n }\n }\n /**\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n return Locale.gettext(this.getDesc(), locale) + ': ' + this.fmtTime;\n }\n /**\n * Returns translation of \"Candle lighting\" without the time.\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n renderBrief(locale?: string): string {\n return Locale.gettext(this.getDesc(), locale);\n }\n\n getCategories(): string[] {\n const desc = this.getDesc();\n switch (desc) {\n // LIGHT_CANDLES or LIGHT_CANDLES_TZEIS\n case CANDLE_LIGHTING:\n return ['candles'];\n // YOM_TOV_ENDS\n case HAVDALAH:\n return ['havdalah'];\n // flags.MINOR_FAST or flags.MAJOR_FAST\n case hdesc.FAST_BEGINS:\n case hdesc.FAST_ENDS:\n return ['zmanim', 'fast'];\n case hdesc.SOF_ZMAN_ACHILAT_CHAMETZ:\n return ['zmanim', 'achilasChametz'];\n case hdesc.BIUR_CHAMETZ:\n return ['zmanim', 'biurChametz'];\n }\n /* NOTREACHED */\n return ['unknown'];\n }\n}\n\n/**\n * Candle-lighting event for the eve of Shabbat or a Yom Tov.\n *\n * Generated by {@link calendar} when `options.candlelighting`\n * is `true` and `options.location` is provided. By default candle lighting\n * occurs 18 minutes before sundown in the Diaspora and 20 minutes before\n * sundown in Israel (40 minutes in Jerusalem; 30 minutes in Haifa and\n * Zikhron Ya'akov), configurable via `options.candleLightingMins`.\n */\nexport class CandleLightingEvent extends TimedEvent {\n constructor(\n date: HDate,\n mask: number,\n eventTime: Date,\n location: Location,\n linkedEvent?: Event,\n options?: CalOptions\n ) {\n super(date, CANDLE_LIGHTING, mask, eventTime, location, linkedEvent, options);\n }\n\n getEmoji(): string {\n return '🕯️';\n }\n}\n\n/**\n * Havdalah event marking the end of Shabbat or a Yom Tov.\n *\n * Generated by {@link calendar} when `options.candlelighting`\n * is `true` and `options.location` is provided. By default Havdalah is\n * calculated by *tzeit hakochavim* (8.5° solar depression); pass\n * `options.havdalahMins` to use a fixed minute offset instead, or\n * `options.havdalahDeg` to use a different degree.\n */\nexport class HavdalahEvent extends TimedEvent {\n private readonly havdalahMins?: number;\n constructor(\n date: HDate,\n mask: number,\n eventTime: Date,\n location: Location,\n havdalahMins?: number,\n linkedEvent?: Event,\n options?: CalOptions\n ) {\n super(date, HAVDALAH, mask, eventTime, location, linkedEvent, options);\n if (havdalahMins) {\n this.havdalahMins = havdalahMins;\n }\n }\n /**\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n return this.renderBrief(locale) + ': ' + this.fmtTime;\n }\n /**\n * Returns translation of \"Havdalah\" without the time.\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n renderBrief(locale?: string): string {\n let str = Locale.gettext(this.getDesc(), locale);\n if (this.havdalahMins) {\n const min = Locale.gettext('min', locale);\n str += ` (${this.havdalahMins} ${min})`;\n }\n return str;\n }\n\n getEmoji(): string {\n return '✨';\n }\n}\n"],"names":["hdesc"],"mappings":";;;;;;;;AASA,MAAM,QAAQ,GAAGA,WAAK,CAAC,QAAQ;AAC/B,MAAM,eAAe,GAAGA,WAAK,CAAC,eAAe;AAE7C;;;;;;;;;AASG;AACG,MAAO,UA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IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,OAAO;IACvD;AACA;;;AAGG;AACH,IAAA,WAAW,CAAC,MAAe,EAAA;AACzB,QAAA,IAAI,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,CAAC;AAChD,QAAA,IAAI,IAAI,CAAC,YAAY,EAAE;YACrB,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC;YACzC,GAAG,IAAI,KAAK,IAAI,CAAC,YAAY,CAAA,CAAA,EAAI,GAAG,GAAG;QACzC;AACA,QAAA,OAAO,GAAG;IACZ;IAEA,QAAQ,GAAA;AACN,QAAA,OAAO,GAAG;IACZ;AACD;;;;"}
1
+ {"version":3,"file":"TimedEvent.js","sources":["../../../src/TimedEvent.ts"],"sourcesContent":["import {HDate, Locale} from '@hebcal/hdate';\nimport {CalOptions} from './CalOptions.js';\nimport {Location} from './location.js';\nimport {Event} from './event.js';\nimport {reformatTimeStr} from './reformatTimeStr.js';\nimport {Zmanim} from './zmanim.js';\nimport {holidayDesc as hdesc} from './staticHolidays.js';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\n\nconst HAVDALAH = hdesc.HAVDALAH;\nconst CANDLE_LIGHTING = hdesc.CANDLE_LIGHTING;\n\n/**\n * Base class for events that have an associated wall-clock time and\n * geographic location — for example, candle lighting, havdalah, and\n * fast begin/end times.\n *\n * Stores both a `Date` (`eventTime`) and pre-formatted 24-hour\n * (`eventTimeStr`) and locale-aware (`fmtTime`) strings. May reference a\n * \"linked\" event such as the holiday whose candle-lighting time this\n * represents.\n */\nexport class TimedEvent extends Event {\n /** The exact moment of the event, rounded to the nearest minute */\n readonly eventTime: Date;\n /** Geographic location used to compute `eventTime` */\n readonly location: Location;\n /** 24-hour formatted time string in the location's timezone (e.g. `\"19:42\"`) */\n readonly eventTimeStr: string;\n /** Locale-aware formatted time string (e.g. `\"7:42pm\"` in US locale) */\n readonly fmtTime: string;\n /** Optional event this time is associated with (e.g. the Yom Tov being lit for) */\n readonly linkedEvent?: Event;\n /**\n * Optional length of the event in minutes. Not computed or validated by\n * this class; it's a plain count of minutes for downstream renderers\n * (e.g. `@hebcal/icalendar`) to add to the event's start wall-clock time\n * when producing a non-zero-duration `DTEND`. Undefined means no\n * duration was specified.\n */\n duration?: number;\n /**\n * Normally created by {@link calendar} rather than directly.\n * @param date Hebrew date the event occurs\n * @param desc Description (not translated)\n * @param mask optional holiday flags\n * @param eventTime the exact moment of the event\n * @param location geographic location used to format the time\n * @param linkedEvent optional event this time is associated with\n * @param options optional; `locale` and `hour12` affect {@link fmtTime}\n */\n constructor(\n date: HDate,\n desc: string,\n mask: number,\n eventTime: Date,\n location: Location,\n linkedEvent?: Event,\n options?: CalOptions\n ) {\n super(date, desc, mask);\n this.eventTime = Zmanim.roundTime(eventTime);\n this.location = location;\n const timeFormat = location.getTimeFormatter();\n this.eventTimeStr = Zmanim.formatTime(this.eventTime, timeFormat);\n const opts = {...options, location};\n this.fmtTime = reformatTimeStr(this.eventTimeStr, 'pm', opts);\n if (linkedEvent !== undefined) {\n this.linkedEvent = linkedEvent;\n }\n }\n /**\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n return Locale.gettext(this.getDesc(), locale) + ': ' + this.fmtTime;\n }\n /**\n * Returns translation of \"Candle lighting\" without the time.\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n renderBrief(locale?: string): string {\n return Locale.gettext(this.getDesc(), locale);\n }\n\n getCategories(): string[] {\n const desc = this.getDesc();\n switch (desc) {\n // LIGHT_CANDLES or LIGHT_CANDLES_TZEIS\n case CANDLE_LIGHTING:\n return ['candles'];\n // YOM_TOV_ENDS\n case HAVDALAH:\n return ['havdalah'];\n // flags.MINOR_FAST or flags.MAJOR_FAST\n case hdesc.FAST_BEGINS:\n case hdesc.FAST_ENDS:\n return ['zmanim', 'fast'];\n case hdesc.SOF_ZMAN_ACHILAT_CHAMETZ:\n return ['zmanim', 'achilasChametz'];\n case hdesc.BIUR_CHAMETZ:\n return ['zmanim', 'biurChametz'];\n }\n /* NOTREACHED */\n return ['unknown'];\n }\n}\n\n/**\n * Candle-lighting event for the eve of Shabbat or a Yom Tov.\n *\n * Generated by {@link calendar} when `options.candlelighting`\n * is `true` and `options.location` is provided. By default candle lighting\n * occurs 18 minutes before sundown in the Diaspora and 20 minutes before\n * sundown in Israel (40 minutes in Jerusalem; 30 minutes in Haifa and\n * Zikhron Ya'akov), configurable via `options.candleLightingMins`.\n */\nexport class CandleLightingEvent extends TimedEvent {\n constructor(\n date: HDate,\n mask: number,\n eventTime: Date,\n location: Location,\n linkedEvent?: Event,\n options?: CalOptions\n ) {\n super(date, CANDLE_LIGHTING, mask, eventTime, location, linkedEvent, options);\n }\n\n getEmoji(): string {\n return '🕯️';\n }\n}\n\n/**\n * Havdalah event marking the end of Shabbat or a Yom Tov.\n *\n * Generated by {@link calendar} when `options.candlelighting`\n * is `true` and `options.location` is provided. By default Havdalah is\n * calculated by *tzeit hakochavim* (8.5° solar depression); pass\n * `options.havdalahMins` to use a fixed minute offset instead, or\n * `options.havdalahDeg` to use a different degree.\n */\nexport class HavdalahEvent extends TimedEvent {\n private readonly havdalahMins?: number;\n constructor(\n date: HDate,\n mask: number,\n eventTime: Date,\n location: Location,\n havdalahMins?: number,\n linkedEvent?: Event,\n options?: CalOptions\n ) {\n super(date, HAVDALAH, mask, eventTime, location, linkedEvent, options);\n if (havdalahMins) {\n this.havdalahMins = havdalahMins;\n }\n }\n /**\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n return this.renderBrief(locale) + ': ' + this.fmtTime;\n }\n /**\n * Returns translation of \"Havdalah\" without the time.\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n renderBrief(locale?: string): string {\n let str = Locale.gettext(this.getDesc(), locale);\n if (this.havdalahMins) {\n const min = Locale.gettext('min', locale);\n str +=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,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,CAAC;QACtE,IAAI,YAAY,EAAE;AAChB,YAAA,IAAI,CAAC,YAAY,GAAG,YAAY;QAClC;IACF;AACA;;AAEG;AACH,IAAA,MAAM,CAAC,MAAe,EAAA;AACpB,QAAA,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,OAAO;IACvD;AACA;;;AAGG;AACH,IAAA,WAAW,CAAC,MAAe,EAAA;AACzB,QAAA,IAAI,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,CAAC;AAChD,QAAA,IAAI,IAAI,CAAC,YAAY,EAAE;YACrB,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC;YACzC,GAAG,IAAI,KAAK,IAAI,CAAC,YAAY,CAAA,CAAA,EAAI,GAAG,GAAG;QACzC;AACA,QAAA,OAAO,GAAG;IACZ;IAEA,QAAQ,GAAA;AACN,QAAA,OAAO,GAAG;IACZ;AACD;;"}
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.9.3, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.11.0, distributed under GPLv2 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 +1 @@
1
- {"version":3,"file":"YomKippurKatanEvent.js","sources":["../../../src/YomKippurKatanEvent.ts"],"sourcesContent":["import {HDate, Locale} from '@hebcal/hdate';\nimport {flags} from './event.js';\nimport {HolidayEvent} from './HolidayEvent.js';\nimport {smartApostrophe} from './string.js';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\n\nconst ykk = 'Yom Kippur Katan';\n\n/** YKK is minor day of atonement on the day preceeding each Rosh Chodesh */\nexport class YomKippurKatanEvent extends HolidayEvent {\n private readonly nextMonthName: string;\n /**\n * Normally created by {@link calendar} (via\n * `options.yomKippurKatan`) rather than directly.\n * @param date Hebrew date event occurs\n * @param nextMonthName name of the upcoming month\n */\n constructor(date: HDate, nextMonthName: string) {\n super(\n date,\n `${ykk} ${nextMonthName}`,\n flags.MINOR_FAST | flags.YOM_KIPPUR_KATAN\n );\n this.nextMonthName = nextMonthName;\n this.memo = `Minor Day of Atonement on the day preceeding Rosh Chodesh ${nextMonthName}`;\n }\n\n basename(): string {\n return this.getDesc();\n }\n /**\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n const monthName0 = Locale.gettext(this.nextMonthName, locale);\n const monthName = smartApostrophe(monthName0);\n return Locale.gettext(ykk, locale) + ' ' + monthName;\n }\n /**\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n renderBrief(locale?: string): string {\n return Locale.gettext(ykk, locale);\n }\n\n url(): string | undefined {\n return undefined;\n }\n}\n"],"names":[],"mappings":";;;;;;;AAMA,MAAM,GAAG,GAAG,kBAAkB;AAE9B;AACM,MAAO,mBAAoB,SAAQ,YAAY,CAAA;AAClC,IAAA,aAAa;AAC9B;;;;;AAKG;IACH,WAAA,CAAY,IAAW,EAAE,aAAqB,EAAA;AAC5C,QAAA,KAAK,CACH,IAAI,EACJ,CAAA,EAAG,GAAG,IAAI,aAAa,CAAA,CAAE,EACzB,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,gBAAgB,CAC1C;AACD,QAAA,IAAI,CAAC,aAAa,GAAG,aAAa;AAClC,QAAA,IAAI,CAAC,IAAI,GAAG,CAAA,0DAAA,EAA6D,aAAa,EAAE;IAC1F;IAEA,QAAQ,GAAA;AACN,QAAA,OAAO,IAAI,CAAC,OAAO,EAAE;IACvB;AACA;;AAEG;AACH,IAAA,MAAM,CAAC,MAAe,EAAA;AACpB,QAAA,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC;AAC7D,QAAA,MAAM,SAAS,GAAG,eAAe,CAAC,UAAU,CAAC;AAC7C,QAAA,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,GAAG,GAAG,SAAS;IACtD;AACA;;AAEG;AACH,IAAA,WAAW,CAAC,MAAe,EAAA;QACzB,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC;IACpC;IAEA,GAAG,GAAA;AACD,QAAA,OAAO,SAAS;IAClB;AACD;;;;"}
1
+ {"version":3,"file":"YomKippurKatanEvent.js","sources":["../../../src/YomKippurKatanEvent.ts"],"sourcesContent":["import {HDate, Locale} from '@hebcal/hdate';\nimport {flags} from './event.js';\nimport {HolidayEvent} from './HolidayEvent.js';\nimport {smartApostrophe} from './string.js';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\n\nconst ykk = 'Yom Kippur Katan';\n\n/** YKK is minor day of atonement on the day preceeding each Rosh Chodesh */\nexport class YomKippurKatanEvent extends HolidayEvent {\n private readonly nextMonthName: string;\n /**\n * Normally created by {@link calendar} (via\n * `options.yomKippurKatan`) rather than directly.\n * @param date Hebrew date event occurs\n * @param nextMonthName name of the upcoming month\n */\n constructor(date: HDate, nextMonthName: string) {\n super(\n date,\n `${ykk} ${nextMonthName}`,\n flags.MINOR_FAST | flags.YOM_KIPPUR_KATAN\n );\n this.nextMonthName = nextMonthName;\n this.memo = `Minor Day of Atonement on the day preceeding Rosh Chodesh ${nextMonthName}`;\n }\n\n basename(): string {\n return this.getDesc();\n }\n /**\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n const monthName0 = Locale.gettext(this.nextMonthName, locale);\n const monthName = smartApostrophe(monthName0);\n return Locale.gettext(ykk, locale) + ' ' + monthName;\n }\n /**\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n renderBrief(locale?: string): string {\n return Locale.gettext(ykk, locale);\n }\n\n url(): string | undefined {\n return undefined;\n }\n}\n"],"names":[],"mappings":";;;;;;;AAMA,MAAM,GAAG,GAAG,kBAAkB;AAE9B;AACM,MAAO,mBAAoB,SAAQ,YAAY,CAAA;AAClC,IAAA,aAAa;AAC9B;;;;;AAKG;IACH,WAAA,CAAY,IAAW,EAAE,aAAqB,EAAA;AAC5C,QAAA,KAAK,CACH,IAAI,EACJ,CAAA,EAAG,GAAG,IAAI,aAAa,CAAA,CAAE,EACzB,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,gBAAgB,CAC1C;AACD,QAAA,IAAI,CAAC,aAAa,GAAG,aAAa;AAClC,QAAA,IAAI,CAAC,IAAI,GAAG,CAAA,0DAAA,EAA6D,aAAa,EAAE;IAC1F;IAEA,QAAQ,GAAA;AACN,QAAA,OAAO,IAAI,CAAC,OAAO,EAAE;IACvB;AACA;;AAEG;AACH,IAAA,MAAM,CAAC,MAAe,EAAA;AACpB,QAAA,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC;AAC7D,QAAA,MAAM,SAAS,GAAG,eAAe,CAAC,UAAU,CAAC;AAC7C,QAAA,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,GAAG,GAAG,SAAS;IACtD;AACA;;AAEG;AACH,IAAA,WAAW,CAAC,MAAe,EAAA;QACzB,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC;IACpC;IAEA,GAAG,GAAA;AACD,QAAA,OAAO,SAAS;IAClB;AACD;;"}
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.9.3, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.11.0, distributed under GPLv2 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"] } } };
3
3
 
4
4
  export { poAshkenazi as default };
@@ -1 +1 @@
1
- {"version":3,"file":"ashkenazi.po.js","sources":["../../../src/ashkenazi.po.ts"],"sourcesContent":["export default {\"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\"]}}}"],"names":[],"mappings":";AAAA,kBAAe,EAAC,SAAS,EAAC,EAAC,cAAc,EAAC,6BAA6B,EAAC,UAAU,EAAC,gBAAgB,EAAC,EAAC,UAAU,EAAC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A0B,EAAC,CAAC,yBAAyB,CAAC,EAAC,kBAAkB,EAAC,CAAC,kBAAkB,CAAC,EAAC,eAAe,EAAC,CAAC,SAAS,CAAC,EAAC,eAAe,EAAC,CAAC,SAAS,CAAC,EAAC,gBAAgB,EAAC,CAAC,gBAAgB,CAAC,EAAC,gBAAgB,EAAC,CAAC,gBAAgB,CAAC,EAAC,eAAe,EAAC,CAAC,eAAe,CAAC,EAAC,QAAQ,EAAC,CAAC,QAAQ,CAAC,EAAC,kBAAkB,EAAC,CAAC,kBAAkB,CAAC,EAAC,kBAAkB,EAAC,CAAC,kBAAkB,CAAC,EAAC,EAAC,EAAC;;;;"}
1
+ {"version":3,"file":"ashkenazi.po.js","sources":["../../../src/ashkenazi.po.ts"],"sourcesContent":["export default {\"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\"]}}}"],"names":[],"mappings":";AAAA,kBAAe,EAAC,SAAS,EAAC,EAAC,cAAc,EAAC,6BAA6B,EAAC,UAAU,EAAC,gBAAgB,EAAC,EAAC,UAAU,EAAC,EAAC,EAAE,EAAC,EAAC,SAAS,EAAC,CAAC,SAAS,CAAC,EAAC,YAAY,EAAC,CAAC,YAAY,CAAC,EAAC,YAAY,EAAC,CAAC,YAAY,CAAC,EAAC,cAAc,EAAC,CAAC,cAAc,CAAC,EAAC,UAAU,EAAC,CAAC,UAAU,CAAC,EAAC,QAAQ,EAAC,CAAC,QAAQ,CAAC,EAAC,cAAc,EAAC,CAAC,cAAc,CAAC,EAAC,aAAa,EAAC,CAAC,aAAa,CAAC,EAAC,SAAS,EAAC,CAAC,SAAS,CAAC,EAAC,YAAY,EAAC,CAAC,YAAY,CAAC,EAAC,SAAS,EAAC,CAAC,SAAS,CAAC,EAAC,OAAO,EAAC,CAAC,OAAO,CAAC,EAAC,6BAA6B,EAAC,CAAC,6BAA6B,CAAC,EAAC,aAAa,EAAC,CAAC,aAAa,CAAC,E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AC,kBAAkB,CAAC,EAAC,UAAU,EAAC,CAAC,SAAS,CAAC,EAAC,eAAe,EAAC,CAAC,eAAe,CAAC,EAAC,2BAA2B,EAAC,CAAC,2BAA2B,CAAC,EAAC,gBAAgB,EAAC,CAAC,gBAAgB,CAAC,EAAC,eAAe,EAAC,CAAC,eAAe,CAAC,EAAC,iBAAiB,EAAC,CAAC,iBAAiB,CAAC,EAAC,iBAAiB,EAAC,CAAC,iBAAiB,CAAC,EAAC,qBAAqB,EAAC,CAAC,qBAAqB,CAAC,EAAC,gBAAgB,EAAC,CAAC,gBAAgB,CAAC,EAAC,YAAY,EAAC,CAAC,YAAY,CAAC,EAAC,oBAAoB,EAAC,CAAC,oBAAoB,CAAC,EAAC,SAAS,EAAC,CAAC,SAAS,CAAC,EAAC,wBAAwB,EAAC,CAAC,uBAAuB,CAAC,EAAC,oBAAoB,EAAC,CAAC,mBAAmB,CAAC,EAAC,8BAA8B,EAAC,CAAC,6BAA6B,CAAC,EAAC,8BAA8B,EAAC,CAAC,6BAA6B,CAAC,EAAC,0BAA0B,EAAC,CAAC,yBAAyB,CAAC,EAAC,0BAA0B,EAAC,CAAC,yBAAyB,CAAC,EAAC,kBAAkB,EAAC,CAAC,kBAAkB,CAAC,EAAC,eAAe,EAAC,CAAC,SAAS,CAAC,EAAC,eAAe,EAAC,CAAC,SAAS,CAAC,EAAC,gBAAgB,EAAC,CAAC,gBAAgB,CAAC,EAAC,gBAAgB,EAAC,CAAC,gBAAgB,CAAC,EAAC,eAAe,EAAC,CAAC,eAAe,CAAC,EAAC,QAAQ,EAAC,CAAC,QAAQ,CAAC,EAAC,kBAAkB,EAAC,CAAC,kBAAkB,CAAC,EAAC,kBAAkB,EAAC,CAAC,kBAAkB,CAAC,EAAC,EAAC,EAAC;;"}
@@ -79,13 +79,21 @@ import { Event } from './event.js';
79
79
  * They end when 3 medium-sized stars are observable in the night sky (sun is 7.083°
80
80
  * below the horizon in the evening) in the Diaspora, or 15 minutes after sunset in
81
81
  * Israel (Rabbi Deblitzky's practice). Override with:
82
+ * * `options.fastStartDeg` - degrees of solar depression for the start of a minor fast
83
+ * * `options.fastStartMins` - minutes before sunrise for the start of a minor fast
84
+ * (mutually exclusive with `options.fastStartDeg`)
82
85
  * * `options.fastEndDeg` - degrees of solar depression for the end of a minor fast
83
86
  * * `options.fastEndMins` - minutes after sunset for the end of a minor fast
84
87
  * (mutually exclusive with `options.fastEndDeg`)
85
88
  *
86
- * Tish'a B'Av is different: it begins at sunset on the previous day and always ends
87
- * at tzeit 6.45° (Rabbi Yechiel Michel Tucazinsky), ignoring `options.fastEndDeg`
88
- * and `options.fastEndMins`. When a minor fast falls on a Friday the end time is
89
+ * Tish'a B'Av is different: it always begins at sunset on the previous day, and
90
+ * by default ends at tzeit 6.45° (Rabbi Yechiel Michel Tucazinsky), ignoring the
91
+ * minor fast options above. Override its end with:
92
+ * * `options.tishaBavEndDeg` - degrees of solar depression for the end of Tish'a B'Av
93
+ * * `options.tishaBavEndMins` - minutes after sunset for the end of Tish'a B'Av
94
+ * (mutually exclusive with `options.tishaBavEndDeg`)
95
+ *
96
+ * When a minor fast falls on a Friday the end time is
89
97
  * suppressed, because Shabbat begins before nightfall.
90
98
  *
91
99
  * Two options also exist for generating an Event with the Hebrew date:
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.9.3, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.11.0, distributed under GPLv2 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';
@@ -96,13 +96,21 @@ import { holidayDesc } from './staticHolidays.js';
96
96
  * They end when 3 medium-sized stars are observable in the night sky (sun is 7.083°
97
97
  * below the horizon in the evening) in the Diaspora, or 15 minutes after sunset in
98
98
  * Israel (Rabbi Deblitzky's practice). Override with:
99
+ * * `options.fastStartDeg` - degrees of solar depression for the start of a minor fast
100
+ * * `options.fastStartMins` - minutes before sunrise for the start of a minor fast
101
+ * (mutually exclusive with `options.fastStartDeg`)
99
102
  * * `options.fastEndDeg` - degrees of solar depression for the end of a minor fast
100
103
  * * `options.fastEndMins` - minutes after sunset for the end of a minor fast
101
104
  * (mutually exclusive with `options.fastEndDeg`)
102
105
  *
103
- * Tish'a B'Av is different: it begins at sunset on the previous day and always ends
104
- * at tzeit 6.45° (Rabbi Yechiel Michel Tucazinsky), ignoring `options.fastEndDeg`
105
- * and `options.fastEndMins`. When a minor fast falls on a Friday the end time is
106
+ * Tish'a B'Av is different: it always begins at sunset on the previous day, and
107
+ * by default ends at tzeit 6.45° (Rabbi Yechiel Michel Tucazinsky), ignoring the
108
+ * minor fast options above. Override its end with:
109
+ * * `options.tishaBavEndDeg` - degrees of solar depression for the end of Tish'a B'Av
110
+ * * `options.tishaBavEndMins` - minutes after sunset for the end of Tish'a B'Av
111
+ * (mutually exclusive with `options.tishaBavEndDeg`)
112
+ *
113
+ * When a minor fast falls on a Friday the end time is
106
114
  * suppressed, because Shabbat begins before nightfall.
107
115
  *
108
116
  * Two options also exist for generating an Event with the Hebrew date:
@@ -323,6 +331,10 @@ const RECOGNIZED_OPTIONS = {
323
331
  havdalahDeg: 1,
324
332
  fastEndDeg: 1,
325
333
  fastEndMins: 1,
334
+ fastStartDeg: 1,
335
+ fastStartMins: 1,
336
+ tishaBavEndDeg: 1,
337
+ tishaBavEndMins: 1,
326
338
  sedrot: 1,
327
339
  il: 1,
328
340
  noMinorFast: 1,
@@ -411,6 +423,14 @@ function checkCandleOptions(options) {
411
423
  typeof options.fastEndMins === 'number') {
412
424
  throw new TypeError('options.fastEndDeg and options.fastEndMins are mutually exclusive');
413
425
  }
426
+ if (typeof options.fastStartDeg === 'number' &&
427
+ typeof options.fastStartMins === 'number') {
428
+ throw new TypeError('options.fastStartDeg and options.fastStartMins are mutually exclusive');
429
+ }
430
+ if (typeof options.tishaBavEndDeg === 'number' &&
431
+ typeof options.tishaBavEndMins === 'number') {
432
+ throw new TypeError('options.tishaBavEndDeg and options.tishaBavEndMins are mutually exclusive');
433
+ }
414
434
  const min0 = options.candleLightingMins;
415
435
  let min = typeof min0 === 'number' && !isNaN(min0) ? Math.trunc(min0) : 18;
416
436
  if (location.getIsrael() && Math.abs(min) === 18) {
@@ -432,6 +452,18 @@ function checkCandleOptions(options) {
432
452
  if (typeof options.fastEndMins === 'number') {
433
453
  options.fastEndMins = Math.trunc(Math.abs(options.fastEndMins));
434
454
  }
455
+ if (typeof options.fastStartDeg === 'number') {
456
+ options.fastStartDeg = Math.abs(options.fastStartDeg);
457
+ }
458
+ if (typeof options.fastStartMins === 'number') {
459
+ options.fastStartMins = Math.trunc(Math.abs(options.fastStartMins));
460
+ }
461
+ if (typeof options.tishaBavEndDeg === 'number') {
462
+ options.tishaBavEndDeg = Math.abs(options.tishaBavEndDeg);
463
+ }
464
+ if (typeof options.tishaBavEndMins === 'number') {
465
+ options.tishaBavEndMins = Math.trunc(Math.abs(options.tishaBavEndMins));
466
+ }
435
467
  }
436
468
  function overrideIsraelCandleMins(location) {
437
469
  const geoid = location.getGeoId();
@@ -535,7 +567,6 @@ function getMaskFromOptions(options) {
535
567
  }
536
568
  return mask;
537
569
  }
538
- const MASK_LIGHT_CANDLES = LIGHT_CANDLES | LIGHT_CANDLES_TZEIS | CHANUKAH_CANDLES | YOM_TOV_ENDS;
539
570
  const defaultLocation = new Location(0, 0, false, 'UTC');
540
571
  /**
541
572
  * @private
@@ -589,10 +620,12 @@ function appendHolidayAndRelated(candlesEv, events, ev, options, isFriday, isSat
589
620
  if (!ev.observedIn(il)) {
590
621
  return candlesEv; // holiday isn't observed here; bail out early
591
622
  }
592
- const eFlags = ev.getFlags();
593
- if ((!options.yomKippurKatan && eFlags & YOM_KIPPUR_KATAN) ||
594
- (!options.behab && eFlags & BEHAB) ||
595
- (options.noModern && eFlags & MODERN_HOLIDAY)) {
623
+ const eFlags = ev.mask;
624
+ const isYomKippurKatan = ev.hasFlag('YOM_KIPPUR_KATAN');
625
+ const isBehab = ev.hasFlag('BEHAB');
626
+ if ((!options.yomKippurKatan && isYomKippurKatan) ||
627
+ (!options.behab && isBehab) ||
628
+ (options.noModern && ev.hasFlag('MODERN_HOLIDAY'))) {
596
629
  return candlesEv; // bail out early
597
630
  }
598
631
  if (options.candlelighting && ev.getDesc() === holidayDesc.EREV_PESACH) {
@@ -601,8 +634,10 @@ function appendHolidayAndRelated(candlesEv, events, ev, options, isFriday, isSat
601
634
  events.push(...evts);
602
635
  }
603
636
  }
604
- const isMajorFast = Boolean(eFlags & MAJOR_FAST);
605
- const isMinorFast = Boolean(eFlags & MINOR_FAST);
637
+ const isMajorFast = ev.hasFlag('MAJOR_FAST');
638
+ const isMinorFast = ev.hasFlag('MINOR_FAST');
639
+ const isChanukah = ev.hasFlag('CHANUKAH_CANDLES');
640
+ const hasCandles = ev.hasAnyFlag('LIGHT_CANDLES', 'LIGHT_CANDLES_TZEIS', 'CHANUKAH_CANDLES', 'YOM_TOV_ENDS');
606
641
  let fastEv;
607
642
  if (options.candlelighting &&
608
643
  (isMajorFast || isMinorFast) &&
@@ -614,10 +649,10 @@ function appendHolidayAndRelated(candlesEv, events, ev, options, isFriday, isSat
614
649
  }
615
650
  }
616
651
  if (eFlags & Number(options.mask) || (!eFlags && !hasUserMask)) {
617
- if (options.candlelighting && eFlags & MASK_LIGHT_CANDLES) {
652
+ if (options.candlelighting && hasCandles) {
618
653
  const hd = ev.getDate();
619
654
  candlesEv = makeCandleEvent(ev, hd, options, isFriday, isSaturday);
620
- if (eFlags & CHANUKAH_CANDLES && candlesEv && !options.noHolidays) {
655
+ if (isChanukah && candlesEv && !options.noHolidays) {
621
656
  // Replace Chanukah event with a clone that includes candle lighting time.
622
657
  // For clarity, allow a "duplicate" candle lighting event to remain for Shabbat
623
658
  const chanukahEv = makeWeekdayChanukahCandleLighting(ev, options);
@@ -632,8 +667,8 @@ function appendHolidayAndRelated(candlesEv, events, ev, options, isFriday, isSat
632
667
  }
633
668
  }
634
669
  if (!options.noHolidays ||
635
- (options.yomKippurKatan && eFlags & YOM_KIPPUR_KATAN) ||
636
- (options.behab && eFlags & BEHAB)) {
670
+ (options.yomKippurKatan && isYomKippurKatan) ||
671
+ (options.behab && isBehab)) {
637
672
  events.push(ev); // the original event itself
638
673
  }
639
674
  }