@hebcal/core 6.1.0 → 6.2.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 (88) hide show
  1. package/dist/bundle.js +203 -18
  2. package/dist/bundle.js.map +1 -1
  3. package/dist/bundle.min.js +5 -5
  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 +1 -1
  11. package/dist/esm/YomKippurKatanEvent.js +1 -1
  12. package/dist/esm/ashkenazi.po.js +1 -1
  13. package/dist/esm/calendar.js +1 -1
  14. package/dist/esm/candles.js +1 -1
  15. package/dist/esm/event.js +1 -1
  16. package/dist/esm/getStartAndEnd.js +1 -1
  17. package/dist/esm/hallel.js +1 -1
  18. package/dist/esm/he-x-NoNikud.po.d.ts +2 -0
  19. package/dist/esm/he-x-NoNikud.po.js +2 -2
  20. package/dist/esm/he-x-NoNikud.po.js.map +1 -1
  21. package/dist/esm/he.po.js +2 -2
  22. package/dist/esm/he.po.js.map +1 -1
  23. package/dist/esm/hebcal.js +1 -1
  24. package/dist/esm/holidays.js +1 -1
  25. package/dist/esm/index.js +1 -1
  26. package/dist/esm/isAssurBemlacha.js +1 -1
  27. package/dist/esm/locale.js +1 -1
  28. package/dist/esm/location.js +1 -1
  29. package/dist/esm/modern.js +1 -1
  30. package/dist/esm/molad.js +1 -1
  31. package/dist/esm/moladBase.js +1 -1
  32. package/dist/esm/moladDate.js +1 -1
  33. package/dist/esm/omer.js +1 -1
  34. package/dist/esm/parshaName.js +1 -1
  35. package/dist/esm/parshaYear.js +1 -1
  36. package/dist/esm/pkgVersion.d.ts +1 -1
  37. package/dist/esm/pkgVersion.js +2 -2
  38. package/dist/esm/pkgVersion.js.map +1 -1
  39. package/dist/esm/reformatTimeStr.js +1 -1
  40. package/dist/esm/sedra.js +1 -1
  41. package/dist/esm/staticHolidays.js +1 -1
  42. package/dist/esm/tachanun.js +1 -1
  43. package/dist/esm/zmanim.d.ts +159 -11
  44. package/dist/esm/zmanim.js +200 -15
  45. package/dist/esm/zmanim.js.map +1 -1
  46. package/dist/src/he-x-NoNikud.po.d.ts +2 -0
  47. package/dist/src/he-x-NoNikud.po.js +1 -1
  48. package/dist/src/he.po.js +1 -1
  49. package/dist/src/pkgVersion.d.ts +1 -1
  50. package/dist/src/pkgVersion.js +1 -1
  51. package/dist/src/zmanim.d.ts +159 -11
  52. package/dist/src/zmanim.js +199 -14
  53. package/package.json +1 -1
  54. package/dist/CalOptions.d.ts +0 -168
  55. package/dist/DailyLearning.d.ts +0 -32
  56. package/dist/HebrewDateEvent.d.ts +0 -37
  57. package/dist/HolidayEvent.d.ts +0 -84
  58. package/dist/MevarchimChodeshEvent.d.ts +0 -26
  59. package/dist/ParshaEvent.d.ts +0 -19
  60. package/dist/TimedEvent.d.ts +0 -47
  61. package/dist/YomKippurKatanEvent.d.ts +0 -23
  62. package/dist/ashkenazi.po.d.ts +0 -82
  63. package/dist/calendar.d.ts +0 -111
  64. package/dist/candles.d.ts +0 -44
  65. package/dist/event.d.ts +0 -188
  66. package/dist/getStartAndEnd.d.ts +0 -6
  67. package/dist/hallel.d.ts +0 -6
  68. package/dist/he-x-NoNikud.po.d.ts +0 -16
  69. package/dist/he.po.d.ts +0 -215
  70. package/dist/hebcal.d.ts +0 -260
  71. package/dist/holidays.d.ts +0 -22
  72. package/dist/index.d.ts +0 -28
  73. package/dist/isAssurBemlacha.d.ts +0 -9
  74. package/dist/locale.d.ts +0 -1
  75. package/dist/location.d.ts +0 -73
  76. package/dist/modern.d.ts +0 -18
  77. package/dist/molad.d.ts +0 -132
  78. package/dist/moladBase.d.ts +0 -15
  79. package/dist/moladDate.d.ts +0 -12
  80. package/dist/omer.d.ts +0 -52
  81. package/dist/parshaName.d.ts +0 -2
  82. package/dist/parshaYear.d.ts +0 -9
  83. package/dist/pkgVersion.d.ts +0 -2
  84. package/dist/reformatTimeStr.d.ts +0 -8
  85. package/dist/sedra.d.ts +0 -95
  86. package/dist/staticHolidays.d.ts +0 -176
  87. package/dist/tachanun.d.ts +0 -29
  88. package/dist/zmanim.d.ts +0 -460
@@ -136,12 +136,13 @@ export declare class Zmanim {
136
136
  * the result is not impacted by elevation.
137
137
  */
138
138
  misheyakirMachmir(): Date;
139
+ private getShaahZmanisBasedZmanZdt;
139
140
  /**
140
141
  * Utility method for using elevation-aware sunrise/sunset
141
142
  * @private
142
143
  * @param hours
143
144
  */
144
- getShaahZmanisBasedZman(hours: number): Date;
145
+ private getShaahZmanisBasedZman;
145
146
  /**
146
147
  * Latest Shema (Gra); Sunrise plus 3 halachic hours, according to the Gra.
147
148
  * If elevation is enabled, this function will include elevation in the calculation.
@@ -311,7 +312,7 @@ export declare class Zmanim {
311
312
  * is it the start of _Kiddush Levana_ time or the end? If it is start roll it to the next _tzais_,
312
313
  * and if it is the end, return the end of the previous night (_alos_ passed in). Ignored if either
313
314
  * _alos_ or _tzais_ are null.
314
- * @return the _molad_ based time. If the _zman_ does not occur during the current date, <code>null</code> will be
315
+ * @return the _molad_ based time. If the _zman_ does not occur during the current date, `null` will be
315
316
  * returned.
316
317
  */
317
318
  private getMoladBasedTime;
@@ -322,7 +323,7 @@ export declare class Zmanim {
322
323
  * halfway between _molad_ and _molad_. This adds half the 29 days, 12 hours and 793 chalakim time between
323
324
  * _molad_ and _molad_ (14 days, 18 hours, 22 minutes and 666 milliseconds) to the month's _molad_.
324
325
  * The _sof zman Kiddush Levana_ will be returned even if it occurs during the day. To limit the time to between
325
- * _tzais_ and _alos_, see {@link #getSofZmanKidushLevanaBetweenMoldos(Date, Date)}.
326
+ * _tzais_ and _alos_, see {@link getSofZmanKidushLevanaBetweenMoldos}.
326
327
  *
327
328
  * @param alos
328
329
  * the beginning of the Jewish day. If _Kidush Levana_ occurs during the day (starting at _alos_ and
@@ -334,7 +335,7 @@ export declare class Zmanim {
334
335
  * adjustment will be made.
335
336
  * @return the Date representing the moment halfway between molad and molad. If the time occurs between
336
337
  * _alos_ and _tzais_, _alos_ will be returned. If the _zman_ will not occur on this
337
- * day, a <code>null</code> will be returned.
338
+ * day, a `null` will be returned.
338
339
  */
339
340
  getSofZmanKidushLevanaBetweenMoldos(alos?: Temporal.ZonedDateTime | null, tzais?: Temporal.ZonedDateTime | null): Temporal.ZonedDateTime | null;
340
341
  /**
@@ -342,15 +343,15 @@ export declare class Zmanim {
342
343
  * the Shulchan Aruch (Orach Chaim 426). It should be noted that some opinions hold that the
343
344
  * <a href="https://en.wikipedia.org/wiki/Moses_Isserles">Rema</a> who brings down the opinion of the <a
344
345
  * href="https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin">Maharil's</a> of calculating
345
- * {@link #getSofZmanKidushLevanaBetweenMoldos(Date, Date) half way between _molad_ and _molad_} is of
346
+ * {@link getSofZmanKidushLevanaBetweenMoldos half way between _molad_ and _molad_} is of
346
347
  * the opinion that the Mechaber agrees to his opinion. Also see the Aruch Hashulchan. For additional details on the subject,
347
348
  * See Rabbi Dovid Heber's very detailed write-up in Siman Daled (chapter 4) of <a href="https://hebrewbooks.org/53000">Shaarei
348
349
  * Zmanim</a>. The _sof zman Kiddush Levana_ will be returned even if it occurs during the day. To limit the time to
349
- * between _tzais_ and _alos_, see {@link #getSofZmanKidushLevana15Days(Date, Date)}.
350
+ * between _tzais_ and _alos_, see {@link getSofZmanKidushLevana15Days}.
350
351
  *
351
352
  * @return the Date representing the moment 15 days after the _molad_. If the time occurs between
352
353
  * _alos_ and _tzais_, _alos_ will be returned. If the _zman_ will not occur on this day, a
353
- * <code>null</code> will be returned.
354
+ * `null` will be returned.
354
355
  *
355
356
  *
356
357
  */
@@ -373,7 +374,7 @@ export declare class Zmanim {
373
374
  *
374
375
  * @return the Date representing the moment 3 days after the molad. If the time occurs between _alos_ and
375
376
  * _tzais_, _tzais_ will be returned. If the _zman_ will not occur on this day, a
376
- * <code>null</code> will be returned.
377
+ * `null` will be returned.
377
378
  */
378
379
  getTchilasZmanKidushLevana3Days(alos?: Temporal.ZonedDateTime | null, tzais?: Temporal.ZonedDateTime | null): Temporal.ZonedDateTime | null;
379
380
  /**
@@ -382,19 +383,166 @@ export declare class Zmanim {
382
383
  * {@link HebrewDateFormatter} that will have formatting for this.
383
384
  *
384
385
  * @return the Date representing the moment of the molad. If the _molad_ does not occur on this day, a
385
- * <code>null</code> will be returned.
386
+ * `null` will be returned.
386
387
  *
387
388
  */
388
389
  getZmanMolad(): Temporal.ZonedDateTime | null;
389
390
  /**
390
391
  * Returns the earliest time of _Kiddush Levana_ according to the opinions that it should not be said until 7
391
392
  * days after the _molad_. The time will be returned even if it occurs during the day when _Kiddush Levana_
392
- * can't be recited. Use {@link #getTchilasZmanKidushLevana7Days(Date, Date)} if you want to limit the time to night hours.
393
+ * can't be recited. Use {@link getTchilasZmanKidushLevana7Days} if you want to limit the time to night hours.
393
394
  *
394
395
  * @return the Date representing the moment 7 days after the molad regardless of it is day or night. If the _zman_
395
- * will not occur on this day, a <code>null</code> will be returned.
396
+ * will not occur on this day, a `null` will be returned.
396
397
  */
397
398
  getTchilasZmanKidushLevana7Days(alos?: Temporal.ZonedDateTime | null, tzais?: Temporal.ZonedDateTime | null): Temporal.ZonedDateTime | null;
399
+ /**
400
+ * A method that returns the <a href="https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi">Baal Hatanya</a>'s
401
+ * _netz amiti_ (sunrise) without
402
+ * elevation adjustment. This forms the base for the Baal Hatanya's dawn-based calculations that are
403
+ * calculated as a dip below the horizon before sunrise.
404
+ *
405
+ * According to the Baal Hatanya, _netz amiti_, or true (halachic) sunrise, is when the top of the sun's
406
+ * disk is visible at an elevation similar to the mountains of Eretz Yisrael. The time is calculated as the point at which
407
+ * the center of the sun's disk is 1.583&deg; below the horizon. This degree-based calculation can be found in Rabbi Shalom
408
+ * DovBer Levine's commentary on The <a href="https://www.chabadlibrary.org/books/pdf/Seder-Hachnosas-Shabbos.pdf">Baal
409
+ * Hatanya's Seder Hachnasas Shabbos</a>. From an elevation of 546 meters, the top of <a href=
410
+ * "https://en.wikipedia.org/wiki/Mount_Carmel">Har Hacarmel</a>, the sun disappears when it is 1&deg; 35' or 1.583&deg;
411
+ * below the sea level horizon. This in turn is based on the Gemara <a href=
412
+ * "https://hebrewbooks.org/shas.aspx?mesechta=2&daf=35">Shabbos 35a</a>. There are other opinions brought down by
413
+ * Rabbi Levine, including Rabbi Yosef Yitzchok Feigelstock who calculates it as the degrees below the horizon 4 minutes after
414
+ * sunset in Yerushalayim (on the equinox). That is brought down as 1.583&deg;. This is identical to the 1&deg; 35' _zman_
415
+ * and is probably a typo and should be 1.683&deg;. These calculations are used by most <a href=
416
+ * "https://en.wikipedia.org/wiki/Chabad">Chabad</a> calendars that use the Baal Hatanya's _zmanim_. See
417
+ * <a href="https://www.chabad.org/library/article_cdo/aid/3209349/jewish/About-Our-Zmanim-Calculations.htm">About Our
418
+ * _Zmanim_ Calculations @ Chabad.org</a>.
419
+ *
420
+ * Note: _netz amiti_ is used only for calculating certain _zmanim_, and is intentionally unpublished. For
421
+ * practical purposes, daytime _mitzvos_ like _shofar_ and _lulav_ should not be done until after the
422
+ * published time for _netz_ / sunrise.
423
+ *
424
+ * @return the <code>Date</code> representing the exact sea level _netz amiti_ (sunrise) time. If the calculation can't be
425
+ * computed such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
426
+ * where it does not set, a `null` will be returned. See detailed explanation on top of the page.
427
+ *
428
+ * @see ZENITH_1_POINT_583
429
+ */
430
+ private getSunriseBaalHatanya;
431
+ /**
432
+ * A method that returns the <a href="https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi">Baal Hatanya</a>'s
433
+ * _shkiah amiti_ (sunset) without
434
+ * elevation adjustment. This forms the base for the Baal Hatanya's dusk-based calculations that are calculated
435
+ * as a dip below the horizon after sunset.
436
+ *
437
+ * According to the Baal Hatanya, _shkiah amiti_, true (_halachic_) sunset, is when the top of the
438
+ * sun's disk disappears from view at an elevation similar to the mountains of _Eretz Yisrael_.
439
+ * This time is calculated as the point at which the center of the sun's disk is 1.583 degrees below the horizon.
440
+ *
441
+ * Note: _shkiah amiti_ is used only for calculating certain _zmanim_, and is intentionally unpublished. For
442
+ * practical purposes, all daytime mitzvos should be completed before the published time for _shkiah_ / sunset.
443
+ *
444
+ * For further explanation of the calculations used for the Baal Hatanya's _zmanim_ in this library, see
445
+ * <a href="https://www.chabad.org/library/article_cdo/aid/3209349/jewish/About-Our-Zmanim-Calculations.htm">About Our
446
+ * _Zmanim_ Calculations @ Chabad.org</a>.
447
+ *
448
+ * @return the <code>Date</code> representing the exact sea level _shkiah amiti_ (sunset) time. If the calculation
449
+ * can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does not
450
+ * rise, and one where it does not set, a `null` will be returned.
451
+ *
452
+ * @see ZENITH_1_POINT_583
453
+ */
454
+ private getSunsetBaalHatanya;
455
+ /**
456
+ * Returns the <a href="https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi">Baal Hatanya</a>'s _alos_
457
+ * (dawn) calculated as the time when the sun is 16.9&deg; below the eastern {@link GEOMETRIC_ZENITH geometric horizon}
458
+ * before {@link getSunrise() sunrise}.
459
+ *
460
+ * The zenith of 16.9&deg; below is based on the calculation that the time between dawn
461
+ * and <em>netz amiti</em> (sunrise) is 72 minutes, the time that is takes to walk 4 mil at 18 minutes
462
+ * a mil (<a href="https://en.wikipedia.org/wiki/Maimonides">Rambam</a> and others). The sun's position at 72
463
+ * minutes before {@link getSunriseBaalHatanya <em>netz amiti</em> (sunrise)} in Jerusalem <a href=
464
+ * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a> is
465
+ * 16.9&deg; below {@link GEOMETRIC_ZENITH geometric zenith}.
466
+ *
467
+ * @return The <code>Date</code> of dawn. If the calculation can't be computed such as northern and southern
468
+ * locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may not reach
469
+ * low enough below the horizon for this calculation, a `null` will be returned. */
470
+ alosBaalHatanya(): Date;
471
+ private getShaahZmanisBaalHatanya;
472
+ /**
473
+ * This method returns the latest _zman krias shema_ (time to recite Shema in the morning). This time is 3
474
+ * {@link shaahZmanisBaalHatanya() _shaos zmaniyos_} (solar hours) after {@link getSunriseBaalHatanya()
475
+ * _netz amiti_ (sunrise)} based on the opinion of the Baal Hatanya that the day is calculated from
476
+ * sunrise to sunset. This returns the time 3 * {@link getShaahZmanisBaalHatanya()} after {@link getSunriseBaalHatanya()
477
+ * _netz amiti_ (sunrise)}.
478
+ *
479
+ * @return the <code>Date</code> of the latest _zman shema_ according to the Baal Hatanya. If the calculation
480
+ * can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does
481
+ * not rise, and one where it does not set, a `null` will be returned.
482
+ */
483
+ sofZmanShmaBaalHatanya(): Date;
484
+ /**
485
+ * This method returns the latest _zman tfilah_ (time to recite the morning prayers). This time is 4
486
+ * hours into the day based on the opinion of the Baal Hatanya that the day is
487
+ * calculated from sunrise to sunset. This returns the time 4 * {@link getShaahZmanisBaalHatanya()} after
488
+ * {@link getSunriseBaalHatanya() _netz amiti_ (sunrise)}.
489
+ *
490
+ * @return the <code>Date</code> of the latest _zman tfilah_. If the calculation can't be computed such as in
491
+ * the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
492
+ * not set, a `null` will be returned.
493
+ */
494
+ sofZmanTfilaBaalHatanya(): Date;
495
+ /**
496
+ * This method returns the time of _mincha gedola_. _Mincha gedola_ is the earliest time one can pray
497
+ * _mincha_. The <a href="https://en.wikipedia.org/wiki/Maimonides">Rambam</a> is of the opinion that it is
498
+ * better to delay _mincha_ until {@link minchaKetanaBaalHatanya() _mincha ketana_} while the
499
+ * <a href="https://en.wikipedia.org/wiki/Asher_ben_Jehiel">Ra"sh</a>,
500
+ * <a href="https://en.wikipedia.org/wiki/Jacob_ben_Asher">Tur</a>, <a href=
501
+ * "https://en.wikipedia.org/wiki/Vilna_Gaon">GRA</a> and others are of the opinion that _mincha_ can be prayed
502
+ * _lechatchila_ starting at _mincha gedola_. This is calculated as 6.5 {@link getShaahZmanisBaalHatanya()
503
+ * sea level solar hours} after {@link getSunriseBaalHatanya() _netz amiti_ (sunrise)}. This calculation is based
504
+ * on the opinion of the Baal Hatanya that the day is calculated from sunrise to sunset. This returns the time 6.5
505
+ * * {@link getShaahZmanisBaalHatanya()} after {@link getSunriseBaalHatanya() _netz amiti_ ("real" sunrise)}.
506
+ * @return the <code>Date</code> of the time of _mincha gedola_ according to the Baal Hatanya. If the calculation
507
+ * can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does not rise,
508
+ * and one where it does not set, a `null` will be returned.
509
+ */
510
+ minchaGedolaBaalHatanya(): Date;
511
+ /**
512
+ * This method returns the time of _mincha ketana_. This is the preferred earliest time to pray
513
+ * _mincha_ in the opinion of the <a href="https://en.wikipedia.org/wiki/Maimonides">Rambam</a> and others.
514
+ * For more information on this see the documentation on {@link minchaGedolaBaalHatanya() _mincha gedola_}.
515
+ * This is calculated as 9.5 sea level solar hours after {@link getSunriseBaalHatanya
516
+ * _netz amiti_ (sunrise)}. This calculation is calculated based on the opinion of the Baal Hatanya that the
517
+ * day is calculated from sunrise to sunset. This returns the time 9.5 * after
518
+ * _netz amiti_ (sunrise).
519
+ *
520
+ * @return the <code>Date</code> of the time of _mincha ketana_. If the calculation can't be computed such as
521
+ * in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
522
+ * does not set, a `null` will be returned.
523
+ */
524
+ minchaKetanaBaalHatanya(): Date;
525
+ /**
526
+ * This method returns the time of _plag hamincha_. This is calculated as 10.75 hours after sunrise. This
527
+ * calculation is based on the opinion of the Baal Hatanya that the day is calculated
528
+ * from sunrise to sunset. This returns the time 10.75 * {@link getShaahZmanisBaalHatanya()} after
529
+ * {@link getSunriseBaalHatanya() _netz amiti_ (sunrise)}.
530
+ *
531
+ * @return the <code>Date</code> of the time of _plag hamincha_. If the calculation can't be computed such as
532
+ * in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
533
+ * does not set, a `null` will be returned.
534
+ */
535
+ plagHaminchaBaalHatanya(): Date;
536
+ /**
537
+ * A method that returns _tzais_ (nightfall) when the sun is 6&deg; below the western geometric horizon
538
+ * (90&deg;) after {@link getSunset() sunset}. For information on the source of this calculation see
539
+ * {@link ZENITH_6_DEGREES}.
540
+ *
541
+ * @return The <code>Date</code> of nightfall. If the calculation can't be computed such as northern and southern
542
+ * locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may not reach
543
+ * low enough below the horizon for this calculation, a `null` will be returned. * @see ZENITH_6_DEGREES
544
+ */
545
+ tzaisBaalHatanya(): Date;
398
546
  /**
399
547
  * Uses timeFormat to return a date like '20:34'.
400
548
  * Returns `XX:XX` if the date is invalid.
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.1.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.2.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import 'temporal-polyfill/global';
3
3
  import { NOAACalculator } from '@hebcal/noaa';
4
4
  import { HDate, getTimezoneOffset, pad2, getPseudoISO, isDate } from '@hebcal/hdate';
@@ -22,6 +22,19 @@ function getDate(date) {
22
22
  return date.greg();
23
23
  throw new TypeError(`invalid date: ${date}`);
24
24
  }
25
+ /**
26
+ * The zenith of astronomical sunrise and sunset. The sun is 90&deg; from the vertical 0&deg;
27
+ */
28
+ const GEOMETRIC_ZENITH = 90;
29
+ /**
30
+ * The zenith of 1.583&deg; below {@link GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for
31
+ * calculating _netz amiti_ (sunrise) and _shkiah amiti_ (sunset) based on the opinion of the
32
+ * <a href="https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi">Baal Hatanya</a>.
33
+ *
34
+ * @see Zmanim.sunriseBaalHatanya()
35
+ * @see Zmanim.sunsetBaalHatanya()
36
+ */
37
+ const ZENITH_1_POINT_583 = GEOMETRIC_ZENITH + 1.583;
25
38
  /**
26
39
  * Calculate halachic times (zmanim / זְמַנִּים) for a given day and location.
27
40
  * Calculations are available for tzeit / tzais (nightfall),
@@ -97,7 +110,7 @@ class Zmanim {
97
110
  * @param rising
98
111
  */
99
112
  timeAtAngle(angle, rising) {
100
- const offsetZenith = 90 + angle;
113
+ const offsetZenith = GEOMETRIC_ZENITH + angle;
101
114
  const zdt = rising
102
115
  ? this.noaa.getSunriseOffsetByDegrees(offsetZenith)
103
116
  : this.noaa.getSunsetOffsetByDegrees(offsetZenith);
@@ -229,6 +242,12 @@ class Zmanim {
229
242
  misheyakirMachmir() {
230
243
  return this.timeAtAngle(10.2, true);
231
244
  }
245
+ getShaahZmanisBasedZmanZdt(startOfDay, endOfDay, hours) {
246
+ const temporalHour = this.noaa.getTemporalHour(startOfDay, endOfDay);
247
+ const offset = Math.trunc(temporalHour * hours);
248
+ const zdt = NOAACalculator.getTimeOffset(startOfDay, offset);
249
+ return zdt;
250
+ }
232
251
  /**
233
252
  * Utility method for using elevation-aware sunrise/sunset
234
253
  * @private
@@ -241,9 +260,7 @@ class Zmanim {
241
260
  const endOfDay = this.useElevation
242
261
  ? this.noaa.getSunset()
243
262
  : this.noaa.getSeaLevelSunset();
244
- const temporalHour = this.noaa.getTemporalHour(startOfDay, endOfDay);
245
- const offset = Math.round(temporalHour * hours);
246
- const zdt = NOAACalculator.getTimeOffset(startOfDay, offset);
263
+ const zdt = this.getShaahZmanisBasedZmanZdt(startOfDay, endOfDay, hours);
247
264
  return zdtToDate(zdt);
248
265
  }
249
266
  /**
@@ -500,7 +517,7 @@ class Zmanim {
500
517
  * is it the start of _Kiddush Levana_ time or the end? If it is start roll it to the next _tzais_,
501
518
  * and if it is the end, return the end of the previous night (_alos_ passed in). Ignored if either
502
519
  * _alos_ or _tzais_ are null.
503
- * @return the _molad_ based time. If the _zman_ does not occur during the current date, <code>null</code> will be
520
+ * @return the _molad_ based time. If the _zman_ does not occur during the current date, `null` will be
504
521
  * returned.
505
522
  */
506
523
  getMoladBasedTime(moladBasedTime, alos, tzais, techila) {
@@ -532,7 +549,7 @@ class Zmanim {
532
549
  * halfway between _molad_ and _molad_. This adds half the 29 days, 12 hours and 793 chalakim time between
533
550
  * _molad_ and _molad_ (14 days, 18 hours, 22 minutes and 666 milliseconds) to the month's _molad_.
534
551
  * The _sof zman Kiddush Levana_ will be returned even if it occurs during the day. To limit the time to between
535
- * _tzais_ and _alos_, see {@link #getSofZmanKidushLevanaBetweenMoldos(Date, Date)}.
552
+ * _tzais_ and _alos_, see {@link getSofZmanKidushLevanaBetweenMoldos}.
536
553
  *
537
554
  * @param alos
538
555
  * the beginning of the Jewish day. If _Kidush Levana_ occurs during the day (starting at _alos_ and
@@ -544,7 +561,7 @@ class Zmanim {
544
561
  * adjustment will be made.
545
562
  * @return the Date representing the moment halfway between molad and molad. If the time occurs between
546
563
  * _alos_ and _tzais_, _alos_ will be returned. If the _zman_ will not occur on this
547
- * day, a <code>null</code> will be returned.
564
+ * day, a `null` will be returned.
548
565
  */
549
566
  getSofZmanKidushLevanaBetweenMoldos(alos = null, tzais = null) {
550
567
  const hd = this.getHDate();
@@ -563,15 +580,15 @@ class Zmanim {
563
580
  * the Shulchan Aruch (Orach Chaim 426). It should be noted that some opinions hold that the
564
581
  * <a href="https://en.wikipedia.org/wiki/Moses_Isserles">Rema</a> who brings down the opinion of the <a
565
582
  * href="https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin">Maharil's</a> of calculating
566
- * {@link #getSofZmanKidushLevanaBetweenMoldos(Date, Date) half way between _molad_ and _molad_} is of
583
+ * {@link getSofZmanKidushLevanaBetweenMoldos half way between _molad_ and _molad_} is of
567
584
  * the opinion that the Mechaber agrees to his opinion. Also see the Aruch Hashulchan. For additional details on the subject,
568
585
  * See Rabbi Dovid Heber's very detailed write-up in Siman Daled (chapter 4) of <a href="https://hebrewbooks.org/53000">Shaarei
569
586
  * Zmanim</a>. The _sof zman Kiddush Levana_ will be returned even if it occurs during the day. To limit the time to
570
- * between _tzais_ and _alos_, see {@link #getSofZmanKidushLevana15Days(Date, Date)}.
587
+ * between _tzais_ and _alos_, see {@link getSofZmanKidushLevana15Days}.
571
588
  *
572
589
  * @return the Date representing the moment 15 days after the _molad_. If the time occurs between
573
590
  * _alos_ and _tzais_, _alos_ will be returned. If the _zman_ will not occur on this day, a
574
- * <code>null</code> will be returned.
591
+ * `null` will be returned.
575
592
  *
576
593
  *
577
594
  */
@@ -605,7 +622,7 @@ class Zmanim {
605
622
  *
606
623
  * @return the Date representing the moment 3 days after the molad. If the time occurs between _alos_ and
607
624
  * _tzais_, _tzais_ will be returned. If the _zman_ will not occur on this day, a
608
- * <code>null</code> will be returned.
625
+ * `null` will be returned.
609
626
  */
610
627
  getTchilasZmanKidushLevana3Days(alos = null, tzais = null) {
611
628
  const hd = this.getHDate();
@@ -634,7 +651,7 @@ class Zmanim {
634
651
  * {@link HebrewDateFormatter} that will have formatting for this.
635
652
  *
636
653
  * @return the Date representing the moment of the molad. If the _molad_ does not occur on this day, a
637
- * <code>null</code> will be returned.
654
+ * `null` will be returned.
638
655
  *
639
656
  */
640
657
  getZmanMolad() {
@@ -658,10 +675,10 @@ class Zmanim {
658
675
  /**
659
676
  * Returns the earliest time of _Kiddush Levana_ according to the opinions that it should not be said until 7
660
677
  * days after the _molad_. The time will be returned even if it occurs during the day when _Kiddush Levana_
661
- * can't be recited. Use {@link #getTchilasZmanKidushLevana7Days(Date, Date)} if you want to limit the time to night hours.
678
+ * can't be recited. Use {@link getTchilasZmanKidushLevana7Days} if you want to limit the time to night hours.
662
679
  *
663
680
  * @return the Date representing the moment 7 days after the molad regardless of it is day or night. If the _zman_
664
- * will not occur on this day, a <code>null</code> will be returned.
681
+ * will not occur on this day, a `null` will be returned.
665
682
  */
666
683
  getTchilasZmanKidushLevana7Days(alos = null, tzais = null) {
667
684
  const hd = this.getHDate();
@@ -676,6 +693,174 @@ class Zmanim {
676
693
  const molad = new Molad(hd.getFullYear(), hd.getMonth());
677
694
  return this.getMoladBasedTime(molad.getTchilasZmanKidushLevana7Days(), alos, tzais, true);
678
695
  }
696
+ /**
697
+ * A method that returns the <a href="https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi">Baal Hatanya</a>'s
698
+ * _netz amiti_ (sunrise) without
699
+ * elevation adjustment. This forms the base for the Baal Hatanya's dawn-based calculations that are
700
+ * calculated as a dip below the horizon before sunrise.
701
+ *
702
+ * According to the Baal Hatanya, _netz amiti_, or true (halachic) sunrise, is when the top of the sun's
703
+ * disk is visible at an elevation similar to the mountains of Eretz Yisrael. The time is calculated as the point at which
704
+ * the center of the sun's disk is 1.583&deg; below the horizon. This degree-based calculation can be found in Rabbi Shalom
705
+ * DovBer Levine's commentary on The <a href="https://www.chabadlibrary.org/books/pdf/Seder-Hachnosas-Shabbos.pdf">Baal
706
+ * Hatanya's Seder Hachnasas Shabbos</a>. From an elevation of 546 meters, the top of <a href=
707
+ * "https://en.wikipedia.org/wiki/Mount_Carmel">Har Hacarmel</a>, the sun disappears when it is 1&deg; 35' or 1.583&deg;
708
+ * below the sea level horizon. This in turn is based on the Gemara <a href=
709
+ * "https://hebrewbooks.org/shas.aspx?mesechta=2&daf=35">Shabbos 35a</a>. There are other opinions brought down by
710
+ * Rabbi Levine, including Rabbi Yosef Yitzchok Feigelstock who calculates it as the degrees below the horizon 4 minutes after
711
+ * sunset in Yerushalayim (on the equinox). That is brought down as 1.583&deg;. This is identical to the 1&deg; 35' _zman_
712
+ * and is probably a typo and should be 1.683&deg;. These calculations are used by most <a href=
713
+ * "https://en.wikipedia.org/wiki/Chabad">Chabad</a> calendars that use the Baal Hatanya's _zmanim_. See
714
+ * <a href="https://www.chabad.org/library/article_cdo/aid/3209349/jewish/About-Our-Zmanim-Calculations.htm">About Our
715
+ * _Zmanim_ Calculations @ Chabad.org</a>.
716
+ *
717
+ * Note: _netz amiti_ is used only for calculating certain _zmanim_, and is intentionally unpublished. For
718
+ * practical purposes, daytime _mitzvos_ like _shofar_ and _lulav_ should not be done until after the
719
+ * published time for _netz_ / sunrise.
720
+ *
721
+ * @return the <code>Date</code> representing the exact sea level _netz amiti_ (sunrise) time. If the calculation can't be
722
+ * computed such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
723
+ * where it does not set, a `null` will be returned. See detailed explanation on top of the page.
724
+ *
725
+ * @see ZENITH_1_POINT_583
726
+ */
727
+ getSunriseBaalHatanya() {
728
+ return this.noaa.getSunriseOffsetByDegrees(ZENITH_1_POINT_583);
729
+ }
730
+ /**
731
+ * A method that returns the <a href="https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi">Baal Hatanya</a>'s
732
+ * _shkiah amiti_ (sunset) without
733
+ * elevation adjustment. This forms the base for the Baal Hatanya's dusk-based calculations that are calculated
734
+ * as a dip below the horizon after sunset.
735
+ *
736
+ * According to the Baal Hatanya, _shkiah amiti_, true (_halachic_) sunset, is when the top of the
737
+ * sun's disk disappears from view at an elevation similar to the mountains of _Eretz Yisrael_.
738
+ * This time is calculated as the point at which the center of the sun's disk is 1.583 degrees below the horizon.
739
+ *
740
+ * Note: _shkiah amiti_ is used only for calculating certain _zmanim_, and is intentionally unpublished. For
741
+ * practical purposes, all daytime mitzvos should be completed before the published time for _shkiah_ / sunset.
742
+ *
743
+ * For further explanation of the calculations used for the Baal Hatanya's _zmanim_ in this library, see
744
+ * <a href="https://www.chabad.org/library/article_cdo/aid/3209349/jewish/About-Our-Zmanim-Calculations.htm">About Our
745
+ * _Zmanim_ Calculations @ Chabad.org</a>.
746
+ *
747
+ * @return the <code>Date</code> representing the exact sea level _shkiah amiti_ (sunset) time. If the calculation
748
+ * can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does not
749
+ * rise, and one where it does not set, a `null` will be returned.
750
+ *
751
+ * @see ZENITH_1_POINT_583
752
+ */
753
+ getSunsetBaalHatanya() {
754
+ return this.noaa.getSunsetOffsetByDegrees(ZENITH_1_POINT_583);
755
+ }
756
+ /**
757
+ * Returns the <a href="https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi">Baal Hatanya</a>'s _alos_
758
+ * (dawn) calculated as the time when the sun is 16.9&deg; below the eastern {@link GEOMETRIC_ZENITH geometric horizon}
759
+ * before {@link getSunrise() sunrise}.
760
+ *
761
+ * The zenith of 16.9&deg; below is based on the calculation that the time between dawn
762
+ * and <em>netz amiti</em> (sunrise) is 72 minutes, the time that is takes to walk 4 mil at 18 minutes
763
+ * a mil (<a href="https://en.wikipedia.org/wiki/Maimonides">Rambam</a> and others). The sun's position at 72
764
+ * minutes before {@link getSunriseBaalHatanya <em>netz amiti</em> (sunrise)} in Jerusalem <a href=
765
+ * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a> is
766
+ * 16.9&deg; below {@link GEOMETRIC_ZENITH geometric zenith}.
767
+ *
768
+ * @return The <code>Date</code> of dawn. If the calculation can't be computed such as northern and southern
769
+ * locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may not reach
770
+ * low enough below the horizon for this calculation, a `null` will be returned. */
771
+ alosBaalHatanya() {
772
+ return this.timeAtAngle(16.9, true);
773
+ }
774
+ getShaahZmanisBaalHatanya(hours) {
775
+ const zdt = this.getShaahZmanisBasedZmanZdt(this.getSunriseBaalHatanya(), this.getSunsetBaalHatanya(), hours);
776
+ return zdtToDate(zdt);
777
+ }
778
+ /**
779
+ * This method returns the latest _zman krias shema_ (time to recite Shema in the morning). This time is 3
780
+ * {@link shaahZmanisBaalHatanya() _shaos zmaniyos_} (solar hours) after {@link getSunriseBaalHatanya()
781
+ * _netz amiti_ (sunrise)} based on the opinion of the Baal Hatanya that the day is calculated from
782
+ * sunrise to sunset. This returns the time 3 * {@link getShaahZmanisBaalHatanya()} after {@link getSunriseBaalHatanya()
783
+ * _netz amiti_ (sunrise)}.
784
+ *
785
+ * @return the <code>Date</code> of the latest _zman shema_ according to the Baal Hatanya. If the calculation
786
+ * can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does
787
+ * not rise, and one where it does not set, a `null` will be returned.
788
+ */
789
+ sofZmanShmaBaalHatanya() {
790
+ return this.getShaahZmanisBaalHatanya(3);
791
+ }
792
+ /**
793
+ * This method returns the latest _zman tfilah_ (time to recite the morning prayers). This time is 4
794
+ * hours into the day based on the opinion of the Baal Hatanya that the day is
795
+ * calculated from sunrise to sunset. This returns the time 4 * {@link getShaahZmanisBaalHatanya()} after
796
+ * {@link getSunriseBaalHatanya() _netz amiti_ (sunrise)}.
797
+ *
798
+ * @return the <code>Date</code> of the latest _zman tfilah_. If the calculation can't be computed such as in
799
+ * the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
800
+ * not set, a `null` will be returned.
801
+ */
802
+ sofZmanTfilaBaalHatanya() {
803
+ return this.getShaahZmanisBaalHatanya(4);
804
+ }
805
+ /**
806
+ * This method returns the time of _mincha gedola_. _Mincha gedola_ is the earliest time one can pray
807
+ * _mincha_. The <a href="https://en.wikipedia.org/wiki/Maimonides">Rambam</a> is of the opinion that it is
808
+ * better to delay _mincha_ until {@link minchaKetanaBaalHatanya() _mincha ketana_} while the
809
+ * <a href="https://en.wikipedia.org/wiki/Asher_ben_Jehiel">Ra"sh</a>,
810
+ * <a href="https://en.wikipedia.org/wiki/Jacob_ben_Asher">Tur</a>, <a href=
811
+ * "https://en.wikipedia.org/wiki/Vilna_Gaon">GRA</a> and others are of the opinion that _mincha_ can be prayed
812
+ * _lechatchila_ starting at _mincha gedola_. This is calculated as 6.5 {@link getShaahZmanisBaalHatanya()
813
+ * sea level solar hours} after {@link getSunriseBaalHatanya() _netz amiti_ (sunrise)}. This calculation is based
814
+ * on the opinion of the Baal Hatanya that the day is calculated from sunrise to sunset. This returns the time 6.5
815
+ * * {@link getShaahZmanisBaalHatanya()} after {@link getSunriseBaalHatanya() _netz amiti_ ("real" sunrise)}.
816
+ * @return the <code>Date</code> of the time of _mincha gedola_ according to the Baal Hatanya. If the calculation
817
+ * can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does not rise,
818
+ * and one where it does not set, a `null` will be returned.
819
+ */
820
+ minchaGedolaBaalHatanya() {
821
+ return this.getShaahZmanisBaalHatanya(6.5);
822
+ }
823
+ /**
824
+ * This method returns the time of _mincha ketana_. This is the preferred earliest time to pray
825
+ * _mincha_ in the opinion of the <a href="https://en.wikipedia.org/wiki/Maimonides">Rambam</a> and others.
826
+ * For more information on this see the documentation on {@link minchaGedolaBaalHatanya() _mincha gedola_}.
827
+ * This is calculated as 9.5 sea level solar hours after {@link getSunriseBaalHatanya
828
+ * _netz amiti_ (sunrise)}. This calculation is calculated based on the opinion of the Baal Hatanya that the
829
+ * day is calculated from sunrise to sunset. This returns the time 9.5 * after
830
+ * _netz amiti_ (sunrise).
831
+ *
832
+ * @return the <code>Date</code> of the time of _mincha ketana_. If the calculation can't be computed such as
833
+ * in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
834
+ * does not set, a `null` will be returned.
835
+ */
836
+ minchaKetanaBaalHatanya() {
837
+ return this.getShaahZmanisBaalHatanya(9.5);
838
+ }
839
+ /**
840
+ * This method returns the time of _plag hamincha_. This is calculated as 10.75 hours after sunrise. This
841
+ * calculation is based on the opinion of the Baal Hatanya that the day is calculated
842
+ * from sunrise to sunset. This returns the time 10.75 * {@link getShaahZmanisBaalHatanya()} after
843
+ * {@link getSunriseBaalHatanya() _netz amiti_ (sunrise)}.
844
+ *
845
+ * @return the <code>Date</code> of the time of _plag hamincha_. If the calculation can't be computed such as
846
+ * in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
847
+ * does not set, a `null` will be returned.
848
+ */
849
+ plagHaminchaBaalHatanya() {
850
+ return this.getShaahZmanisBaalHatanya(10.75);
851
+ }
852
+ /**
853
+ * A method that returns _tzais_ (nightfall) when the sun is 6&deg; below the western geometric horizon
854
+ * (90&deg;) after {@link getSunset() sunset}. For information on the source of this calculation see
855
+ * {@link ZENITH_6_DEGREES}.
856
+ *
857
+ * @return The <code>Date</code> of nightfall. If the calculation can't be computed such as northern and southern
858
+ * locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may not reach
859
+ * low enough below the horizon for this calculation, a `null` will be returned. * @see ZENITH_6_DEGREES
860
+ */
861
+ tzaisBaalHatanya() {
862
+ return this.timeAtAngle(6, false);
863
+ }
679
864
  /**
680
865
  * Uses timeFormat to return a date like '20:34'.
681
866
  * Returns `XX:XX` if the date is invalid.