@hebcal/core 6.0.8 → 6.1.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 (157) hide show
  1. package/dist/DailyLearning.d.ts +1 -1
  2. package/dist/HolidayEvent.d.ts +1 -0
  3. package/dist/ashkenazi.po.d.ts +14 -2
  4. package/dist/bundle.js +2085 -1535
  5. package/dist/bundle.js.map +1 -1
  6. package/dist/bundle.min.js +17 -19
  7. package/dist/bundle.min.js.map +1 -1
  8. package/dist/coverage/block-navigation.d.ts +1 -0
  9. package/dist/coverage/block-navigation.js +70 -0
  10. package/dist/coverage/prettify.d.ts +0 -0
  11. package/dist/coverage/prettify.js +477 -0
  12. package/dist/coverage/sorter.d.ts +1 -0
  13. package/dist/coverage/sorter.js +176 -0
  14. package/dist/eslint.config.d.mts +83 -0
  15. package/dist/eslint.config.mjs +28 -0
  16. package/dist/esm/DailyLearning.d.ts +1 -1
  17. package/dist/esm/DailyLearning.js +1 -1
  18. package/dist/esm/DailyLearning.js.map +1 -1
  19. package/dist/esm/HebrewDateEvent.js +5 -5
  20. package/dist/esm/HebrewDateEvent.js.map +1 -1
  21. package/dist/esm/HolidayEvent.d.ts +1 -0
  22. package/dist/esm/HolidayEvent.js +17 -1
  23. package/dist/esm/HolidayEvent.js.map +1 -1
  24. package/dist/esm/MevarchimChodeshEvent.js +2 -1
  25. package/dist/esm/MevarchimChodeshEvent.js.map +1 -1
  26. package/dist/esm/ParshaEvent.js +2 -1
  27. package/dist/esm/ParshaEvent.js.map +1 -1
  28. package/dist/esm/TimedEvent.js +9 -3
  29. package/dist/esm/TimedEvent.js.map +1 -1
  30. package/dist/esm/YomKippurKatanEvent.js +2 -1
  31. package/dist/esm/YomKippurKatanEvent.js.map +1 -1
  32. package/dist/esm/ashkenazi.po.d.ts +14 -2
  33. package/dist/esm/ashkenazi.po.js +2 -2
  34. package/dist/esm/ashkenazi.po.js.map +1 -1
  35. package/dist/esm/calendar.js +6 -8
  36. package/dist/esm/calendar.js.map +1 -1
  37. package/dist/esm/candles.js +11 -3
  38. package/dist/esm/candles.js.map +1 -1
  39. package/dist/esm/event.js +18 -1
  40. package/dist/esm/event.js.map +1 -1
  41. package/dist/esm/getStartAndEnd.js +2 -2
  42. package/dist/esm/getStartAndEnd.js.map +1 -1
  43. package/dist/esm/hallel.js +1 -1
  44. package/dist/esm/he-x-NoNikud.po.js +1 -1
  45. package/dist/esm/he.po.d.ts +20 -0
  46. package/dist/esm/he.po.js +2 -2
  47. package/dist/esm/he.po.js.map +1 -1
  48. package/dist/esm/hebcal.js +3 -3
  49. package/dist/esm/hebcal.js.map +1 -1
  50. package/dist/esm/holidays.js +3 -3
  51. package/dist/esm/holidays.js.map +1 -1
  52. package/dist/esm/index.d.ts +2 -0
  53. package/dist/esm/index.js +3 -1
  54. package/dist/esm/index.js.map +1 -1
  55. package/dist/esm/isAssurBemlacha.js +1 -1
  56. package/dist/esm/locale.d.ts +1 -2
  57. package/dist/esm/locale.js +1 -1
  58. package/dist/esm/locale.js.map +1 -1
  59. package/dist/esm/location.js +7 -1
  60. package/dist/esm/location.js.map +1 -1
  61. package/dist/esm/modern.js +1 -1
  62. package/dist/esm/molad.d.ts +71 -1
  63. package/dist/esm/molad.js +113 -12
  64. package/dist/esm/molad.js.map +1 -1
  65. package/dist/esm/moladBase.d.ts +15 -0
  66. package/dist/esm/moladBase.js +83 -0
  67. package/dist/esm/moladBase.js.map +1 -0
  68. package/dist/esm/moladDate.d.ts +12 -0
  69. package/dist/esm/moladDate.js +63 -0
  70. package/dist/esm/moladDate.js.map +1 -0
  71. package/dist/esm/omer.d.ts +0 -1
  72. package/dist/esm/omer.js +7 -4
  73. package/dist/esm/omer.js.map +1 -1
  74. package/dist/esm/parshaName.js +2 -2
  75. package/dist/esm/parshaName.js.map +1 -1
  76. package/dist/esm/parshaYear.js +1 -1
  77. package/dist/esm/pkgVersion.d.ts +1 -1
  78. package/dist/esm/pkgVersion.js +2 -2
  79. package/dist/esm/pkgVersion.js.map +1 -1
  80. package/dist/esm/reformatTimeStr.js +5 -6
  81. package/dist/esm/reformatTimeStr.js.map +1 -1
  82. package/dist/esm/sedra.js +13 -7
  83. package/dist/esm/sedra.js.map +1 -1
  84. package/dist/esm/staticHolidays.js +1 -1
  85. package/dist/esm/tachanun.js +4 -4
  86. package/dist/esm/tachanun.js.map +1 -1
  87. package/dist/esm/zmanim.d.ts +114 -1
  88. package/dist/esm/zmanim.js +242 -8
  89. package/dist/esm/zmanim.js.map +1 -1
  90. package/dist/he.po.d.ts +20 -0
  91. package/dist/index.d.ts +2 -0
  92. package/dist/locale.d.ts +1 -2
  93. package/dist/molad.d.ts +71 -1
  94. package/dist/moladBase.d.ts +15 -0
  95. package/dist/moladDate.d.ts +12 -0
  96. package/dist/omer.d.ts +0 -1
  97. package/dist/pkgVersion.d.ts +1 -1
  98. package/dist/po2json.js +3 -4
  99. package/dist/src/DailyLearning.d.ts +1 -1
  100. package/dist/src/HebrewDateEvent.js +4 -4
  101. package/dist/src/HolidayEvent.d.ts +1 -0
  102. package/dist/src/HolidayEvent.js +16 -0
  103. package/dist/src/MevarchimChodeshEvent.js +1 -0
  104. package/dist/src/ParshaEvent.js +1 -0
  105. package/dist/src/TimedEvent.js +8 -2
  106. package/dist/src/YomKippurKatanEvent.js +1 -0
  107. package/dist/src/ashkenazi.po.d.ts +14 -2
  108. package/dist/src/ashkenazi.po.js +1 -1
  109. package/dist/src/calendar.js +5 -7
  110. package/dist/src/candles.js +10 -2
  111. package/dist/src/event.js +17 -0
  112. package/dist/src/getStartAndEnd.js +1 -1
  113. package/dist/src/he.po.d.ts +20 -0
  114. package/dist/src/he.po.js +1 -1
  115. package/dist/src/hebcal.js +2 -2
  116. package/dist/src/holidays.js +2 -2
  117. package/dist/src/index.d.ts +2 -0
  118. package/dist/src/index.js +2 -0
  119. package/dist/src/locale.d.ts +1 -2
  120. package/dist/src/locale.js +1 -1
  121. package/dist/src/location.js +6 -0
  122. package/dist/src/molad.d.ts +71 -1
  123. package/dist/src/molad.js +112 -11
  124. package/dist/src/moladBase.d.ts +15 -0
  125. package/dist/src/moladBase.js +78 -0
  126. package/dist/src/moladDate.d.ts +12 -0
  127. package/dist/src/moladDate.js +58 -0
  128. package/dist/src/omer.d.ts +0 -1
  129. package/dist/src/omer.js +6 -3
  130. package/dist/src/parshaName.js +1 -1
  131. package/dist/src/pkgVersion.d.ts +1 -1
  132. package/dist/src/pkgVersion.js +1 -1
  133. package/dist/src/reformatTimeStr.js +4 -5
  134. package/dist/src/sedra.js +12 -6
  135. package/dist/src/tachanun.js +3 -3
  136. package/dist/src/zmanim.d.ts +114 -1
  137. package/dist/src/zmanim.js +240 -6
  138. package/dist/version.js +1 -2
  139. package/dist/zmanim.d.ts +114 -1
  140. package/package.json +17 -19
  141. package/dist/size-demo/dist/getHoliday.d.ts +0 -1944
  142. package/dist/size-demo/dist/getHoliday.js +0 -3712
  143. package/dist/size-demo/dist/parshiyot.js +0 -10662
  144. package/dist/size-demo/dist/sedra.d.ts +0 -1411
  145. package/dist/size-demo/dist/sedra.js +0 -2359
  146. package/dist/size-demo/dist/tachanun.d.ts +0 -1015
  147. package/dist/size-demo/dist/tachanun.js +0 -1755
  148. package/dist/size-demo/getHoliday.d.ts +0 -1
  149. package/dist/size-demo/getHoliday.js +0 -3
  150. package/dist/size-demo/parshiyot.d.ts +0 -1
  151. package/dist/size-demo/parshiyot.js +0 -11
  152. package/dist/size-demo/rollup.config.d.ts +0 -3
  153. package/dist/size-demo/rollup.config.js +0 -47
  154. package/dist/size-demo/sedra.d.ts +0 -1
  155. package/dist/size-demo/sedra.js +0 -3
  156. package/dist/size-demo/tachanun.d.ts +0 -1
  157. package/dist/size-demo/tachanun.js +0 -3
@@ -123,7 +123,7 @@ import { Location } from './location';
123
123
  * }
124
124
  */
125
125
  export function calendar(options = {}) {
126
- options = Object.assign({}, options); // so we can modify freely
126
+ options = { ...options }; // so we can modify freely
127
127
  checkCandleOptions(options);
128
128
  const location = (options.location = options.location || defaultLocation);
129
129
  const il = (options.il = options.il || location.getIsrael() || false);
@@ -326,7 +326,7 @@ const RECOGNIZED_OPTIONS = {
326
326
  */
327
327
  function warnUnrecognizedOptions(options) {
328
328
  for (const k of Object.keys(options)) {
329
- if (typeof RECOGNIZED_OPTIONS[k] === 'undefined' &&
329
+ if (RECOGNIZED_OPTIONS[k] === undefined &&
330
330
  !unrecognizedAlreadyWarned.has(k)) {
331
331
  console.warn(`Ignoring unrecognized HebrewCalendar option: ${k}`);
332
332
  unrecognizedAlreadyWarned.add(k);
@@ -383,7 +383,7 @@ function checkCandleOptions(options) {
383
383
  return;
384
384
  }
385
385
  const location = options.location;
386
- if (typeof location === 'undefined' || !(location instanceof Location)) {
386
+ if (location === undefined || !(location instanceof Location)) {
387
387
  throw new TypeError('options.candlelighting requires valid options.location');
388
388
  }
389
389
  if (typeof options.havdalahMins === 'number' &&
@@ -431,11 +431,10 @@ function overrideIsraelCandleMins(location, min) {
431
431
  * @private
432
432
  */
433
433
  function getMaskFromOptions(options) {
434
- var _a;
435
434
  if (typeof options.mask === 'number') {
436
435
  return setOptionsFromMask(options);
437
436
  }
438
- const il = options.il || ((_a = options.location) === null || _a === void 0 ? void 0 : _a.getIsrael()) || false;
437
+ const il = options.il || options.location?.getIsrael() || false;
439
438
  let mask = 0;
440
439
  // default options
441
440
  if (!options.noHolidays) {
@@ -602,8 +601,7 @@ function appendHolidayAndRelated(candlesEv, events, ev, options, isFriday, isSat
602
601
  }
603
602
  }
604
603
  if ((isMajorFast || (isMinorFast && !options.noMinorFast)) &&
605
- fastEv &&
606
- fastEv.endEvent) {
604
+ fastEv?.endEvent) {
607
605
  events.push(fastEv.endEvent);
608
606
  }
609
607
  return candlesEv;
@@ -1,4 +1,3 @@
1
- /* eslint-disable max-len */
2
1
  import { months } from '@hebcal/hdate';
3
2
  import { flags } from './event';
4
3
  import { ChanukahEvent, HolidayEvent } from './HolidayEvent';
@@ -13,7 +12,7 @@ export function makeCandleEvent(ev, hd, options, isFriday, isSaturday) {
13
12
  let havdalahTitle = false;
14
13
  let useHavdalahOffset = isSaturday;
15
14
  let mask = ev ? ev.getFlags() : LIGHT_CANDLES;
16
- if (typeof ev !== 'undefined') {
15
+ if (ev !== undefined) {
17
16
  // if linked event && dow == FRI, use Candle lighting time & title
18
17
  if (!isFriday) {
19
18
  if (mask & (LIGHT_CANDLES_TZEIS | flags.CHANUKAH_CANDLES)) {
@@ -54,6 +53,12 @@ const FAST_BEGINS = 'Fast begins';
54
53
  const FAST_ENDS = 'Fast ends';
55
54
  /** A fast day also contains a start and end time */
56
55
  export class FastDayEvent extends HolidayEvent {
56
+ /** original event */
57
+ linkedEvent;
58
+ /** this will be a "Fast begins" event */
59
+ startEvent;
60
+ /** this will be a "Fast ends" event */
61
+ endEvent;
57
62
  constructor(linkedEvent, startEvent, endEvent) {
58
63
  super(linkedEvent.getDate(), linkedEvent.getDesc(), linkedEvent.getFlags());
59
64
  this.linkedEvent = linkedEvent;
@@ -135,6 +140,9 @@ function makeTimedEvent(ev, time, desc, options) {
135
140
  return new TimedEvent(hd, desc, ev.getFlags(), time, location, ev, options);
136
141
  }
137
142
  export class TimedChanukahEvent extends ChanukahEvent {
143
+ eventTime;
144
+ eventTimeStr;
145
+ location;
138
146
  constructor(ev, eventTime, location) {
139
147
  super(ev.getDate(), ev.getDesc(), ev.getFlags(), ev.chanukahDay);
140
148
  this.eventTime = Zmanim.roundTime(eventTime);
package/dist/src/event.js CHANGED
@@ -90,6 +90,23 @@ const flagToCategory = [
90
90
  * with Sephardic transliterations, use the `render()` method.
91
91
  */
92
92
  export class Event {
93
+ /** Hebrew date of this event */
94
+ date;
95
+ /**
96
+ * Untranslated title of this event. Note that these description
97
+ * strings are always in English and will remain stable across releases.
98
+ * To get the title of the event in another language, use the
99
+ * `render()` method.
100
+ */
101
+ desc;
102
+ /** Bitmask of optional event flags. See {@link flags} */
103
+ mask;
104
+ /** Optional emoji character such as ✡️, 🕯️, 🕎, 🕍, 🌒 */
105
+ emoji;
106
+ /** Optional longer description or memo text */
107
+ memo;
108
+ /** Alarms are used by iCalendar feeds */
109
+ alarm;
93
110
  /**
94
111
  * Constructs Event
95
112
  * @param date Hebrew date event occurs
@@ -14,7 +14,7 @@ function getAbs(d) {
14
14
  throw new TypeError(`Invalid date type: ${d}`);
15
15
  }
16
16
  function getYear(options) {
17
- if (typeof options.year !== 'undefined') {
17
+ if (options.year !== undefined) {
18
18
  return Number(options.year);
19
19
  }
20
20
  return options.isHebrewYear
@@ -184,11 +184,31 @@ declare const _default: {
184
184
  "Ben-Gurion Day": string[];
185
185
  "Hebrew Language Day": string[];
186
186
  "Birkat Hachamah": string[];
187
+ "Birkat HaChamah": string[];
187
188
  "Shushan Purim Katan": string[];
188
189
  "Purim Meshulash": string[];
189
190
  "Chag HaBanot": string[];
190
191
  Molad: string[];
191
192
  chalakim: string[];
193
+ "Alot HaShachar": string[];
194
+ Misheyakir: string[];
195
+ "Misheyakir Machmir": string[];
196
+ Sunrise: string[];
197
+ "Kriat Shema, sof zeman": string[];
198
+ "Tefilah, sof zeman": string[];
199
+ "Kriat Shema, sof zeman (MGA)": string[];
200
+ "Kriat Shema, sof zeman (GRA)": string[];
201
+ "Tefilah, sof zeman (MGA)": string[];
202
+ "Tefilah, sof zeman (GRA)": string[];
203
+ "Chatzot HaLailah": string[];
204
+ "Chatzot HaYom": string[];
205
+ "Chatzot hayom": string[];
206
+ "Mincha Gedolah": string[];
207
+ "Mincha Ketanah": string[];
208
+ "Plag HaMincha": string[];
209
+ Sunset: string[];
210
+ "Bein HaShemashot": string[];
211
+ "Tzeit HaKochavim": string[];
192
212
  };
193
213
  };
194
214
  };
package/dist/src/he.po.js CHANGED
@@ -1 +1 @@
1
- export default { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);", "language": "he_IL" }, "contexts": { "": { "Shabbat": ["שַׁבָּת"], "Parashat": ["פָּרָשַׁת"], "Achrei Mot": ["אַחֲרֵי מוֹת"], "Balak": ["בָּלָק"], "Bamidbar": ["בְּמִדְבַּר"], "Bechukotai": ["בְּחֻקֹּתַי"], "Beha'alotcha": ["בְּהַעֲלֹתְךָ"], "Behar": ["בְּהַר"], "Bereshit": ["בְּרֵאשִׁית"], "Beshalach": ["בְּשַׁלַּח"], "Bo": ["בֹּא"], "Chayei Sara": ["חַיֵּי שָֹרָה"], "Chukat": ["חֻקַּת"], "Devarim": ["דְּבָרִים"], "Eikev": ["עֵקֶב"], "Emor": ["אֱמוֹר"], "Ha'azinu": ["הַאֲזִינוּ"], "Kedoshim": ["קְדֹשִׁים"], "Ki Tavo": ["כִּי־תָבוֹא"], "Ki Teitzei": ["כִּי־תֵצֵא"], "Ki Tisa": ["כִּי תִשָּׂא"], "Korach": ["קֹרַח"], "Lech-Lecha": ["לֶךְ־לְךָ"], "Masei": ["מַסְעֵי"], "Matot": ["מַטּוֹת"], "Metzora": ["מְצֹרָע"], "Miketz": ["מִקֵּץ"], "Mishpatim": ["מִשְׁפָּטִים"], "Nasso": ["נָשׂא"], "Nitzavim": ["נִצָּבִים"], "Noach": ["נֹחַ"], "Pekudei": ["פְקוּדֵי"], "Pinchas": ["פִּינְחָס"], "Re'eh": ["רְאֵה"], "Sh'lach": ["שְׁלַח־לְךָ"], "Shemot": ["שְׁמוֹת"], "Shmini": ["שְּׁמִינִי"], "Shoftim": ["שׁוֹפְטִים"], "Tazria": ["תַזְרִיעַ"], "Terumah": ["תְּרוּמָה"], "Tetzaveh": ["תְּצַוֶּה"], "Toldot": ["תּוֹלְדוֹת"], "Tzav": ["צַו"], "Vaera": ["וָאֵרָא"], "Vaetchanan": ["וָאֶתְחַנַּן"], "Vayakhel": ["וַיַּקְהֵל"], "Vayechi": ["וַיְחִי"], "Vayeilech": ["וַיֵּלֶךְ"], "Vayera": ["וַיֵּרָא"], "Vayeshev": ["וַיֵּשֶׁב"], "Vayetzei": ["וַיֵּצֵא"], "Vayigash": ["וַיִּגַּשׁ"], "Vayikra": ["וַיִּקְרָא"], "Vayishlach": ["וַיִּשְׁלַח"], "Vezot Haberakhah": ["וְזֹאת הַבְּרָכָה"], "Yitro": ["יִתְרוֹ"], "Asara B'Tevet": ["עֲשָׂרָה בְּטֵבֵת"], "Candle lighting": ["הַדְלָקַת נֵרוֹת"], "Chanukah": ["חֲנוּכָּה"], "Chanukah: 1 Candle": ["חֲנוּכָּה: א׳ נֵר"], "Chanukah: 2 Candles": ["חֲנוּכָּה: ב׳ נֵרוֹת"], "Chanukah: 3 Candles": ["חֲנוּכָּה: ג׳ נֵרוֹת"], "Chanukah: 4 Candles": ["חֲנוּכָּה: ד׳ נֵרוֹת"], "Chanukah: 5 Candles": ["חֲנוּכָּה: ה׳ נֵרוֹת"], "Chanukah: 6 Candles": ["חֲנוּכָּה: ו׳ נֵרוֹת"], "Chanukah: 7 Candles": ["חֲנוּכָּה: ז׳ נֵרוֹת"], "Chanukah: 8 Candles": ["חֲנוּכָּה: ח׳ נֵרוֹת"], "Chanukah: 8th Day": ["חֲנוּכָּה: יוֹם ח׳"], "Days of the Omer": ["סְפִירַת הָעוֹמֶר"], "Omer": ["עוֹמֶר"], "day of the Omer": ["בָּעוֹמֶר"], "Erev Pesach": ["עֶרֶב פֶּסַח"], "Erev Purim": ["עֶרֶב פּוּרִים"], "Erev Rosh Hashana": ["עֶרֶב רֹאשׁ הַשָּׁנָה"], "Erev Shavuot": ["עֶרֶב שָׁבוּעוֹת"], "Erev Simchat Torah": ["עֶרֶב שִׂמְחַת תּוֹרָה"], "Erev Sukkot": ["עֶרֶב סוּכּוֹת"], "Erev Tish'a B'Av": ["עֶרֶב תִּשְׁעָה בְּאָב"], "Erev Yom Kippur": ["עֶרֶב יוֹם כִּפּוּר"], "Havdalah": ["הַבְדָּלָה"], "Lag BaOmer": ["ל״ג בָּעוֹמֶר"], "Leil Selichot": ["סְלִיחוֹת"], "Pesach": ["פֶּסַח"], "Pesach I": ["פֶּסַח א׳"], "Pesach II": ["פֶּסַח ב׳"], "Pesach II (CH''M)": ["פֶּסַח ב׳ (חוה״מ)"], "Pesach III (CH''M)": ["פֶּסַח ג׳ (חוה״מ)"], "Pesach IV (CH''M)": ["פֶּסַח ד׳ (חוה״מ)"], "Pesach Sheni": ["פֶּסַח שֵׁנִי"], "Pesach V (CH''M)": ["פֶּסַח ה׳ (חוה״מ)"], "Pesach VI (CH''M)": ["פֶּסַח ו׳ (חוה״מ)"], "Pesach VII": ["פֶּסַח ז׳"], "Pesach VIII": ["פֶּסַח ח׳"], "Pesach Shabbat Chol ha-Moed": ["פֶּסַח שַׁבָּת חוֹל הַמּוֹעֵד"], "Purim": ["פּוּרִים"], "Purim Katan": ["פּוּרִים קָטָן"], "Rosh Chodesh %s": ["רֹאשׁ חוֹדֶשׁ %s"], "Rosh Chodesh": ["רֹאשׁ חוֹדֶשׁ"], "Rosh Hashana": ["רֹאשׁ הַשָּׁנָה"], "Rosh Hashana I": ["רֹאשׁ הַשָּׁנָה א׳"], "Rosh Hashana II": ["רֹאשׁ הַשָּׁנָה ב׳"], "Shabbat Chazon": ["שַׁבַּת חֲזוֹן"], "Shabbat HaChodesh": ["שַׁבַּת הַחֹדֶשׁ"], "Shabbat HaGadol": ["שַׁבַּת הַגָּדוֹל"], "Shabbat Nachamu": ["שַׁבַּת נַחֲמוּ"], "Shabbat Parah": ["שַׁבַּת פָּרָה"], "Shabbat Shekalim": ["שַׁבַּת שְׁקָלִים"], "Shabbat Shuva": ["שַׁבַּת שׁוּבָה"], "Shabbat Zachor": ["שַׁבַּת זָכוֹר"], "Shavuot": ["שָׁבוּעוֹת"], "Shavuot I": ["שָׁבוּעוֹת א׳"], "Shavuot II": ["שָׁבוּעוֹת ב׳"], "Shmini Atzeret": ["שְׁמִינִי עֲצֶרֶת"], "Shushan Purim": ["שׁוּשָׁן פּוּרִים"], "Sigd": ["חַג הַסִּיגְד"], "Simchat Torah": ["שִׂמְחַת תּוֹרָה"], "Sukkot": ["סוּכּוֹת"], "Sukkot I": ["סוּכּוֹת א׳"], "Sukkot II": ["סוּכּוֹת ב׳"], "Sukkot II (CH''M)": ["סוּכּוֹת ב׳ (חוה״מ)"], "Sukkot III (CH''M)": ["סוּכּוֹת ג׳ (חוה״מ)"], "Sukkot IV (CH''M)": ["סוּכּוֹת ד׳ (חוה״מ)"], "Sukkot V (CH''M)": ["סוּכּוֹת ה׳ (חוה״מ)"], "Sukkot VI (CH''M)": ["סוּכּוֹת ו׳ (חוה״מ)"], "Sukkot VII (Hoshana Raba)": ["סוּכּוֹת ז׳ (הוֹשַׁעְנָא רַבָּה)"], "Sukkot Shabbat Chol ha-Moed": ["סוּכּוֹת שַׁבָּת חוֹל הַמּוֹעֵד"], "Ta'anit Bechorot": ["תַּעֲנִית בְּכוֹרוֹת"], "Ta'anit Esther": ["תַּעֲנִית אֶסְתֵּר"], "Tish'a B'Av": ["תִּשְׁעָה בְּאָב"], "Tu B'Av": ["ט״וּ בְּאָב"], "Tu BiShvat": ["ט״וּ בִּשְׁבָט"], "Tu B'Shvat": ["ט״וּ בִּשְׁבָט"], "Tzom Gedaliah": ["צוֹם גְּדַלְיָה"], "Tzom Tammuz": ["צוֹם י״ז בְּתַמּוּז"], "Yom HaAtzma'ut": ["יוֹם הָעַצְמָאוּת"], "Yom HaShoah": ["יוֹם הַשּׁוֹאָה"], "Yom HaZikaron": ["יוֹם הַזִּכָּרוֹן"], "Yom Kippur": ["יוֹם כִּפּוּר"], "Yom Yerushalayim": ["יוֹם יְרוּשָׁלַיִם"], "Yom HaAliyah": ["יוֹם הַעֲלִיָּה"], "Yom HaAliyah School Observance": ["שְׁמִירָת בֵּית הַסֵפֶר לְיוֹם הַעֲלִיָּה"], "Rosh Chodesh Adar": ["רֹאשׁ חוֹדֶשׁ אֲדָר"], "Rosh Chodesh Adar I": ["רֹאשׁ חוֹדֶשׁ אֲדָר א׳"], "Rosh Chodesh Adar II": ["רֹאשׁ חוֹדֶשׁ אֲדָר ב׳"], "Rosh Chodesh Av": ["רֹאשׁ חוֹדֶשׁ אָב"], "Rosh Chodesh Cheshvan": ["רֹאשׁ חוֹדֶשׁ חֶשְׁוָן"], "Rosh Chodesh Elul": ["רֹאשׁ חוֹדֶשׁ אֱלוּל"], "Rosh Chodesh Iyyar": ["רֹאשׁ חוֹדֶשׁ אִיָּיר"], "Rosh Chodesh Kislev": ["רֹאשׁ חוֹדֶשׁ כִּסְלֵו"], "Rosh Chodesh Nisan": ["רֹאשׁ חוֹדֶשׁ נִיסָן"], "Rosh Chodesh Sh'vat": ["רֹאשׁ חוֹדֶשׁ שְׁבָט"], "Rosh Chodesh Sivan": ["רֹאשׁ חוֹדֶשׁ סִיוָן"], "Rosh Chodesh Tamuz": ["רֹאשׁ חוֹדֶשׁ תַּמּוּז"], "Rosh Chodesh Tammuz": ["רֹאשׁ חוֹדֶשׁ תַּמּוּז"], "Rosh Chodesh Tevet": ["רֹאשׁ חוֹדֶשׁ טֵבֵת"], "min": ["דַּקּוֹת"], "Fast begins": ["תְּחִילַּת הַצוֹם"], "Fast ends": ["סִיּוּם הַצוֹם"], "Rosh Hashana LaBehemot": ["רֹאשׁ הַשָּׁנָה לְמַעְשַׂר בְּהֵמָה"], "Tish'a B'Av (observed)": ["(תִּשְׁעָה בְּאָב (נִדְחָה"], "Shabbat Mevarchim Chodesh": ["שַׁבַּת מְבָרְכִים חוֹדֶשׁ"], "Shabbat Shirah": ["שַׁבַּת שִׁירָה"], "Lovingkindness": ["חֶסֶד"], "Might": ["גְּבוּרָה"], "Beauty": ["תִּפְאֶרֶת"], "Eternity": ["נֶּצַח"], "Splendor": ["הוֹד"], "Foundation": ["יְּסוֹד"], "Majesty": ["מַּלְכוּת"], "day": ["יוֹם"], "Yom Kippur Katan": ["יוֹם כִּפּוּר קָטָן"], "Yizkor": ["יִזְכּוֹר"], "Family Day": ["יוֹם הַמִּשׁפָּחָה"], "Yitzhak Rabin Memorial Day": ["יוֹם הַזִּכָּרוֹן לְיִצְחָק רַבִּין"], "Jabotinsky Day": ["יוֹם זַ׳בּוֹטִינְסְקִי"], "Herzl Day": ["יוֹם הֵרְצְל"], "Ben-Gurion Day": ["יוֹם בן־גוריון"], "Hebrew Language Day": ["יוֹם הַשָׂפָה הַעִברִית"], "Birkat Hachamah": ["בִּרְכַּת הַחַמָּה"], "Shushan Purim Katan": ["שׁוּשָׁן פּוּרִים קָטָן"], "Purim Meshulash": ["פּוּרִים מְשׁוּלָּשׁ"], "Chag HaBanot": ["חַג הַבָּנוֹת"], "Molad": ["מוֹלָד הָלְּבָנָה"], "chalakim": ["חֲלָקִים"] } } };
1
+ export default { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);", "language": "he_IL" }, "contexts": { "": { "Shabbat": ["שַׁבָּת"], "Parashat": ["פָּרָשַׁת"], "Achrei Mot": ["אַחֲרֵי מוֹת"], "Balak": ["בָּלָק"], "Bamidbar": ["בְּמִדְבַּר"], "Bechukotai": ["בְּחֻקֹּתַי"], "Beha'alotcha": ["בְּהַעֲלֹתְךָ"], "Behar": ["בְּהַר"], "Bereshit": ["בְּרֵאשִׁית"], "Beshalach": ["בְּשַׁלַּח"], "Bo": ["בֹּא"], "Chayei Sara": ["חַיֵּי שָֹרָה"], "Chukat": ["חֻקַּת"], "Devarim": ["דְּבָרִים"], "Eikev": ["עֵקֶב"], "Emor": ["אֱמוֹר"], "Ha'azinu": ["הַאֲזִינוּ"], "Kedoshim": ["קְדֹשִׁים"], "Ki Tavo": ["כִּי־תָבוֹא"], "Ki Teitzei": ["כִּי־תֵצֵא"], "Ki Tisa": ["כִּי תִשָּׂא"], "Korach": ["קֹרַח"], "Lech-Lecha": ["לֶךְ־לְךָ"], "Masei": ["מַסְעֵי"], "Matot": ["מַטּוֹת"], "Metzora": ["מְצֹרָע"], "Miketz": ["מִקֵּץ"], "Mishpatim": ["מִשְׁפָּטִים"], "Nasso": ["נָשׂא"], "Nitzavim": ["נִצָּבִים"], "Noach": ["נֹחַ"], "Pekudei": ["פְקוּדֵי"], "Pinchas": ["פִּינְחָס"], "Re'eh": ["רְאֵה"], "Sh'lach": ["שְׁלַח־לְךָ"], "Shemot": ["שְׁמוֹת"], "Shmini": ["שְּׁמִינִי"], "Shoftim": ["שׁוֹפְטִים"], "Tazria": ["תַזְרִיעַ"], "Terumah": ["תְּרוּמָה"], "Tetzaveh": ["תְּצַוֶּה"], "Toldot": ["תּוֹלְדוֹת"], "Tzav": ["צַו"], "Vaera": ["וָאֵרָא"], "Vaetchanan": ["וָאֶתְחַנַּן"], "Vayakhel": ["וַיַּקְהֵל"], "Vayechi": ["וַיְחִי"], "Vayeilech": ["וַיֵּלֶךְ"], "Vayera": ["וַיֵּרָא"], "Vayeshev": ["וַיֵּשֶׁב"], "Vayetzei": ["וַיֵּצֵא"], "Vayigash": ["וַיִּגַּשׁ"], "Vayikra": ["וַיִּקְרָא"], "Vayishlach": ["וַיִּשְׁלַח"], "Vezot Haberakhah": ["וְזֹאת הַבְּרָכָה"], "Yitro": ["יִתְרוֹ"], "Asara B'Tevet": ["עֲשָׂרָה בְּטֵבֵת"], "Candle lighting": ["הַדְלָקַת נֵרוֹת"], "Chanukah": ["חֲנוּכָּה"], "Chanukah: 1 Candle": ["חֲנוּכָּה: א׳ נֵר"], "Chanukah: 2 Candles": ["חֲנוּכָּה: ב׳ נֵרוֹת"], "Chanukah: 3 Candles": ["חֲנוּכָּה: ג׳ נֵרוֹת"], "Chanukah: 4 Candles": ["חֲנוּכָּה: ד׳ נֵרוֹת"], "Chanukah: 5 Candles": ["חֲנוּכָּה: ה׳ נֵרוֹת"], "Chanukah: 6 Candles": ["חֲנוּכָּה: ו׳ נֵרוֹת"], "Chanukah: 7 Candles": ["חֲנוּכָּה: ז׳ נֵרוֹת"], "Chanukah: 8 Candles": ["חֲנוּכָּה: ח׳ נֵרוֹת"], "Chanukah: 8th Day": ["חֲנוּכָּה: יוֹם ח׳"], "Days of the Omer": ["סְפִירַת הָעוֹמֶר"], "Omer": ["עוֹמֶר"], "day of the Omer": ["בָּעוֹמֶר"], "Erev Pesach": ["עֶרֶב פֶּסַח"], "Erev Purim": ["עֶרֶב פּוּרִים"], "Erev Rosh Hashana": ["עֶרֶב רֹאשׁ הַשָּׁנָה"], "Erev Shavuot": ["עֶרֶב שָׁבוּעוֹת"], "Erev Simchat Torah": ["עֶרֶב שִׂמְחַת תּוֹרָה"], "Erev Sukkot": ["עֶרֶב סוּכּוֹת"], "Erev Tish'a B'Av": ["עֶרֶב תִּשְׁעָה בְּאָב"], "Erev Yom Kippur": ["עֶרֶב יוֹם כִּפּוּר"], "Havdalah": ["הַבְדָּלָה"], "Lag BaOmer": ["ל״ג בָּעוֹמֶר"], "Leil Selichot": ["סְלִיחוֹת"], "Pesach": ["פֶּסַח"], "Pesach I": ["פֶּסַח א׳"], "Pesach II": ["פֶּסַח ב׳"], "Pesach II (CH''M)": ["פֶּסַח ב׳ (חוה״מ)"], "Pesach III (CH''M)": ["פֶּסַח ג׳ (חוה״מ)"], "Pesach IV (CH''M)": ["פֶּסַח ד׳ (חוה״מ)"], "Pesach Sheni": ["פֶּסַח שֵׁנִי"], "Pesach V (CH''M)": ["פֶּסַח ה׳ (חוה״מ)"], "Pesach VI (CH''M)": ["פֶּסַח ו׳ (חוה״מ)"], "Pesach VII": ["פֶּסַח ז׳"], "Pesach VIII": ["פֶּסַח ח׳"], "Pesach Shabbat Chol ha-Moed": ["פֶּסַח שַׁבָּת חוֹל הַמּוֹעֵד"], "Purim": ["פּוּרִים"], "Purim Katan": ["פּוּרִים קָטָן"], "Rosh Chodesh %s": ["רֹאשׁ חוֹדֶשׁ %s"], "Rosh Chodesh": ["רֹאשׁ חוֹדֶשׁ"], "Rosh Hashana": ["רֹאשׁ הַשָּׁנָה"], "Rosh Hashana I": ["רֹאשׁ הַשָּׁנָה א׳"], "Rosh Hashana II": ["רֹאשׁ הַשָּׁנָה ב׳"], "Shabbat Chazon": ["שַׁבַּת חֲזוֹן"], "Shabbat HaChodesh": ["שַׁבַּת הַחֹדֶשׁ"], "Shabbat HaGadol": ["שַׁבַּת הַגָּדוֹל"], "Shabbat Nachamu": ["שַׁבַּת נַחֲמוּ"], "Shabbat Parah": ["שַׁבַּת פָּרָה"], "Shabbat Shekalim": ["שַׁבַּת שְׁקָלִים"], "Shabbat Shuva": ["שַׁבַּת שׁוּבָה"], "Shabbat Zachor": ["שַׁבַּת זָכוֹר"], "Shavuot": ["שָׁבוּעוֹת"], "Shavuot I": ["שָׁבוּעוֹת א׳"], "Shavuot II": ["שָׁבוּעוֹת ב׳"], "Shmini Atzeret": ["שְׁמִינִי עֲצֶרֶת"], "Shushan Purim": ["שׁוּשָׁן פּוּרִים"], "Sigd": ["חַג הַסִּיגְד"], "Simchat Torah": ["שִׂמְחַת תּוֹרָה"], "Sukkot": ["סוּכּוֹת"], "Sukkot I": ["סוּכּוֹת א׳"], "Sukkot II": ["סוּכּוֹת ב׳"], "Sukkot II (CH''M)": ["סוּכּוֹת ב׳ (חוה״מ)"], "Sukkot III (CH''M)": ["סוּכּוֹת ג׳ (חוה״מ)"], "Sukkot IV (CH''M)": ["סוּכּוֹת ד׳ (חוה״מ)"], "Sukkot V (CH''M)": ["סוּכּוֹת ה׳ (חוה״מ)"], "Sukkot VI (CH''M)": ["סוּכּוֹת ו׳ (חוה״מ)"], "Sukkot VII (Hoshana Raba)": ["סוּכּוֹת ז׳ (הוֹשַׁעְנָא רַבָּה)"], "Sukkot Shabbat Chol ha-Moed": ["סוּכּוֹת שַׁבָּת חוֹל הַמּוֹעֵד"], "Ta'anit Bechorot": ["תַּעֲנִית בְּכוֹרוֹת"], "Ta'anit Esther": ["תַּעֲנִית אֶסְתֵּר"], "Tish'a B'Av": ["תִּשְׁעָה בְּאָב"], "Tu B'Av": ["ט״וּ בְּאָב"], "Tu BiShvat": ["ט״וּ בִּשְׁבָט"], "Tu B'Shvat": ["ט״וּ בִּשְׁבָט"], "Tzom Gedaliah": ["צוֹם גְּדַלְיָה"], "Tzom Tammuz": ["צוֹם י״ז בְּתַמּוּז"], "Yom HaAtzma'ut": ["יוֹם הָעַצְמָאוּת"], "Yom HaShoah": ["יוֹם הַשּׁוֹאָה"], "Yom HaZikaron": ["יוֹם הַזִּכָּרוֹן"], "Yom Kippur": ["יוֹם כִּפּוּר"], "Yom Yerushalayim": ["יוֹם יְרוּשָׁלַיִם"], "Yom HaAliyah": ["יוֹם הַעֲלִיָּה"], "Yom HaAliyah School Observance": ["שְׁמִירָת בֵּית הַסֵפֶר לְיוֹם הַעֲלִיָּה"], "Rosh Chodesh Adar": ["רֹאשׁ חוֹדֶשׁ אֲדָר"], "Rosh Chodesh Adar I": ["רֹאשׁ חוֹדֶשׁ אֲדָר א׳"], "Rosh Chodesh Adar II": ["רֹאשׁ חוֹדֶשׁ אֲדָר ב׳"], "Rosh Chodesh Av": ["רֹאשׁ חוֹדֶשׁ אָב"], "Rosh Chodesh Cheshvan": ["רֹאשׁ חוֹדֶשׁ חֶשְׁוָן"], "Rosh Chodesh Elul": ["רֹאשׁ חוֹדֶשׁ אֱלוּל"], "Rosh Chodesh Iyyar": ["רֹאשׁ חוֹדֶשׁ אִיָּיר"], "Rosh Chodesh Kislev": ["רֹאשׁ חוֹדֶשׁ כִּסְלֵו"], "Rosh Chodesh Nisan": ["רֹאשׁ חוֹדֶשׁ נִיסָן"], "Rosh Chodesh Sh'vat": ["רֹאשׁ חוֹדֶשׁ שְׁבָט"], "Rosh Chodesh Sivan": ["רֹאשׁ חוֹדֶשׁ סִיוָן"], "Rosh Chodesh Tamuz": ["רֹאשׁ חוֹדֶשׁ תַּמּוּז"], "Rosh Chodesh Tammuz": ["רֹאשׁ חוֹדֶשׁ תַּמּוּז"], "Rosh Chodesh Tevet": ["רֹאשׁ חוֹדֶשׁ טֵבֵת"], "min": ["דַּקּוֹת"], "Fast begins": ["תְּחִילַּת הַצוֹם"], "Fast ends": ["סִיּוּם הַצוֹם"], "Rosh Hashana LaBehemot": ["רֹאשׁ הַשָּׁנָה לְמַעְשַׂר בְּהֵמָה"], "Tish'a B'Av (observed)": ["(תִּשְׁעָה בְּאָב (נִדְחָה"], "Shabbat Mevarchim Chodesh": ["שַׁבַּת מְבָרְכִים חוֹדֶשׁ"], "Shabbat Shirah": ["שַׁבַּת שִׁירָה"], "Lovingkindness": ["חֶסֶד"], "Might": ["גְּבוּרָה"], "Beauty": ["תִּפְאֶרֶת"], "Eternity": ["נֶּצַח"], "Splendor": ["הוֹד"], "Foundation": ["יְּסוֹד"], "Majesty": ["מַּלְכוּת"], "day": ["יוֹם"], "Yom Kippur Katan": ["יוֹם כִּפּוּר קָטָן"], "Yizkor": ["יִזְכּוֹר"], "Family Day": ["יוֹם הַמִּשׁפָּחָה"], "Yitzhak Rabin Memorial Day": ["יוֹם הַזִּכָּרוֹן לְיִצְחָק רַבִּין"], "Jabotinsky Day": ["יוֹם זַ׳בּוֹטִינְסְקִי"], "Herzl Day": ["יוֹם הֵרְצְל"], "Ben-Gurion Day": ["יוֹם בן־גוריון"], "Hebrew Language Day": ["יוֹם הַשָׂפָה הַעִברִית"], "Birkat Hachamah": ["בִּרְכַּת הַחַמָּה"], "Birkat HaChamah": ["בִּרְכַּת הַחַמָּה"], "Shushan Purim Katan": ["שׁוּשָׁן פּוּרִים קָטָן"], "Purim Meshulash": ["פּוּרִים מְשׁוּלָּשׁ"], "Chag HaBanot": ["חַג הַבָּנוֹת"], "Molad": ["מוֹלָד הָלְּבָנָה"], "chalakim": ["חֲלָקִים"], "Alot HaShachar": ["עֲלוֹת הַשַּׁחַר"], "Misheyakir": ["מִשֶּׁיַּכִּיר"], "Misheyakir Machmir": ["מִשֶּׁיַּכִּיר מַחְמִיר"], "Sunrise": ["נֵץ הַחַמָּה"], "Kriat Shema, sof zeman": ["סוֹף זְמַן קְרִיאַת שְׁמַע"], "Tefilah, sof zeman": ["סוֹף זְמַן תְּפִלָּה"], "Kriat Shema, sof zeman (MGA)": ["סוֹף זְמַן קְרִיאַת שְׁמַע (מג״א)"], "Kriat Shema, sof zeman (GRA)": ["סוֹף זְמַן קְרִיאַת שְׁמַע (גְּרָ״א)"], "Tefilah, sof zeman (MGA)": ["סוֹף זְמַן תְּפִלָּה (מג״א)"], "Tefilah, sof zeman (GRA)": ["סוֹף זְמַן תְּפִלָּה (גְּרָ״א)"], "Chatzot HaLailah": ["חֲצוֹת הַלַּיְלָה"], "Chatzot HaYom": ["חֲצוֹת הַיּוֹם"], "Chatzot hayom": ["חֲצוֹת הַיּוֹם"], "Mincha Gedolah": ["מִנְחָה גְּדוֹלָה"], "Mincha Ketanah": ["מִנְחָה קְטַנָּה"], "Plag HaMincha": ["פְּלַג הַמִּנְחָה"], "Sunset": ["שְׁקִיעַת הַחַמָּה"], "Bein HaShemashot": ["בֵּין הַשְּׁמָשׁוֹת"], "Tzeit HaKochavim": ["צֵאת הַכּוֹכָבִים"] } } };
@@ -175,7 +175,7 @@ export class HebrewCalendar {
175
175
  */
176
176
  static getBirthdayOrAnniversary(hyear, gdate) {
177
177
  const dt = getBirthdayHD(hyear, gdate);
178
- if (typeof dt === 'undefined') {
178
+ if (dt === undefined) {
179
179
  return dt;
180
180
  }
181
181
  return new HDate(dt);
@@ -216,7 +216,7 @@ export class HebrewCalendar {
216
216
  */
217
217
  static getYahrzeit(hyear, gdate) {
218
218
  const dt = getYahrzeitHD(hyear, gdate);
219
- if (typeof dt === 'undefined') {
219
+ if (dt === undefined) {
220
220
  return dt;
221
221
  }
222
222
  return new HDate(dt);
@@ -37,7 +37,7 @@ export function getHolidaysOnDate(date, il) {
37
37
  const yearMap = getHolidaysForYear_(hd.getFullYear());
38
38
  const events = yearMap.get(hdStr);
39
39
  // if il isn't a boolean return both diaspora + IL for day
40
- if (typeof il === 'undefined' || typeof events === 'undefined') {
40
+ if (il === undefined || events === undefined) {
41
41
  return events;
42
42
  }
43
43
  const filtered = events.filter(ev => ev.observedIn(il));
@@ -67,7 +67,7 @@ const TEVET = months.TEVET;
67
67
  const ADAR_I = months.ADAR_I;
68
68
  const ADAR_II = months.ADAR_II;
69
69
  const emojiIsraelFlag = { emoji: '🇮🇱' };
70
- const yearCache = new QuickLRU({ maxSize: 400 });
70
+ const yearCache = new QuickLRU({ maxSize: 120 });
71
71
  /**
72
72
  * Lower-level holidays interface, which returns a `Map` of `Event`s indexed by
73
73
  * `HDate.toString()`. These events must filtered especially for `flags.IL_ONLY`
@@ -11,6 +11,8 @@ export { Zmanim } from './zmanim';
11
11
  export { isAssurBemlacha } from './isAssurBemlacha';
12
12
  export { TimedEvent, CandleLightingEvent, HavdalahEvent } from './TimedEvent';
13
13
  export { FastDayEvent, TimedChanukahEvent } from './candles';
14
+ export { MoladBase, calculateMolad } from './moladBase';
15
+ export { getMoladAsDate } from './moladDate';
14
16
  export { Molad, MoladEvent } from './molad';
15
17
  export { OmerEvent, OmerLang } from './omer';
16
18
  export { TachanunResult } from './tachanun';
package/dist/src/index.js CHANGED
@@ -10,6 +10,8 @@ export { Zmanim } from './zmanim';
10
10
  export { isAssurBemlacha } from './isAssurBemlacha';
11
11
  export { TimedEvent, CandleLightingEvent, HavdalahEvent } from './TimedEvent';
12
12
  export { FastDayEvent, TimedChanukahEvent } from './candles';
13
+ export { calculateMolad } from './moladBase';
14
+ export { getMoladAsDate } from './moladDate';
13
15
  export { Molad, MoladEvent } from './molad';
14
16
  export { OmerEvent } from './omer';
15
17
  export { Sedra, parshiot, getSedra } from './sedra';
@@ -1,2 +1 @@
1
- import { Locale } from '@hebcal/hdate';
2
- export { Locale };
1
+ export { Locale } from '@hebcal/hdate';
@@ -2,10 +2,10 @@ import { Locale } from '@hebcal/hdate';
2
2
  import poAshkenazi from './ashkenazi.po';
3
3
  import poHe from './he.po';
4
4
  import noNikudOverride from './he-x-NoNikud.po';
5
- export { Locale };
6
5
  Locale.addTranslations('he', poHe);
7
6
  Locale.addTranslations('ashkenazi', poAshkenazi);
8
7
  /* Hebrew without nikkud */
9
8
  const poHeNoNikud = Locale.copyLocaleNoNikud(poHe);
10
9
  Locale.addTranslations('he-x-NoNikud', poHeNoNikud);
11
10
  Locale.addTranslations('he-x-NoNikud', noNikudOverride);
11
+ export { Locale } from '@hebcal/hdate';
@@ -132,6 +132,9 @@ function getFormatter(tzid) {
132
132
  }
133
133
  /** Class representing Location */
134
134
  export class Location extends GeoLocation {
135
+ il;
136
+ cc;
137
+ geoid;
135
138
  /**
136
139
  * Initialize a Location instance
137
140
  * @param latitude - Latitude as a decimal, valid range -90 thru +90 (e.g. 41.85003)
@@ -156,6 +159,9 @@ export class Location extends GeoLocation {
156
159
  throw new RangeError('Invalid timezone');
157
160
  }
158
161
  const elev = typeof elevation === 'number' && elevation > 0 ? elevation : 0;
162
+ if (cityName && typeof cityName !== 'string') {
163
+ cityName = String(cityName);
164
+ }
159
165
  super(cityName || null, lat, long, elev, tzid);
160
166
  this.il = Boolean(il);
161
167
  this.cc = countryCode;
@@ -1,3 +1,4 @@
1
+ import 'temporal-polyfill/global';
1
2
  import { Event } from './event';
2
3
  import { CalOptions } from './CalOptions';
3
4
  import { HDate } from '@hebcal/hdate';
@@ -7,19 +8,35 @@ import './locale';
7
8
  */
8
9
  export declare class Molad {
9
10
  private readonly m;
11
+ private readonly year;
12
+ private readonly month;
13
+ private instant?;
10
14
  /**
11
15
  * Calculates the molad for a Hebrew month
12
16
  * @param year
13
- * @param month
17
+ * @param month 1=NISSAN, 7=TISHREI
14
18
  */
15
19
  constructor(year: number, month: number);
16
20
  /**
21
+ * The exact Hebrew date of the molad, which often falls on the
22
+ * 28th or 30th of the preceeding month, occasionally on the first of the
23
+ * month, and in extremely rare circumstances the 27th of the month.
24
+ * - Molad Shevat 5541 occured on 27 Tevet / 1781-01-24T19:57:20.170Z
25
+ * - Molad Shevat 5788 will occur on 27 Tevet / 2028-01-26T19:07:03.504Z
26
+ * - Molad Nissan 5866 will occur on 27 Adar II / 2106-04-03T21:08:46.837Z
27
+ */
28
+ getMoladDate(): HDate;
29
+ /**
30
+ * The year of the molad (as constructed)
17
31
  */
18
32
  getYear(): number;
19
33
  /**
34
+ * The month (1=NISSAN, 7=TISHREI) as constructed
20
35
  */
21
36
  getMonth(): number;
22
37
  /**
38
+ * Returns a transliterated string name of the molad's Hebrew month,
39
+ * for example 'Elul' or 'Cheshvan'.
23
40
  */
24
41
  getMonthName(): string;
25
42
  /**
@@ -38,6 +55,59 @@ export declare class Molad {
38
55
  * @returns parts of a minute (0-17)
39
56
  */
40
57
  getChalakim(): number;
58
+ /**
59
+ * Returns the molad in Standard Time in Yerushalayim as a Temporal.ZonedDateTime.
60
+ * This method subtracts 20.94 minutes (20 minutes and 56.496 seconds) from the computed time (Har Habayis with a longitude
61
+ * of 35.2354° is 5.2354° away from the %15 timezone longitude) to get to standard time. This method
62
+ * intentionally uses standard time and not daylight savings time.
63
+ *
64
+ * @return the Temporal.ZonedDateTime representing the moment of the molad in Yerushalayim standard time (GMT + 2)
65
+ */
66
+ getInstant(): Temporal.ZonedDateTime;
67
+ /**
68
+ * Returns the earliest time of _Kiddush Levana_ calculated as 3 days after the molad. This method returns the time
69
+ * even if it is during the day when _Kiddush Levana_ can't be said. Callers of this method should consider
70
+ * displaying the next _tzais_ if the zman is between _alos_ and _tzais_.
71
+ *
72
+ * @return the Temporal.ZonedDateTime representing the moment 3 days after the molad.
73
+ */
74
+ getTchilasZmanKidushLevana3Days(): Temporal.ZonedDateTime;
75
+ /**
76
+ * Returns the earliest time of Kiddush Levana calculated as 7 days after the molad as mentioned by the <a
77
+ * href="https://en.wikipedia.org/wiki/Yosef_Karo">Mechaber</a>. See the <a
78
+ * href="https://en.wikipedia.org/wiki/Yoel_Sirkis">Bach's</a> opinion on this time. This method returns the time
79
+ * even if it is during the day when _Kiddush Levana_ can't be said. Callers of this method should consider
80
+ * displaying the next _tzais_ if the zman is between _alos_ and _tzais_.
81
+ *
82
+ * @return the Temporal.ZonedDateTime representing the moment 7 days after the molad.
83
+ */
84
+ getTchilasZmanKidushLevana7Days(): Temporal.ZonedDateTime;
85
+ /**
86
+ * Returns the latest time of Kiddush Levana according to the <a
87
+ * href="https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin">Maharil's</a> opinion that it is calculated as
88
+ * halfway between molad and molad. This adds half the 29 days, 12 hours and 793 chalakim time between molad and
89
+ * molad (14 days, 18 hours, 22 minutes and 666 milliseconds) to the month's molad. This method returns the time
90
+ * even if it is during the day when _Kiddush Levana_ can't be said. Callers of this method should consider
91
+ * displaying _alos_ before this time if the zman is between _alos_ and _tzais_.
92
+ *
93
+ * @return the Temporal.ZonedDateTime representing the moment halfway between molad and molad.
94
+ */
95
+ getSofZmanKidushLevanaBetweenMoldos(): Temporal.ZonedDateTime;
96
+ /**
97
+ * Returns the latest time of Kiddush Levana calculated as 15 days after the molad. This is the opinion brought down
98
+ * in the Shulchan Aruch (Orach Chaim 426). It should be noted that some opinions hold that the
99
+ * <a href="https://en.wikipedia.org/wiki/Moses_Isserles">Rema</a> who brings down the opinion of the <a
100
+ * href="https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin">Maharil's</a> of calculating
101
+ * {@link Molad.getSofZmanKidushLevanaBetweenMoldos() half way between molad and mold} is of the opinion that Mechaber
102
+ * agrees to his opinion. Also see the Aruch Hashulchan. For additional details on the subject, See Rabbi Dovid
103
+ * Heber's very detailed writeup in Siman Daled (chapter 4) of <a
104
+ * href="https://www.worldcat.org/oclc/461326125">Shaarei Zmanim</a>. This method returns the time even if it is during
105
+ * the day when _Kiddush Levana_ can't be said. Callers of this method should consider displaying _alos_
106
+ * before this time if the zman is between _alos_ and _tzais_.
107
+ *
108
+ * @return the Temporal.ZonedDateTime representing the moment 15 days after the molad.
109
+ */
110
+ getSofZmanKidushLevana15Days(): Temporal.ZonedDateTime;
41
111
  /**
42
112
  * @param [locale] Optional locale name (defaults to empty locale)
43
113
  * @param options
package/dist/src/molad.js CHANGED
@@ -1,7 +1,9 @@
1
- /* eslint-disable camelcase */
1
+ import 'temporal-polyfill/global';
2
2
  import { Event, flags } from './event';
3
- import { HDate, Locale, molad, pad2 } from '@hebcal/hdate';
3
+ import { HDate, Locale, pad2 } from '@hebcal/hdate';
4
4
  import { reformatTimeStr } from './reformatTimeStr';
5
+ import { calculateMolad } from './moladBase';
6
+ import { getMoladAsDate } from './moladDate';
5
7
  import './locale'; // Adds Hebrew and Ashkenazic translations
6
8
  const enDoW = [
7
9
  'Sunday',
@@ -55,34 +57,55 @@ function getHebrewTimeOfDay(hour) {
55
57
  * Represents a molad, the moment when the new moon is "born"
56
58
  */
57
59
  export class Molad {
60
+ m;
61
+ year;
62
+ month;
63
+ instant;
58
64
  /**
59
65
  * Calculates the molad for a Hebrew month
60
66
  * @param year
61
- * @param month
67
+ * @param month 1=NISSAN, 7=TISHREI
62
68
  */
63
69
  constructor(year, month) {
64
- this.m = molad(year, month);
70
+ this.m = calculateMolad(year, month);
71
+ this.year = year;
72
+ this.month = month;
65
73
  }
66
74
  /**
75
+ * The exact Hebrew date of the molad, which often falls on the
76
+ * 28th or 30th of the preceeding month, occasionally on the first of the
77
+ * month, and in extremely rare circumstances the 27th of the month.
78
+ * - Molad Shevat 5541 occured on 27 Tevet / 1781-01-24T19:57:20.170Z
79
+ * - Molad Shevat 5788 will occur on 27 Tevet / 2028-01-26T19:07:03.504Z
80
+ * - Molad Nissan 5866 will occur on 27 Adar II / 2106-04-03T21:08:46.837Z
81
+ */
82
+ getMoladDate() {
83
+ return this.m.hdate;
84
+ }
85
+ /**
86
+ * The year of the molad (as constructed)
67
87
  */
68
88
  getYear() {
69
- return this.m.year;
89
+ return this.year;
70
90
  }
71
91
  /**
92
+ * The month (1=NISSAN, 7=TISHREI) as constructed
72
93
  */
73
94
  getMonth() {
74
- return this.m.month;
95
+ return this.month;
75
96
  }
76
97
  /**
98
+ * Returns a transliterated string name of the molad's Hebrew month,
99
+ * for example 'Elul' or 'Cheshvan'.
77
100
  */
78
101
  getMonthName() {
79
- return HDate.getMonthName(this.m.month, this.m.year);
102
+ return HDate.getMonthName(this.month, this.year);
80
103
  }
81
104
  /**
82
105
  * @returns Day of Week (0=Sunday, 6=Saturday)
83
106
  */
84
107
  getDow() {
85
- return this.m.dayOfWeek;
108
+ return this.m.hdate.getDay();
86
109
  }
87
110
  /**
88
111
  * @returns hour of day (0-23)
@@ -102,13 +125,89 @@ export class Molad {
102
125
  getChalakim() {
103
126
  return this.m.chalakim;
104
127
  }
128
+ /**
129
+ * Returns the molad in Standard Time in Yerushalayim as a Temporal.ZonedDateTime.
130
+ * This method subtracts 20.94 minutes (20 minutes and 56.496 seconds) from the computed time (Har Habayis with a longitude
131
+ * of 35.2354&deg; is 5.2354&deg; away from the %15 timezone longitude) to get to standard time. This method
132
+ * intentionally uses standard time and not daylight savings time.
133
+ *
134
+ * @return the Temporal.ZonedDateTime representing the moment of the molad in Yerushalayim standard time (GMT + 2)
135
+ */
136
+ getInstant() {
137
+ this.instant ??= getMoladAsDate(this.m);
138
+ return this.instant;
139
+ }
140
+ /**
141
+ * Returns the earliest time of _Kiddush Levana_ calculated as 3 days after the molad. This method returns the time
142
+ * even if it is during the day when _Kiddush Levana_ can't be said. Callers of this method should consider
143
+ * displaying the next _tzais_ if the zman is between _alos_ and _tzais_.
144
+ *
145
+ * @return the Temporal.ZonedDateTime representing the moment 3 days after the molad.
146
+ */
147
+ getTchilasZmanKidushLevana3Days() {
148
+ const zdt = this.getInstant();
149
+ return zdt.add({ hours: 72 });
150
+ }
151
+ /**
152
+ * Returns the earliest time of Kiddush Levana calculated as 7 days after the molad as mentioned by the <a
153
+ * href="https://en.wikipedia.org/wiki/Yosef_Karo">Mechaber</a>. See the <a
154
+ * href="https://en.wikipedia.org/wiki/Yoel_Sirkis">Bach's</a> opinion on this time. This method returns the time
155
+ * even if it is during the day when _Kiddush Levana_ can't be said. Callers of this method should consider
156
+ * displaying the next _tzais_ if the zman is between _alos_ and _tzais_.
157
+ *
158
+ * @return the Temporal.ZonedDateTime representing the moment 7 days after the molad.
159
+ */
160
+ getTchilasZmanKidushLevana7Days() {
161
+ const zdt = this.getInstant();
162
+ return zdt.add({ hours: 168 });
163
+ }
164
+ /**
165
+ * Returns the latest time of Kiddush Levana according to the <a
166
+ * href="https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin">Maharil's</a> opinion that it is calculated as
167
+ * halfway between molad and molad. This adds half the 29 days, 12 hours and 793 chalakim time between molad and
168
+ * molad (14 days, 18 hours, 22 minutes and 666 milliseconds) to the month's molad. This method returns the time
169
+ * even if it is during the day when _Kiddush Levana_ can't be said. Callers of this method should consider
170
+ * displaying _alos_ before this time if the zman is between _alos_ and _tzais_.
171
+ *
172
+ * @return the Temporal.ZonedDateTime representing the moment halfway between molad and molad.
173
+ */
174
+ getSofZmanKidushLevanaBetweenMoldos() {
175
+ const zdt = this.getInstant();
176
+ // add half the time between molad and molad (half of 29 days, 12 hours and 793 chalakim (44 minutes, 3.3
177
+ // seconds), or 14 days, 18 hours, 22 minutes and 666 milliseconds). Add it as hours, not days, to avoid
178
+ // DST/ST crossover issues.
179
+ return zdt.add({
180
+ hours: 24 * 14 + 18,
181
+ minutes: 22,
182
+ seconds: 1,
183
+ milliseconds: 666,
184
+ });
185
+ }
186
+ /**
187
+ * Returns the latest time of Kiddush Levana calculated as 15 days after the molad. This is the opinion brought down
188
+ * in the Shulchan Aruch (Orach Chaim 426). It should be noted that some opinions hold that the
189
+ * <a href="https://en.wikipedia.org/wiki/Moses_Isserles">Rema</a> who brings down the opinion of the <a
190
+ * href="https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin">Maharil's</a> of calculating
191
+ * {@link Molad.getSofZmanKidushLevanaBetweenMoldos() half way between molad and mold} is of the opinion that Mechaber
192
+ * agrees to his opinion. Also see the Aruch Hashulchan. For additional details on the subject, See Rabbi Dovid
193
+ * Heber's very detailed writeup in Siman Daled (chapter 4) of <a
194
+ * href="https://www.worldcat.org/oclc/461326125">Shaarei Zmanim</a>. This method returns the time even if it is during
195
+ * the day when _Kiddush Levana_ can't be said. Callers of this method should consider displaying _alos_
196
+ * before this time if the zman is between _alos_ and _tzais_.
197
+ *
198
+ * @return the Temporal.ZonedDateTime representing the moment 15 days after the molad.
199
+ */
200
+ getSofZmanKidushLevana15Days() {
201
+ const zdt = this.getInstant();
202
+ // 15 days after the molad. Add it as hours, not days, to avoid DST/ST crossover issues.
203
+ return zdt.add({ hours: 24 * 15 });
204
+ }
105
205
  /**
106
206
  * @param [locale] Optional locale name (defaults to empty locale)
107
207
  * @param options
108
208
  */
109
209
  render(locale, options) {
110
- var _a;
111
- locale = locale !== null && locale !== void 0 ? locale : 'en';
210
+ locale = locale ?? 'en';
112
211
  if (typeof locale === 'string') {
113
212
  locale = locale.toLowerCase();
114
213
  }
@@ -120,7 +219,7 @@ export class Molad {
120
219
  const hour = this.getHour();
121
220
  const chalakim = this.getChalakim();
122
221
  const moladStr = Locale.gettext('Molad', locale);
123
- const minutesStr = (_a = Locale.lookupTranslation('min', locale)) !== null && _a !== void 0 ? _a : 'minutes';
222
+ const minutesStr = Locale.lookupTranslation('min', locale) ?? 'minutes';
124
223
  const chalakimStr = Locale.gettext('chalakim', locale);
125
224
  const and = Locale.gettext('and', locale);
126
225
  if (isHebrewLocale) {
@@ -147,6 +246,8 @@ export class Molad {
147
246
  }
148
247
  /** Represents a Molad announcement on Shabbat Mevarchim */
149
248
  export class MoladEvent extends Event {
249
+ molad;
250
+ options;
150
251
  /**
151
252
  * @param date Hebrew date event occurs
152
253
  * @param hyear molad year
@@ -0,0 +1,15 @@
1
+ import { HDate } from '@hebcal/hdate';
2
+ /**
3
+ * Represents a molad, the moment when the new moon is "born"
4
+ */
5
+ export type MoladBase = {
6
+ /** Hebrew date */
7
+ readonly hdate: HDate;
8
+ /** hour of day (0-23) */
9
+ readonly hour: number;
10
+ /** minutes past hour (0-59) */
11
+ readonly minutes: number;
12
+ /** parts of a minute (0-17) */
13
+ readonly chalakim: number;
14
+ };
15
+ export declare function calculateMolad(year: number, month: number): MoladBase;