@hebcal/core 6.3.0 → 6.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/bundle.js +62 -41
  2. package/dist/bundle.js.map +1 -1
  3. package/dist/bundle.min.js +6 -6
  4. package/dist/bundle.min.js.map +1 -1
  5. package/dist/esm/DailyLearning.js +1 -1
  6. package/dist/esm/HebrewDateEvent.js +1 -1
  7. package/dist/esm/HolidayEvent.js +1 -1
  8. package/dist/esm/MevarchimChodeshEvent.js +1 -1
  9. package/dist/esm/ParshaEvent.js +1 -1
  10. package/dist/esm/TimedEvent.js +13 -8
  11. package/dist/esm/TimedEvent.js.map +1 -1
  12. package/dist/esm/YomKippurKatanEvent.js +1 -1
  13. package/dist/esm/ashkenazi.po.js +1 -1
  14. package/dist/esm/calendar.js +17 -10
  15. package/dist/esm/calendar.js.map +1 -1
  16. package/dist/esm/candles.js +4 -3
  17. package/dist/esm/candles.js.map +1 -1
  18. package/dist/esm/event.js +1 -1
  19. package/dist/esm/getStartAndEnd.js +1 -1
  20. package/dist/esm/hallel.js +1 -1
  21. package/dist/esm/he-x-NoNikud.po.js +1 -1
  22. package/dist/esm/he.po.d.ts +2 -0
  23. package/dist/esm/he.po.js +2 -2
  24. package/dist/esm/he.po.js.map +1 -1
  25. package/dist/esm/hebcal.js +1 -1
  26. package/dist/esm/holidays.js +1 -1
  27. package/dist/esm/index.js +1 -1
  28. package/dist/esm/isAssurBemlacha.js +1 -1
  29. package/dist/esm/locale.js +1 -1
  30. package/dist/esm/location.d.ts +7 -0
  31. package/dist/esm/location.js +8 -1
  32. package/dist/esm/location.js.map +1 -1
  33. package/dist/esm/modern.js +1 -1
  34. package/dist/esm/molad.js +1 -1
  35. package/dist/esm/moladBase.js +1 -1
  36. package/dist/esm/moladDate.js +1 -1
  37. package/dist/esm/omer.js +3 -3
  38. package/dist/esm/omer.js.map +1 -1
  39. package/dist/esm/parshaName.js +1 -1
  40. package/dist/esm/parshaYear.js +1 -1
  41. package/dist/esm/pkgVersion.d.ts +1 -1
  42. package/dist/esm/pkgVersion.js +2 -2
  43. package/dist/esm/pkgVersion.js.map +1 -1
  44. package/dist/esm/reformatTimeStr.js +1 -1
  45. package/dist/esm/sedra.js +1 -1
  46. package/dist/esm/sefira.json.js +2 -2
  47. package/dist/esm/staticHolidays.d.ts +14 -0
  48. package/dist/esm/staticHolidays.js +22 -1
  49. package/dist/esm/staticHolidays.js.map +1 -1
  50. package/dist/esm/tachanun.js +1 -1
  51. package/dist/esm/zmanim.d.ts +1 -1
  52. package/dist/esm/zmanim.js +10 -19
  53. package/dist/esm/zmanim.js.map +1 -1
  54. package/dist/src/TimedEvent.js +12 -7
  55. package/dist/src/calendar.js +16 -9
  56. package/dist/src/candles.js +3 -2
  57. package/dist/src/he.po.d.ts +2 -0
  58. package/dist/src/he.po.js +1 -1
  59. package/dist/src/location.d.ts +7 -0
  60. package/dist/src/location.js +7 -0
  61. package/dist/src/omer.js +2 -2
  62. package/dist/src/pkgVersion.d.ts +1 -1
  63. package/dist/src/pkgVersion.js +1 -1
  64. package/dist/src/sefira.json +1 -9
  65. package/dist/src/staticHolidays.d.ts +14 -0
  66. package/dist/src/staticHolidays.js +21 -0
  67. package/dist/src/zmanim.d.ts +1 -1
  68. package/dist/src/zmanim.js +8 -17
  69. package/package.json +3 -3
@@ -8,15 +8,7 @@
8
8
  "אֶרֶץ נָתְנָה יְבוּלָהּ יְבָרְכֵנוּ אֱלֹהִים אֱלֹהֵינוּ",
9
9
  "יְבָרְכֵנוּ אֱלֹהִים וְיִירְאוּ אוֹתוֹ כָּל־אַפְסֵי־אָרֶץ"
10
10
  ],
11
- "lamnatzeachLetters": [
12
- "י", "ש", "מ", "ח", "ו", "ו", "י",
13
- "ר", "נ", "נ", "ו", "ל", "א", "מ",
14
- "י", "ם", "כ", "י", "ת", "ש", "פ",
15
- "ו", "ט", "ע", "מ", "י", "ם", "מ",
16
- "י", "ש", "ו", "ר", "ו", "ל", "א",
17
- "מ", "י", "ם", "ב", "א", "ר", "ץ",
18
- "ת", "נ", "ח", "ם", "ס", "ל", "ה"
19
- ],
11
+ "lamnatzeachLetters": "ישמחווירננולאמיםכיתשפוטעמיםמישורולאמיםבארץתנחםסלה",
20
12
  "anaBekoach": [
21
13
  "אָנָּא",
22
14
  "בְּכֹחַ",
@@ -152,6 +152,20 @@ export declare const holidayDesc: {
152
152
  readonly YOM_KIPPUR: "Yom Kippur";
153
153
  /** Yom Yerushalayim */
154
154
  readonly YOM_YERUSHALAYIM: "Yom Yerushalayim";
155
+ /** Candle lighting */
156
+ readonly CANDLE_LIGHTING: "Candle lighting";
157
+ /** Havdalah */
158
+ readonly HAVDALAH: "Havdalah";
159
+ /** Fast begins */
160
+ readonly FAST_BEGINS: "Fast begins";
161
+ /** Fast ends */
162
+ readonly FAST_ENDS: "Fast ends";
163
+ /** Biur Chametz */
164
+ readonly BIUR_CHAMETZ: "Biur Chametz";
165
+ /** Finish eating chametz */
166
+ readonly SOF_ZMAN_ACHILAT_CHAMETZ: "Finish eating chametz";
167
+ /** Yizkor */
168
+ readonly YIZKOR: "Yizkor";
155
169
  };
156
170
  export interface Holiday {
157
171
  mm: number;
@@ -71,6 +71,13 @@ const SIGD = 'Sigd';
71
71
  const YOM_HAALIYAH = 'Yom HaAliyah';
72
72
  const YOM_HAALIYAH_SCHOOL_OBSERVANCE = 'Yom HaAliyah School Observance';
73
73
  const HEBREW_LANGUAGE_DAY = 'Hebrew Language Day';
74
+ const CANDLE_LIGHTING = 'Candle lighting';
75
+ const HAVDALAH = 'Havdalah';
76
+ const FAST_BEGINS = 'Fast begins';
77
+ const FAST_ENDS = 'Fast ends';
78
+ const BIUR_CHAMETZ = 'Biur Chametz';
79
+ const SOF_ZMAN_ACHILAT_CHAMETZ = 'Finish eating chametz';
80
+ const YIZKOR = 'Yizkor';
74
81
  /**
75
82
  * Transliterated names of holidays, used by `Event.getDesc()`
76
83
  * @readonly
@@ -225,6 +232,20 @@ export const holidayDesc = {
225
232
  YOM_KIPPUR,
226
233
  /** Yom Yerushalayim */
227
234
  YOM_YERUSHALAYIM,
235
+ /** Candle lighting */
236
+ CANDLE_LIGHTING,
237
+ /** Havdalah */
238
+ HAVDALAH,
239
+ /** Fast begins */
240
+ FAST_BEGINS,
241
+ /** Fast ends */
242
+ FAST_ENDS,
243
+ /** Biur Chametz */
244
+ BIUR_CHAMETZ,
245
+ /** Finish eating chametz */
246
+ SOF_ZMAN_ACHILAT_CHAMETZ,
247
+ /** Yizkor */
248
+ YIZKOR,
228
249
  };
229
250
  export const staticHolidays = [
230
251
  {
@@ -28,6 +28,7 @@ import { HDate } from '@hebcal/hdate';
28
28
  * const timeStr = Zmanim.formatISOWithTimeZone(tzid, candleLighting);
29
29
  */
30
30
  export declare class Zmanim {
31
+ private readonly hdate;
31
32
  private readonly plainDate;
32
33
  private readonly gloc;
33
34
  private readonly noaa;
@@ -328,7 +329,6 @@ export declare class Zmanim {
328
329
  * returned.
329
330
  */
330
331
  private getMoladBasedTime;
331
- private getHDate;
332
332
  /**
333
333
  * Returns the latest time of Kiddush Levana according to the <a
334
334
  * href="https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin">Maharil's</a> opinion that it is calculated as
@@ -13,13 +13,6 @@ function zdtToDate(zdt) {
13
13
  res.setMilliseconds(0);
14
14
  return res;
15
15
  }
16
- function getDate(date) {
17
- if (isDate(date))
18
- return date;
19
- if (HDate.isHDate(date))
20
- return date.greg();
21
- throw new TypeError(`invalid date: ${date}`);
22
- }
23
16
  /**
24
17
  * The zenith of astronomical sunrise and sunset. The sun is 90&deg; from the vertical 0&deg;
25
18
  */
@@ -60,6 +53,7 @@ const ZENITH_1_POINT_583 = GEOMETRIC_ZENITH + 1.583;
60
53
  * const timeStr = Zmanim.formatISOWithTimeZone(tzid, candleLighting);
61
54
  */
62
55
  export class Zmanim {
56
+ hdate;
63
57
  plainDate;
64
58
  gloc;
65
59
  noaa;
@@ -76,7 +70,8 @@ export class Zmanim {
76
70
  * These zmanim intentionally do not support elevation adjustment.
77
71
  */
78
72
  constructor(gloc, date, useElevation) {
79
- const dt = getDate(date);
73
+ this.hdate = new HDate(date);
74
+ const dt = isDate(date) ? date : this.hdate.greg();
80
75
  this.plainDate = Temporal.PlainDate.from({
81
76
  year: dt.getFullYear(),
82
77
  month: dt.getMonth() + 1,
@@ -551,10 +546,6 @@ export class Zmanim {
551
546
  // It's the night, the provided time is valid
552
547
  return moladBasedTime.withTimeZone(this.gloc.getTimeZone());
553
548
  }
554
- getHDate() {
555
- const dt = new Date(this.plainDate.year, this.plainDate.month - 1, this.plainDate.day);
556
- return new HDate(dt);
557
- }
558
549
  /**
559
550
  * Returns the latest time of Kiddush Levana according to the <a
560
551
  * href="https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin">Maharil's</a> opinion that it is calculated as
@@ -576,7 +567,7 @@ export class Zmanim {
576
567
  * day, a `null` will be returned.
577
568
  */
578
569
  getSofZmanKidushLevanaBetweenMoldos(alos = null, tzais = null) {
579
- const hd = this.getHDate();
570
+ const hd = this.hdate;
580
571
  // Do not calculate for impossible dates, but account for extreme cases. In the extreme case of Rapa Iti in French
581
572
  // Polynesia on Dec 2027 when kiddush Levana 3 days can be said on _Rosh Chodesh_, the sof zman Kiddush Levana
582
573
  // will be on the 12th of the Teves. In the case of Anadyr, Russia on Jan, 2071, sof zman Kiddush Levana between the
@@ -605,7 +596,7 @@ export class Zmanim {
605
596
  *
606
597
  */
607
598
  getSofZmanKidushLevana15Days(alos = null, tzais = null) {
608
- const hd = this.getHDate();
599
+ const hd = this.hdate;
609
600
  // Do not calculate for impossible dates, but account for extreme cases. In the extreme case of Rapa Iti in
610
601
  // French Polynesia on Dec 2027 when kiddush Levana 3 days can be said on _Rosh Chodesh_, the sof zman Kiddush
611
602
  // Levana will be on the 12th of the Teves. in the case of Anadyr, Russia on Jan, 2071, sof zman kiddush levana will
@@ -637,7 +628,7 @@ export class Zmanim {
637
628
  * `null` will be returned.
638
629
  */
639
630
  getTchilasZmanKidushLevana3Days(alos = null, tzais = null) {
640
- const hd = this.getHDate();
631
+ const hd = this.hdate;
641
632
  // Do not calculate for impossible dates, but account for extreme cases. Tchilas zman kiddush Levana 3 days for
642
633
  // the extreme case of Rapa Iti in French Polynesia on Dec 2027 when kiddush Levana 3 days can be said on the evening
643
634
  // of the 30th, the second night of Rosh Chodesh. The 3rd day after the _molad_ will be on the 4th of the month.
@@ -667,7 +658,7 @@ export class Zmanim {
667
658
  *
668
659
  */
669
660
  getZmanMolad() {
670
- const hd = this.getHDate();
661
+ const hd = this.hdate;
671
662
  // Optimize to not calculate for impossible dates, but account for extreme cases. The molad in the extreme case of Rapa
672
663
  // Iti in French Polynesia on Dec 2027 occurs on the night of the 27th of Kislev. In the case of Anadyr, Russia on
673
664
  // Jan 2071, the molad will be on the 2nd day of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).
@@ -693,7 +684,7 @@ export class Zmanim {
693
684
  * will not occur on this day, a `null` will be returned.
694
685
  */
695
686
  getTchilasZmanKidushLevana7Days(alos = null, tzais = null) {
696
- const hd = this.getHDate();
687
+ const hd = this.hdate;
697
688
  // Optimize to not calculate for impossible dates, but account for extreme cases. Tchilas zman kiddush Levana 7 days for
698
689
  // the extreme case of Rapa Iti in French Polynesia on Jan 2028 (when kiddush Levana 3 days can be said on the evening
699
690
  // of the 30th, the second night of Rosh Chodesh), the 7th day after the molad will be on the 4th of the month.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hebcal/core",
3
- "version": "6.3.0",
3
+ "version": "6.3.1",
4
4
  "author": "Michael J. Radwin (https://github.com/mjradwin)",
5
5
  "contributors": [
6
6
  "Eyal Schachter (https://github.com/Scimonster)",
@@ -77,11 +77,11 @@
77
77
  "gettext-parser": "^9.0.2",
78
78
  "gts": "^7.0.0",
79
79
  "pretty-bytes": "^7.1.0",
80
- "rollup": "^4.60.1",
80
+ "rollup": "^4.60.2",
81
81
  "rollup-plugin-bundle-size": "^1.0.3",
82
82
  "rollup-plugin-visualizer": "^7.0.1",
83
83
  "typedoc": "^0.28.19",
84
- "typescript": "^6.0.2",
84
+ "typescript": "^6.0.3",
85
85
  "vitest": "^4.1.4"
86
86
  },
87
87
  "dependencies": {