@hebcal/core 6.11.1 → 6.13.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 (91) hide show
  1. package/dist/bundle.js +1682 -1915
  2. package/dist/bundle.js.map +1 -1
  3. package/dist/bundle.min.js +18 -19
  4. package/dist/bundle.min.js.map +1 -1
  5. package/dist/esm/DailyLearning.js +5 -15
  6. package/dist/esm/DailyLearning.js.map +1 -1
  7. package/dist/esm/HebrewDateEvent.d.ts +0 -4
  8. package/dist/esm/HebrewDateEvent.js +2 -6
  9. package/dist/esm/HebrewDateEvent.js.map +1 -1
  10. package/dist/esm/HolidayEvent.js +6 -10
  11. package/dist/esm/HolidayEvent.js.map +1 -1
  12. package/dist/esm/MevarchimChodeshEvent.js +2 -2
  13. package/dist/esm/MevarchimChodeshEvent.js.map +1 -1
  14. package/dist/esm/ParshaEvent.js +4 -4
  15. package/dist/esm/ParshaEvent.js.map +1 -1
  16. package/dist/esm/TimedEvent.js +4 -5
  17. package/dist/esm/TimedEvent.js.map +1 -1
  18. package/dist/esm/YomKippurKatanEvent.js +2 -2
  19. package/dist/esm/YomKippurKatanEvent.js.map +1 -1
  20. package/dist/esm/ashkenazi.po.js +1 -1
  21. package/dist/esm/calendar.js +7 -40
  22. package/dist/esm/calendar.js.map +1 -1
  23. package/dist/esm/candles.d.ts +3 -5
  24. package/dist/esm/candles.js +6 -20
  25. package/dist/esm/candles.js.map +1 -1
  26. package/dist/esm/cities.json.js +1 -1
  27. package/dist/esm/event.js +4 -6
  28. package/dist/esm/event.js.map +1 -1
  29. package/dist/esm/getStartAndEnd.d.ts +1 -1
  30. package/dist/esm/getStartAndEnd.js +8 -9
  31. package/dist/esm/getStartAndEnd.js.map +1 -1
  32. package/dist/esm/hallel.d.ts +1 -3
  33. package/dist/esm/hallel.js +2 -4
  34. package/dist/esm/hallel.js.map +1 -1
  35. package/dist/esm/he-x-NoNikud.po.d.ts +1 -0
  36. package/dist/esm/he-x-NoNikud.po.js +2 -2
  37. package/dist/esm/he-x-NoNikud.po.js.map +1 -1
  38. package/dist/esm/he.po.d.ts +1 -0
  39. package/dist/esm/he.po.js +2 -2
  40. package/dist/esm/he.po.js.map +1 -1
  41. package/dist/esm/hebcal.js +6 -12
  42. package/dist/esm/hebcal.js.map +1 -1
  43. package/dist/esm/holidays.d.ts +1 -1
  44. package/dist/esm/holidays.js +111 -131
  45. package/dist/esm/holidays.js.map +1 -1
  46. package/dist/esm/index.js +1 -1
  47. package/dist/esm/isAssurBemlacha.js +5 -18
  48. package/dist/esm/isAssurBemlacha.js.map +1 -1
  49. package/dist/esm/isAveilut.js +2 -5
  50. package/dist/esm/isAveilut.js.map +1 -1
  51. package/dist/esm/isFastDay.js +3 -4
  52. package/dist/esm/isFastDay.js.map +1 -1
  53. package/dist/esm/locale.js +1 -1
  54. package/dist/esm/location.js +2 -7
  55. package/dist/esm/location.js.map +1 -1
  56. package/dist/esm/modern.d.ts +8 -13
  57. package/dist/esm/modern.js +142 -17
  58. package/dist/esm/modern.js.map +1 -1
  59. package/dist/esm/molad.js +2 -2
  60. package/dist/esm/molad.js.map +1 -1
  61. package/dist/esm/moladBase.js +2 -3
  62. package/dist/esm/moladBase.js.map +1 -1
  63. package/dist/esm/moladDate.js +1 -1
  64. package/dist/esm/moladDate.js.map +1 -1
  65. package/dist/esm/omer.js +22 -28
  66. package/dist/esm/omer.js.map +1 -1
  67. package/dist/esm/parshaName.d.ts +1 -1
  68. package/dist/esm/parshaName.js +3 -4
  69. package/dist/esm/parshaName.js.map +1 -1
  70. package/dist/esm/parshaYear.js +1 -1
  71. package/dist/esm/pkgVersion.d.ts +1 -1
  72. package/dist/esm/pkgVersion.js +2 -2
  73. package/dist/esm/pkgVersion.js.map +1 -1
  74. package/dist/esm/reformatTimeStr.js +17 -16
  75. package/dist/esm/reformatTimeStr.js.map +1 -1
  76. package/dist/esm/sedra.d.ts +0 -2
  77. package/dist/esm/sedra.js +19 -28
  78. package/dist/esm/sedra.js.map +1 -1
  79. package/dist/esm/sefira.json.js +1 -1
  80. package/dist/esm/staticHolidays.d.ts +8 -14
  81. package/dist/esm/staticHolidays.js +179 -470
  82. package/dist/esm/staticHolidays.js.map +1 -1
  83. package/dist/esm/string.js +1 -1
  84. package/dist/esm/tachanun.js +2 -6
  85. package/dist/esm/tachanun.js.map +1 -1
  86. package/dist/esm/zmanim.d.ts +0 -2
  87. package/dist/esm/zmanim.js +19 -22
  88. package/dist/esm/zmanim.js.map +1 -1
  89. package/package.json +7 -7
  90. package/po/he-x-NoNikud.po +3 -0
  91. package/po/he.po +3 -0
@@ -1 +1 @@
1
- {"version":3,"file":"zmanim.js","sources":["../../../src/zmanim.ts"],"sourcesContent":["import 'temporal-polyfill/global';\nimport {GeoLocation, NOAACalculator} from '@hebcal/noaa';\nimport {HDate, getPseudoISO, getTimezoneOffset, isDate, pad2} from '@hebcal/hdate';\nimport {Molad} from './molad.js';\n\n/**\n * Converts an instant to a `Date`, discarding milliseconds.\n *\n * Zmanim are read out to the minute, and every accessor here reduces to an\n * instant, so we ask `@hebcal/noaa` for epoch milliseconds rather than a\n * `Temporal.ZonedDateTime`. Resolving the IANA zone to build a\n * `ZonedDateTime` costs roughly 750ns and nothing downstream uses it, which\n * made it the single most expensive step in a sunrise/sunset calculation.\n * @private\n */\nfunction millisToDate(millis: number): Date {\n const res = new Date(millis);\n // UTC setter: a local-time setter re-resolves the wall-clock time and, in\n // the repeated hour at the end of DST in the process time zone, would move\n // the instant an hour earlier. See hebcal/hebcal-es6#786.\n res.setUTCMilliseconds(0);\n return res;\n}\n\n/**\n * The zenith of astronomical sunrise and sunset. The sun is 90° from the vertical 0°\n */\nconst GEOMETRIC_ZENITH: number = 90;\n\n/**\n * The zenith of 1.583° below geometric zenith (90°). This calculation is used for\n * calculating _netz amiti_ (sunrise) and _shkiah amiti_ (sunset) based on the opinion of the\n * [Baal Hatanya](https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi).\n *\n * @see Zmanim.sunriseBaalHatanya\n * @see Zmanim.sunsetBaalHatanya\n */\nconst ZENITH_1_POINT_583: number = GEOMETRIC_ZENITH + 1.583;\n\n/**\n * The zenith of civil twilight; the sun is 6° below the horizon.\n * Matches `NOAACalculator.CIVIL_ZENITH`.\n */\nconst CIVIL_ZENITH: number = GEOMETRIC_ZENITH + 6;\n\n/**\n * Length of one temporal (halachic) hour in milliseconds, i.e. one twelfth of\n * the day. Mirrors `NOAACalculator.getTemporalHour()`, including its floor, so\n * that results stay identical to the `ZonedDateTime` code path.\n * @private\n */\nfunction temporalHourMillis(startOfDay: number, endOfDay: number): number {\n return Math.floor((endOfDay - startOfDay) / 12);\n}\n\n/**\n * Calculate halachic times (zmanim / זְמַנִּים) for a given day and location.\n * Calculations are available for tzeit / tzais (nightfall),\n * shkiah (sunset) and more.\n *\n * Zmanim are estimated using an algorithm published by the US National Oceanic\n * and Atmospheric Administration. The NOAA solar calculator is based on equations\n * from _Astronomical Algorithms_ by Jean Meeus.\n *\n * The sunrise and sunset results are theoretically accurate to within a minute for\n * locations between +/- 72° latitude, and within 10 minutes outside of those latitudes.\n * However, due to variations in atmospheric composition, temperature, pressure and\n * conditions, observed values may vary from calculations.\n * https://gml.noaa.gov/grad/solcalc/calcdetails.html\n *\n * @example\n * import {GeoLocation, Zmanim} from '@hebcal/core';\n * const latitude = 41.822232;\n * const longitude = -71.448292;\n * const tzid = 'America/New_York';\n * const friday = new Date(2023, 8, 8);\n * const gloc = new GeoLocation(null, latitude, longitude, 0, tzid);\n * const zmanim = new Zmanim(gloc, friday, false);\n * const candleLighting = zmanim.sunsetOffset(-18, true);\n * const timeStr = Zmanim.formatISOWithTimeZone(tzid, candleLighting);\n * // '2023-09-08T18:49:00-04:00'\n */\nexport class Zmanim {\n private readonly hdate: HDate;\n private readonly plainDate: Temporal.PlainDate;\n private readonly gloc: GeoLocation;\n private readonly noaa: NOAACalculator;\n private useElevation: boolean;\n /**\n * Initialize a Zmanim instance.\n * @param gloc GeoLocation including latitude, longitude, and timezone\n * @param date Regular or Hebrew Date. If `date` is a regular `Date`,\n * hours, minutes, seconds and milliseconds are ignored.\n * @param useElevation use elevation for calculations (default `false`).\n * If `true`, use elevation to affect the calculation of all sunrise/sunset based\n * zmanim. Note: there are some zmanim such as degree-based zmanim that are driven\n * by the amount of light in the sky and are not impacted by elevation.\n * These zmanim intentionally do not support elevation adjustment.\n */\n constructor(gloc: GeoLocation, date: Date | HDate, useElevation: boolean) {\n this.hdate = new HDate(date);\n const dt = isDate(date) ? date : this.hdate.greg();\n // The constructor is ~1.8x cheaper than PlainDate.from(), which has to\n // walk a property bag and apply overflow handling. The fields come from a\n // real Date, so they are always in range and never need constraining.\n this.plainDate = new Temporal.PlainDate(\n dt.getFullYear(),\n dt.getMonth() + 1,\n dt.getDate()\n );\n this.gloc = gloc;\n this.noaa = new NOAACalculator(gloc, this.plainDate);\n this.useElevation = Boolean(useElevation);\n }\n /**\n * Returns `true` if this instance uses the location's elevation when\n * calculating sunrise/sunset-based zmanim.\n */\n getUseElevation(): boolean {\n return this.useElevation;\n }\n /**\n * Enables or disables elevation adjustment for sunrise/sunset-based zmanim.\n *\n * Degree-based zmanim (such as {@link alotHaShachar} or {@link tzeit})\n * estimate the amount of light in the sky and are never affected by this\n * setting.\n * @param useElevation `true` to include the location's elevation\n */\n setUseElevation(useElevation: boolean) {\n this.useElevation = useElevation;\n }\n /**\n * Convenience function to get the time when sun is above or below the horizon\n * for a certain angle (in degrees).\n * This function does not support elevation adjustment.\n * @param angle degrees of solar depression below the horizon; for example\n * `8.5` means the center of the sun is 8.5° below the horizon\n * @param rising `true` for the morning (before sunrise), `false` for the\n * evening (after sunset)\n */\n timeAtAngle(angle: number, rising: boolean): Date {\n const offsetZenith = GEOMETRIC_ZENITH + angle;\n return millisToDate(\n rising\n ? this.sunriseMillis(offsetZenith, true)\n : this.sunsetMillis(offsetZenith, true)\n );\n }\n /**\n * Sunrise for a given zenith as epoch milliseconds, mirroring what\n * `NOAACalculator.getSunrise()` / `getSeaLevelSunrise()` /\n * `getSunriseOffsetByDegrees()` compute, minus the `ZonedDateTime`.\n *\n * Note that noaa's degree-based accessors pass `adjustForElevation = true`\n * as well; the adjustment is a no-op unless the zenith is exactly\n * {@link GEOMETRIC_ZENITH}, which is why degree-based zmanim are unaffected\n * by elevation.\n * @private\n */\n private sunriseMillis(zenith: number, useElevation: boolean): number {\n const utc = useElevation\n ? this.noaa.getUTCSunrise0(zenith)\n : this.noaa.getUTCSeaLevelSunrise(zenith);\n return this.noaa.getEpochMillisFromTime(utc, true);\n }\n /**\n * Sunset counterpart of {@link sunriseMillis}.\n * @private\n */\n private sunsetMillis(zenith: number, useElevation: boolean): number {\n const utc = useElevation\n ? this.noaa.getUTCSunset0(zenith)\n : this.noaa.getUTCSeaLevelSunset(zenith);\n return this.noaa.getEpochMillisFromTime(utc, false);\n }\n /**\n * Upper edge of the Sun appears over the eastern horizon in the morning (0.833° above horizon)\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n sunrise(): Date {\n return millisToDate(this.sunriseMillis(GEOMETRIC_ZENITH, this.useElevation));\n }\n /**\n * Upper edge of the Sun appears over the eastern horizon in the morning (0.833° above horizon).\n * This function does not support elevation adjustment.\n */\n seaLevelSunrise(): Date {\n return millisToDate(this.sunriseMillis(GEOMETRIC_ZENITH, false));\n }\n /**\n * When the upper edge of the Sun disappears below the horizon (0.833° below horizon).\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n sunset(): Date {\n return millisToDate(this.sunsetMillis(GEOMETRIC_ZENITH, this.useElevation));\n }\n /**\n * When the upper edge of the Sun disappears below the horizon (0.833° below horizon).\n * This function does not support elevation adjustment.\n */\n seaLevelSunset(): Date {\n return millisToDate(this.sunsetMillis(GEOMETRIC_ZENITH, false));\n }\n /**\n * Civil dawn; Sun is 6° below the horizon in the morning.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n dawn(): Date {\n return millisToDate(this.sunriseMillis(CIVIL_ZENITH, true));\n }\n /**\n * Civil dusk; Sun is 6° below the horizon in the evening.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n dusk(): Date {\n return millisToDate(this.sunsetMillis(CIVIL_ZENITH, true));\n }\n /**\n * Returns sunset for the previous day.\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n gregEve(): Date {\n const prev0 = this.plainDate.subtract({days: 1});\n const prev = new Date(prev0.year, prev0.month - 1, prev0.day);\n const zman = new Zmanim(this.gloc, prev, this.useElevation);\n return zman.sunset();\n }\n /**\n * Length in milliseconds of one halachic hour of the night, calculated as\n * one twelfth of the time between the previous day's sunset and this\n * day's sunrise. Used internally by {@link chatzotNight}.\n */\n nightHour(): number {\n return (this.sunrise().getTime() - this.gregEve().getTime()) / 12; // ms in hour\n }\n /**\n * Midday – Chatzot; Sunrise plus 6 halachic hours.\n *\n * Unlike most sunrise/sunset-based zmanim, this is always computed from\n * sea-level sunrise and sunset, so it is not affected by the\n * `useElevation` setting.\n */\n chatzot(): Date {\n const startOfDay = this.sunriseMillis(GEOMETRIC_ZENITH, false);\n const endOfDay = this.sunsetMillis(GEOMETRIC_ZENITH, false);\n // NOAACalculator.getSunTransit(): sunrise plus 6 temporal hours\n return millisToDate(startOfDay + temporalHourMillis(startOfDay, endOfDay) * 6);\n }\n /**\n * Midnight – Chatzot; Sunset plus 6 halachic hours.\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n chatzotNight(): Date {\n return new Date(this.sunrise().getTime() - this.nightHour() * 6);\n }\n /**\n * Dawn – Alot haShachar; Sun is 16.1° below the horizon in the morning.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n alotHaShachar(): Date {\n return this.timeAtAngle(16.1, true);\n }\n /**\n * Dawn – Alot haShachar; calculated as 72 minutes before sunrise or\n * sea level sunrise.\n */\n alotHaShachar72(): Date {\n return this.sunriseOffset(-72, false, false);\n }\n /**\n * Same as {@link alotHaShachar72}, but returns a `Temporal.ZonedDateTime`\n * with seconds precision (instead of a `Date` rounded to the minute), or\n * `null` if sunrise cannot be calculated for this date and location.\n */\n alotHaShachar72zdt(): Temporal.ZonedDateTime | null {\n const zdt = this.useElevation\n ? this.noaa.getSunrise()\n : this.noaa.getSeaLevelSunrise();\n if (!zdt) {\n return null;\n }\n return zdt.subtract({minutes: 72});\n }\n\n /**\n * Earliest talis & tefillin – Misheyakir; Sun is 11.5° below the horizon in the morning.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n misheyakir(): Date {\n return this.timeAtAngle(11.5, true);\n }\n /**\n * Earliest talis & tefillin – Misheyakir Machmir; Sun is 10.2° below the horizon in the morning.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n misheyakirMachmir(): Date {\n return this.timeAtAngle(10.2, true);\n }\n private getShaahZmanisBasedZmanMillis(\n startOfDay: number,\n endOfDay: number,\n hours: number\n ): number {\n const offset = Math.trunc(temporalHourMillis(startOfDay, endOfDay) * hours);\n return startOfDay + offset;\n }\n /**\n * Utility method for using elevation-aware sunrise/sunset\n * @param hours number of _shaos zmaniyos_ (solar hours) after sunrise\n */\n private getShaahZmanisBasedZman(hours: number): Date {\n const startOfDay = this.sunriseMillis(GEOMETRIC_ZENITH, this.useElevation);\n const endOfDay = this.sunsetMillis(GEOMETRIC_ZENITH, this.useElevation);\n return millisToDate(\n this.getShaahZmanisBasedZmanMillis(startOfDay, endOfDay, hours)\n );\n }\n /**\n * Latest Shema (Gra); Sunrise plus 3 halachic hours, according to the Gra.\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n sofZmanShma(): Date {\n // Gra\n return this.getShaahZmanisBasedZman(3);\n }\n /**\n * Latest Shacharit (Gra); Sunrise plus 4 halachic hours, according to the Gra.\n *\n * This method returns the latest *zman tfila* (time to recite the morning prayers)\n * that is 4 *shaos zmaniyos* (solar hours) after sunrise or sea level sunrise\n * (depending on the `useElevation` setting), according\n * to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).\n *\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n sofZmanTfilla(): Date {\n // Gra\n return this.getShaahZmanisBasedZman(4);\n }\n /**\n * This method returns the latest time for burning _chametz_ on _Erev Pesach_ according to the opinion\n * of the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon). This time is 5 halachic hours into the day, based on\n * the opinion of the GRA that the day is calculated from sunrise to sunset.\n *\n * If elevation is enabled, this function will include elevation in the calculation.\n * @return the `Date` of the latest time for burning _chametz_ on _Erev Pesach_. If the calculation can't be\n * computed, such as in the Arctic Circle where there is at least one day a year where the sun does not\n * rise and one where it does not set, an `Invalid Date` will be returned.\n */\n sofZmanBiurChametzGRA(): Date {\n return this.getShaahZmanisBasedZman(5);\n }\n /**\n * Returns a 2-element array with alot (a `Date`, 72 minutes before sunrise)\n * and the length in milliseconds of one halachic hour of the resulting day.\n * Used internally by the Magen Avraham zmanim.\n * @param forceSeaLevel ignore the `useElevation` setting and use sea-level\n * sunrise and sunset\n */\n getTemporalHour72(forceSeaLevel: boolean): [Date, number] {\n const alot72 = this.sunriseOffset(-72, false, forceSeaLevel);\n const tzeit72 = this.sunsetOffset(72, false, forceSeaLevel);\n const temporalHour = (tzeit72.getTime() - alot72.getTime()) / 12;\n return [alot72, temporalHour];\n }\n /**\n * Returns a 2-element array with alot (a `Date`, when the sun is `angle`\n * degrees below the horizon in the morning) and the length in milliseconds\n * of one halachic hour of the resulting day. Used internally by the\n * degree-based Magen Avraham zmanim.\n * @param angle degrees of solar depression below the horizon\n */\n getTemporalHourByDeg(angle: number): [Date, number] {\n const alot = this.timeAtAngle(angle, true);\n const tzeit = this.timeAtAngle(angle, false);\n const temporalHour = (tzeit.getTime() - alot.getTime()) / 12;\n return [alot, temporalHour];\n }\n /**\n * Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.\n * Based on the opinion of the MGA that the day is calculated from\n * dawn being fixed 72 minutes before sea-level sunrise, and nightfall is fixed\n * 72 minutes after sea-level sunset.\n */\n sofZmanShmaMGA(): Date {\n // Magen Avraham\n const [alot72, temporalHour] = this.getTemporalHour72(true);\n const offset = Math.floor(3 * temporalHour);\n return new Date(alot72.getTime() + offset);\n }\n /**\n * Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.\n * Based on the opinion of the MGA that the day is calculated from\n * dawn to nightfall with both being 16.1° below the horizon.\n */\n sofZmanShmaMGA16Point1(): Date {\n const [alot, temporalHour] = this.getTemporalHourByDeg(16.1);\n const offset = Math.floor(3 * temporalHour);\n return new Date(alot.getTime() + offset);\n }\n /**\n * Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.\n * Based on the opinion of the MGA that the day is calculated from\n * dawn to nightfall with both being 19.8° below the horizon.\n *\n * This calculation is based on the position of the sun 90 minutes after sunset in Jerusalem\n * around the equinox / equilux which calculates to 19.8° below geometric zenith.\n * https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/\n */\n sofZmanShmaMGA19Point8(): Date {\n const [alot, temporalHour] = this.getTemporalHourByDeg(19.8);\n const offset = Math.floor(3 * temporalHour);\n return new Date(alot.getTime() + offset);\n }\n /**\n * Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham\n */\n sofZmanTfillaMGA(): Date {\n // Magen Avraham\n const [alot72, temporalHour] = this.getTemporalHour72(true);\n const offset = Math.floor(4 * temporalHour);\n return new Date(alot72.getTime() + offset);\n }\n /**\n * Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham.\n * Based on the opinion of the MGA that the day is calculated from\n * dawn to nightfall with both being 16.1° below the horizon.\n */\n sofZmanTfillaMGA16Point1(): Date {\n const [alot, temporalHour] = this.getTemporalHourByDeg(16.1);\n const offset = Math.floor(4 * temporalHour);\n return new Date(alot.getTime() + offset);\n }\n /**\n * Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham.\n * Based on the opinion of the MGA that the day is calculated from\n * dawn to nightfall with both being 19.8° below the horizon.\n *\n * This calculation is based on the position of the sun 90 minutes after sunset in Jerusalem\n * around the equinox / equilux which calculates to 19.8° below geometric zenith.\n * https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/\n */\n sofZmanTfillaMGA19Point8(): Date {\n const [alot, temporalHour] = this.getTemporalHourByDeg(19.8);\n const offset = Math.floor(4 * temporalHour);\n return new Date(alot.getTime() + offset);\n }\n /**\n * Earliest Mincha – Mincha Gedola (GRA); Sunrise plus 6.5 halachic hours.\n * If elevation is enabled, this function will include elevation in the calculation.\n *\n * This method returns *mincha gedola*, the earliest time one can pray mincha,\n * that is 6.5 shaos zmaniyos (solar hours) after sunrise or sea level sunrise\n * (depending on the `useElevation` setting), according\n * to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).\n *\n * The Ramba\"m is of the opinion that it is better to delay *mincha* until\n * *mincha ketana* while the Ra\"sh, Tur, GRA and others are of the\n * opinion that *mincha* can be prayed *lechatchila* starting at *mincha gedola*.\n */\n minchaGedola(): Date {\n return this.getShaahZmanisBasedZman(6.5);\n }\n /**\n * Earliest Mincha – Mincha Gedola (MGA); Sunrise plus 6.5 halachic hours.\n * If elevation is enabled, this function will include elevation in the calculation.\n *\n * This method returns the time of *mincha gedola* according to the Magen Avraham\n * with the day starting 72 minutes before sunrise and ending 72 minutes after sunset.\n * This is the earliest time to pray *mincha*.\n */\n minchaGedolaMGA(): Date {\n const [alot72, temporalHour] = this.getTemporalHour72(false);\n const offset = Math.floor(6.5 * temporalHour);\n return new Date(alot72.getTime() + offset);\n }\n /**\n * Preferable earliest time to recite Minchah – Mincha Ketana; Sunrise plus 9.5 halachic hours.\n * If elevation is enabled, this function will include elevation in the calculation.\n *\n * This method returns *mincha ketana*, the preferred earliest time to pray *mincha* in the\n * opinion of the [Rambam](https://en.wikipedia.org/wiki/Maimonides) and others,\n * that is 9.5 *shaos zmaniyos* (solar hours) after sunrise or sea level sunrise\n * (depending on the `useElevation` setting), according\n * to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).\n */\n minchaKetana(): Date {\n return this.getShaahZmanisBasedZman(9.5);\n }\n /**\n * This method returns the time of *mincha ketana* according to the Magen Avraham\n * with the day starting 72 minutes before sunrise and ending 72 minutes after sunset.\n * This is the preferred earliest time to pray *mincha* according to the opinion of\n * the [Rambam](https://en.wikipedia.org/wiki/Maimonides) and others.\n *\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n minchaKetanaMGA(): Date {\n const [alot72, temporalHour] = this.getTemporalHour72(false);\n return new Date(alot72.getTime() + Math.floor(9.5 * temporalHour));\n }\n /**\n * Plag haMincha; Sunrise plus 10.75 halachic hours.\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n plagHaMincha(): Date {\n return this.getShaahZmanisBasedZman(10.75);\n }\n /**\n * Nightfall – Tzeit HaKochavim; the sun is `angle` degrees below the\n * horizon in the evening.\n *\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n * @param [angle=8.5] optional time for solar depression.\n * Default is 8.5 degrees for 3 small stars, use 7.083 degrees for 3 medium-sized stars.\n */\n tzeit(angle = 8.5): Date {\n return this.timeAtAngle(angle, false);\n }\n /**\n * Nightfall – Tzeit HaKochavim; calculated as 72 minutes after sunset\n * (or sea-level sunset, depending on the `useElevation` setting).\n *\n * Returns a `Temporal.ZonedDateTime` with seconds precision, or `null` if\n * sunset cannot be calculated for this date and location.\n */\n tzeit72(): Temporal.ZonedDateTime | null {\n const zdt = this.useElevation\n ? this.noaa.getSunset()\n : this.noaa.getSeaLevelSunset();\n if (!zdt) {\n return null;\n }\n return zdt.add({minutes: 72});\n }\n /**\n * Alias for sunrise\n */\n neitzHaChama(): Date {\n return this.sunrise();\n }\n /**\n * Alias for sunset\n */\n shkiah(): Date {\n return this.sunset();\n }\n /**\n * Rabbeinu Tam holds that bein hashmashos is a specific time\n * between sunset and tzeis hakochavim.\n * One opinion on how to calculate this time is that\n * it is 13.5 minutes before tzies 7.083.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n beinHaShmashos(): Date {\n const tzeit = this.tzeit(7.083);\n const millis = tzeit.getTime();\n if (isNaN(millis)) {\n return tzeit;\n }\n return new Date(millis - 13.5 * 60 * 1000);\n }\n\n /**\n * Used by Molad based _zmanim_ to determine if _zmanim_ occur during the current day.\n * @return previous midnight\n */\n private getMidnightLastNight(): Temporal.ZonedDateTime {\n // reset hour, minutes, seconds and millis\n return this.plainDate.toZonedDateTime({\n timeZone: this.gloc.getTimeZone(),\n });\n }\n\n /**\n * Used by Molad based _zmanim_ to determine if _zmanim_ occur during the current day.\n * @return following midnight\n */\n private getMidnightTonight(): Temporal.ZonedDateTime {\n return this.plainDate.add({days: 1}).toZonedDateTime({\n timeZone: this.gloc.getTimeZone(),\n });\n }\n\n /**\n * Returns the Date of the _molad_ based time if it occurs on the current date. Since _Kiddush Levana_\n * can only be said during the day, there are parameters to limit it to between _alos_ and _tzais_. If\n * the time occurs between _alos_ and _tzais_, _tzais_ will be returned.\n *\n * @param moladBasedTime\n * the _molad_ based time such as _molad_, _tchilas_ and _sof zman Kiddush Levana_\n * @param alos\n * optional start of day to limit _molad_ times to the end of the night before or beginning of the next night.\n * Ignored if either _alos_ or _tzais_ are null.\n * @param tzais\n * optional end of day to limit _molad_ times to the end of the night before or beginning of the next night.\n * Ignored if either _tzais_ or _alos_ are null\n * @param techila\n * is it the start of _Kiddush Levana_ time or the end? If it is start roll it to the next _tzais_,\n * and if it is the end, return the end of the previous night (_alos_ passed in). Ignored if either\n * _alos_ or _tzais_ are null.\n * @return the _molad_ based time. If the _zman_ does not occur during the current date, `null` will be\n * returned.\n */\n private getMoladBasedTime(\n moladBasedTime: Temporal.ZonedDateTime,\n alos: Temporal.ZonedDateTime | null,\n tzais: Temporal.ZonedDateTime | null,\n techila: boolean\n ): Temporal.ZonedDateTime | null {\n const lastMidnight: Temporal.ZonedDateTime = this.getMidnightLastNight();\n const midnightTonight: Temporal.ZonedDateTime = this.getMidnightTonight();\n\n if (\n Temporal.ZonedDateTime.compare(moladBasedTime, lastMidnight) < 0 ||\n Temporal.ZonedDateTime.compare(moladBasedTime, midnightTonight) > 0\n ) {\n return null; // Invalid time, bailout\n }\n if (alos === null || tzais === null) {\n return moladBasedTime.withTimeZone(this.gloc.getTimeZone()); // Not enough info to adjust\n }\n if (\n Temporal.ZonedDateTime.compare(moladBasedTime, alos) > 0 &&\n Temporal.ZonedDateTime.compare(moladBasedTime, tzais) < 0\n ) {\n // It's the daytime (after alos but before tzais)\n // get the next/prev night\n return techila ? tzais : alos;\n }\n // It's the night, the provided time is valid\n return moladBasedTime.withTimeZone(this.gloc.getTimeZone());\n }\n\n /**\n * Returns the latest time of Kiddush Levana according to the\n * [Maharil's](https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin) opinion that it is calculated as\n * halfway between _molad_ and _molad_. This adds half the 29 days, 12 hours and 793 chalakim time between\n * _molad_ and _molad_ (14 days, 18 hours, 22 minutes and 666 milliseconds) to the month's _molad_.\n *\n * The _sof zman Kiddush Levana_ will be returned even if it occurs during the day, unless both `alos` and\n * `tzais` are supplied.\n *\n * @param alos\n * the beginning of the Jewish day. If _Kidush Levana_ occurs during the day (starting at _alos_ and\n * ending at _tzais_), the time returned will be alos. If either the _alos_ or _tzais_ parameters\n * are null, no daytime adjustment will be made.\n * @param tzais\n * the end of the Jewish day. If Kidush Levana occurs during the day (starting at alos and ending at\n * tzais), the time returned will be alos. If either the alos or tzais parameters are null, no daytime\n * adjustment will be made.\n * @return the `Temporal.ZonedDateTime` representing the moment halfway between molad and molad. If the time\n * occurs between _alos_ and _tzais_, _alos_ will be returned. If the _zman_ will not occur on this\n * day, `null` will be returned.\n */\n public getSofZmanKidushLevanaBetweenMoldos(\n alos: Temporal.ZonedDateTime | null = null,\n tzais: Temporal.ZonedDateTime | null = null\n ): Temporal.ZonedDateTime | null {\n const hd = this.hdate;\n\n // Do not calculate for impossible dates, but account for extreme cases. In the extreme case of Rapa Iti in French\n // Polynesia on Dec 2027 when kiddush Levana 3 days can be said on _Rosh Chodesh_, the sof zman Kiddush Levana\n // will be on the 12th of the Teves. In the case of Anadyr, Russia on Jan, 2071, sof zman Kiddush Levana between the\n // moldos will occur is on the night of 17th of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).\n if (hd.getDate() < 11 || hd.getDate() > 16) {\n return null;\n }\n const molad = new Molad(hd.getFullYear(), hd.getMonth());\n return this.getMoladBasedTime(\n molad.getSofZmanKidushLevanaBetweenMoldos(),\n alos,\n tzais,\n false\n );\n }\n\n /**\n * Returns the latest time of _Kiddush Levana_ calculated as 15 days after the molad. This is the opinion of\n * the Shulchan Aruch (Orach Chaim 426). It should be noted that some opinions hold that the\n * [Rema](https://en.wikipedia.org/wiki/Moses_Isserles), who brings down the opinion of the\n * [Maharil](https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin) of calculating\n * {@link getSofZmanKidushLevanaBetweenMoldos half way between _molad_ and _molad_}, is of\n * the opinion that the Mechaber agrees to his opinion. Also see the Aruch Hashulchan. For additional details on\n * the subject, see Rabbi Dovid Heber's very detailed write-up in Siman Daled (chapter 4) of\n * [Shaarei Zmanim](https://hebrewbooks.org/53000).\n *\n * The _sof zman Kiddush Levana_ will be returned even if it occurs during the day, unless both `alos` and\n * `tzais` are supplied.\n *\n * @param alos\n * the beginning of the Jewish day. If either the _alos_ or _tzais_ parameters are null, no daytime\n * adjustment will be made.\n * @param tzais\n * the end of the Jewish day. If either the _alos_ or _tzais_ parameters are null, no daytime\n * adjustment will be made.\n * @return the `Temporal.ZonedDateTime` representing the moment 15 days after the _molad_. If the time occurs\n * between _alos_ and _tzais_, _alos_ will be returned. If the _zman_ will not occur on this day,\n * `null` will be returned.\n */\n public getSofZmanKidushLevana15Days(\n alos: Temporal.ZonedDateTime | null = null,\n tzais: Temporal.ZonedDateTime | null = null\n ): Temporal.ZonedDateTime | null {\n const hd = this.hdate;\n\n // Do not calculate for impossible dates, but account for extreme cases. In the extreme case of Rapa Iti in\n // French Polynesia on Dec 2027 when kiddush Levana 3 days can be said on _Rosh Chodesh_, the sof zman Kiddush\n // Levana will be on the 12th of the Teves. in the case of Anadyr, Russia on Jan, 2071, sof zman kiddush levana will\n // occur after midnight on the 17th of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).\n if (hd.getDate() < 11 || hd.getDate() > 17) {\n return null;\n }\n const molad = new Molad(hd.getFullYear(), hd.getMonth());\n return this.getMoladBasedTime(\n molad.getSofZmanKidushLevana15Days(),\n alos,\n tzais,\n false\n );\n }\n\n /**\n * Returns the earliest time of _Kiddush Levana_ according to\n * [Rabbeinu Yonah](https://en.wikipedia.org/wiki/Yonah_Gerondi)'s opinion that it can be said 3 days after the _molad_.\n * If the time of _tchilas zman Kiddush Levana_ occurs during the day (between _alos_ and _tzais_ passed to\n * this method) it will return the following _tzais_. If null is passed for either _alos_ or _tzais_, the actual\n * _tchilas zman Kiddush Levana_ will be returned, regardless of if it is during the day or not.\n *\n * @param alos\n * the beginning of the Jewish day. If Kidush Levana occurs during the day (starting at _alos_ and ending\n * at _tzais_), the time returned will be _tzais_. If either the _alos_ or _tzais_ parameters\n * are null, no daytime adjustment will be made.\n * @param tzais\n * the end of the Jewish day. If _Kidush Levana_ occurs during the day (starting at _alos_ and ending at\n * _tzais_), the time returned will be _tzais_. If either the _alos_ or _tzais_ parameters\n * are null, no daytime adjustment will be made.\n *\n * @return the `Temporal.ZonedDateTime` representing the moment 3 days after the molad. If the time occurs\n * between _alos_ and _tzais_, _tzais_ will be returned. If the _zman_ will not occur on this day,\n * `null` will be returned.\n */\n public getTchilasZmanKidushLevana3Days(\n alos: Temporal.ZonedDateTime | null = null,\n tzais: Temporal.ZonedDateTime | null = null\n ): Temporal.ZonedDateTime | null {\n const hd = this.hdate;\n\n // Do not calculate for impossible dates, but account for extreme cases. Tchilas zman kiddush Levana 3 days for\n // the extreme case of Rapa Iti in French Polynesia on Dec 2027 when kiddush Levana 3 days can be said on the evening\n // of the 30th, the second night of Rosh Chodesh. The 3rd day after the _molad_ will be on the 4th of the month.\n // In the case of Anadyr, Russia on Jan, 2071, when sof zman kiddush levana is on the 17th of the month, the 3rd day\n // from the molad will be on the 5th day of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).\n if (hd.getDate() > 5 && hd.getDate() < 30) {\n return null;\n }\n\n const molad = new Molad(hd.getFullYear(), hd.getMonth());\n let zman: Temporal.ZonedDateTime | null = this.getMoladBasedTime(\n molad.getTchilasZmanKidushLevana3Days(),\n alos,\n tzais,\n true\n );\n\n // Get the following month's zman kiddush Levana for the extreme case of Rapa Iti in French Polynesia on Dec 2027 when\n // kiddush Levana can be said on Rosh Chodesh (the evening of the 30th). See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (page 32)\n if (zman === null && hd.getDate() === 30) {\n const hd2 = hd.add(1, 'week');\n const molad2 = new Molad(hd2.getFullYear(), hd2.getMonth());\n zman = this.getMoladBasedTime(\n molad2.getTchilasZmanKidushLevana3Days(),\n null,\n null,\n true\n );\n }\n\n return zman;\n }\n\n /**\n * Returns the point in time of the _Molad_, if it occurs on this date. For the traditional day of week, hour,\n * minute and chalakim, see {@link Molad} and its {@link Molad.render} method.\n *\n * @return the `Temporal.ZonedDateTime` representing the moment of the molad. If the _molad_ does not occur on\n * this day, `null` will be returned.\n */\n public getZmanMolad(): Temporal.ZonedDateTime | null {\n const hd = this.hdate;\n\n // Optimize to not calculate for impossible dates, but account for extreme cases. The molad in the extreme case of Rapa\n // Iti in French Polynesia on Dec 2027 occurs on the night of the 27th of Kislev. In the case of Anadyr, Russia on\n // 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).\n if (hd.getDate() > 2 && hd.getDate() < 27) {\n return null;\n }\n\n const molad = new Molad(hd.getFullYear(), hd.getMonth());\n let zman: Temporal.ZonedDateTime | null = this.getMoladBasedTime(\n molad.getInstant(),\n null,\n null,\n true\n );\n\n // deal with molad that happens on the end of the previous month\n if (zman === null && hd.getDate() > 26) {\n const hd2 = hd.add(1, 'week');\n const molad2 = new Molad(hd2.getFullYear(), hd2.getMonth());\n zman = this.getMoladBasedTime(molad2.getInstant(), null, null, true);\n }\n return zman;\n }\n\n /**\n * Returns the earliest time of _Kiddush Levana_ according to the opinions that it should not be said until 7\n * days after the _molad_. The time will be returned even if it occurs during the day when _Kiddush Levana_\n * can't be recited, unless both `alos` and `tzais` are supplied.\n *\n * @param alos\n * the beginning of the Jewish day. If _Kidush Levana_ occurs during the day (starting at _alos_ and\n * ending at _tzais_), the time returned will be _tzais_. If either the _alos_ or _tzais_ parameters\n * are null, no daytime adjustment will be made.\n * @param tzais\n * the end of the Jewish day. If either the _alos_ or _tzais_ parameters are null, no daytime\n * adjustment will be made.\n * @return the `Temporal.ZonedDateTime` representing the moment 7 days after the molad. If the _zman_\n * will not occur on this day, `null` will be returned.\n */\n public getTchilasZmanKidushLevana7Days(\n alos: Temporal.ZonedDateTime | null = null,\n tzais: Temporal.ZonedDateTime | null = null\n ): Temporal.ZonedDateTime | null {\n const hd = this.hdate;\n\n // Optimize to not calculate for impossible dates, but account for extreme cases. Tchilas zman kiddush Levana 7 days for\n // the extreme case of Rapa Iti in French Polynesia on Jan 2028 (when kiddush Levana 3 days can be said on the evening\n // of the 30th, the second night of Rosh Chodesh), the 7th day after the molad will be on the 4th of the month.\n // In the case of Anadyr, Russia on Jan, 2071, when sof zman kiddush levana is on the 17th of the month, the 7th day\n // from the molad will be on the 9th day of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).\n if (hd.getDate() < 4 || hd.getDate() > 9) {\n return null;\n }\n const molad = new Molad(hd.getFullYear(), hd.getMonth());\n return this.getMoladBasedTime(\n molad.getTchilasZmanKidushLevana7Days(),\n alos,\n tzais,\n true\n );\n }\n\n /**\n * A method that returns the [Baal Hatanya](https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi)'s\n * _netz amiti_ (sunrise) without\n * elevation adjustment. This forms the base for the Baal Hatanya's dawn-based calculations that are\n * calculated as a dip below the horizon before sunrise.\n *\n * According to the Baal Hatanya, _netz amiti_, or true (halachic) sunrise, is when the top of the sun's\n * disk is visible at an elevation similar to the mountains of Eretz Yisrael. The time is calculated as the point at which\n * the center of the sun's disk is 1.583° below the horizon. This degree-based calculation can be found in Rabbi Shalom\n * DovBer Levine's commentary on\n * [The Baal Hatanya's Seder Hachnasas Shabbos](https://www.chabadlibrary.org/books/pdf/Seder-Hachnosas-Shabbos.pdf).\n * From an elevation of 546 meters, the top of [Har Hacarmel](https://en.wikipedia.org/wiki/Mount_Carmel),\n * the sun disappears when it is 1° 35' or 1.583° below the sea level horizon. This in turn is based on the Gemara\n * [Shabbos 35a](https://hebrewbooks.org/shas.aspx?mesechta=2&daf=35). There are other opinions brought down by\n * Rabbi Levine, including Rabbi Yosef Yitzchok Feigelstock who calculates it as the degrees below the horizon 4 minutes after\n * sunset in Yerushalayim (on the equinox). That is brought down as 1.583°. This is identical to the 1° 35' _zman_\n * and is probably a typo and should be 1.683°. These calculations are used by most\n * [Chabad](https://en.wikipedia.org/wiki/Chabad) calendars that use the Baal Hatanya's _zmanim_. See\n * [About Our Zmanim Calculations @ Chabad.org](https://www.chabad.org/library/article_cdo/aid/3209349/jewish/About-Our-Zmanim-Calculations.htm).\n *\n * Note: _netz amiti_ is used only for calculating certain _zmanim_, and is intentionally unpublished. For\n * practical purposes, daytime _mitzvos_ like _shofar_ and _lulav_ should not be done until after the\n * published time for _netz_ / sunrise.\n *\n * @return the exact sea level _netz amiti_ (sunrise) time. If the calculation can't be\n * computed, such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one\n * where it does not set, `null` will be returned.\n */\n private getSunriseBaalHatanya(): number {\n return this.sunriseMillis(ZENITH_1_POINT_583, true);\n }\n\n /**\n * A method that returns the [Baal Hatanya](https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi)'s\n * _shkiah amiti_ (sunset) without\n * elevation adjustment. This forms the base for the Baal Hatanya's dusk-based calculations that are calculated\n * as a dip below the horizon after sunset.\n *\n * According to the Baal Hatanya, _shkiah amiti_, true (_halachic_) sunset, is when the top of the\n * sun's disk disappears from view at an elevation similar to the mountains of _Eretz Yisrael_.\n * This time is calculated as the point at which the center of the sun's disk is 1.583 degrees below the horizon.\n *\n * Note: _shkiah amiti_ is used only for calculating certain _zmanim_, and is intentionally unpublished. For\n * practical purposes, all daytime mitzvos should be completed before the published time for _shkiah_ / sunset.\n *\n * For further explanation of the calculations used for the Baal Hatanya's _zmanim_ in this library, see\n * [About Our Zmanim Calculations @ Chabad.org](https://www.chabad.org/library/article_cdo/aid/3209349/jewish/About-Our-Zmanim-Calculations.htm).\n *\n * @return the exact sea level _shkiah amiti_ (sunset) time. If the calculation\n * can't be computed, such as in the Arctic Circle where there is at least one day a year where the sun does not\n * rise, and one where it does not set, `null` will be returned.\n */\n private getSunsetBaalHatanya(): number {\n return this.sunsetMillis(ZENITH_1_POINT_583, true);\n }\n\n /**\n * Returns the [Baal Hatanya](https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi)'s _alos_\n * (dawn) calculated as the time when the sun is 16.9° below the eastern geometric horizon\n * before {@link sunrise}.\n *\n * The zenith of 16.9° below is based on the calculation that the time between dawn\n * and _netz amiti_ (sunrise) is 72 minutes, the time that it takes to walk 4 mil at 18 minutes\n * a mil ([Rambam](https://en.wikipedia.org/wiki/Maimonides) and others). The sun's position at 72\n * minutes before _netz amiti_ (sunrise) in Jerusalem\n * [around the equinox / equilux](https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/)\n * is 16.9° below geometric zenith.\n *\n * @return the `Date` of dawn. If the calculation can't be computed, such as in northern and southern\n * locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may not reach\n * low enough below the horizon for this calculation, an `Invalid Date` will be returned.\n */\n public alosBaalHatanya(): Date {\n return this.timeAtAngle(16.9, true);\n }\n\n private getShaahZmanisBaalHatanya(hours: number): Date {\n return millisToDate(\n this.getShaahZmanisBasedZmanMillis(\n this.getSunriseBaalHatanya(),\n this.getSunsetBaalHatanya(),\n hours\n )\n );\n }\n\n /**\n * This method returns the latest _zman krias shema_ (time to recite Shema in the morning). This time is 3\n * _shaos zmaniyos_ (solar hours) after _netz amiti_ (sunrise), based on the opinion of the Baal Hatanya\n * that the day is calculated from _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).\n *\n * @return the `Date` of the latest _zman shema_ according to the Baal Hatanya. If the calculation\n * can't be computed, such as in the Arctic Circle where there is at least one day a year where the sun does\n * not rise and one where it does not set, an `Invalid Date` will be returned.\n */\n public sofZmanShmaBaalHatanya(): Date {\n return this.getShaahZmanisBaalHatanya(3);\n }\n\n /**\n * This method returns the latest _zman tfilah_ (time to recite the morning prayers). This time is 4\n * halachic hours into the day, based on the opinion of the Baal Hatanya that the day is\n * calculated from _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).\n *\n * @return the `Date` of the latest _zman tfilah_. If the calculation can't be computed, such as in\n * the Arctic Circle where there is at least one day a year where the sun does not rise and one where it does\n * not set, an `Invalid Date` will be returned.\n */\n public sofZmanTfilaBaalHatanya(): Date {\n return this.getShaahZmanisBaalHatanya(4);\n }\n\n /**\n * This method returns the time of _mincha gedola_. _Mincha gedola_ is the earliest time one can pray\n * _mincha_. The [Rambam](https://en.wikipedia.org/wiki/Maimonides) is of the opinion that it is\n * better to delay _mincha_ until {@link minchaKetanaBaalHatanya | _mincha ketana_} while the\n * [Ra\"sh](https://en.wikipedia.org/wiki/Asher_ben_Jehiel),\n * [Tur](https://en.wikipedia.org/wiki/Jacob_ben_Asher),\n * [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon) and others are of the opinion that _mincha_ can be prayed\n * _lechatchila_ starting at _mincha gedola_. This is calculated as 6.5 sea level solar hours after\n * _netz amiti_ (sunrise), based on the opinion of the Baal Hatanya that the day is calculated from\n * _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).\n * @return the `Date` of the time of _mincha gedola_ according to the Baal Hatanya. If the calculation\n * 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\n * and one where it does not set, an `Invalid Date` will be returned.\n */\n public minchaGedolaBaalHatanya(): Date {\n return this.getShaahZmanisBaalHatanya(6.5);\n }\n\n /**\n * This method returns the time of _mincha ketana_. This is the preferred earliest time to pray\n * _mincha_ in the opinion of the [Rambam](https://en.wikipedia.org/wiki/Maimonides) and others.\n * For more information on this see the documentation on {@link minchaGedolaBaalHatanya | _mincha gedola_}.\n * This is calculated as 9.5 sea level solar hours after _netz amiti_ (sunrise), based on the opinion of\n * the Baal Hatanya that the day is calculated from _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).\n *\n * @return the `Date` of the time of _mincha ketana_. If the calculation can't be computed, such as\n * in the Arctic Circle where there is at least one day a year where the sun does not rise and one where it\n * does not set, an `Invalid Date` will be returned.\n */\n public minchaKetanaBaalHatanya(): Date {\n return this.getShaahZmanisBaalHatanya(9.5);\n }\n\n /**\n * This method returns the time of _plag hamincha_. This is calculated as 10.75 sea level solar hours\n * after _netz amiti_ (sunrise), based on the opinion of the Baal Hatanya that the day is calculated\n * from _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).\n *\n * @return the `Date` of the time of _plag hamincha_ according to the Baal Hatanya. If the calculation\n * can't be computed, such as in the Arctic Circle where there is at least one day a year where the sun does\n * not rise and one where it does not set, an `Invalid Date` will be returned.\n */\n public plagHaminchaBaalHatanya(): Date {\n return this.getShaahZmanisBaalHatanya(10.75);\n }\n\n /**\n * A method that returns _tzais_ (nightfall) when the sun is 6° below the western geometric horizon\n * (90°) after {@link sunset}. This is the time the Baal Hatanya calls _shkiah amiti_ plus the\n * interval it takes the sun to descend a further 6°.\n *\n * @return the `Date` of nightfall. If the calculation can't be computed, such as in northern and southern\n * locations — even south of the Arctic Circle and north of the Antarctic Circle — where the sun may not\n * reach low enough below the horizon for this calculation, an `Invalid Date` will be returned.\n */\n public tzaisBaalHatanya(): Date {\n return this.timeAtAngle(6, false);\n }\n\n /**\n * Uses timeFormat to return a date like '20:34'.\n * Returns `XX:XX` if the date is invalid.\n * @param dt the time to format\n * @param timeFormat formatter to use, e.g. from\n * {@link Location.getTimeFormatter}\n */\n static formatTime(dt: Date, timeFormat: Intl.DateTimeFormat): string {\n if (isNaN(dt.getTime())) {\n return 'XX:XX'; // Invalid Date\n }\n const time = timeFormat.format(dt);\n // Rewrite the h24 midnight (\"24:15\") that some locales produce. Checking\n // the two leading characters avoids the throwaway array that split(':')\n // allocated on every event; this runs once per timed event, and the\n // Intl.format() call above is already the expensive part.\n if (\n time.charCodeAt(0) === 0x32 && // '2'\n time.charCodeAt(1) === 0x34 && // '4'\n time.charCodeAt(2) === 0x3a // ':'\n ) {\n return '00' + time.substring(2);\n }\n return time;\n }\n\n /**\n * Discards seconds, rounding to nearest minute.\n * @param dt\n */\n static roundTime(dt: Date): Date {\n const millis = dt.getTime();\n if (isNaN(millis)) {\n return dt;\n }\n // Round up to next minute if needed\n const millisOnly = dt.getMilliseconds();\n const seconds = dt.getSeconds();\n if (seconds === 0 && millisOnly === 0) {\n return dt;\n }\n const secAndMillis = seconds * 1000 + millisOnly;\n const delta = secAndMillis >= 30000 ? 60000 - secAndMillis : -1 * secAndMillis;\n return new Date(millis + delta);\n }\n\n /**\n * Get offset string (like \"+05:00\" or \"-08:00\") from tzid (like \"Europe/Moscow\")\n * @param tzid\n * @param date\n */\n static timeZoneOffset(tzid: string, date: Date): string {\n const offset = getTimezoneOffset(tzid, date);\n const offsetAbs = Math.abs(offset);\n const hours = Math.floor(offsetAbs / 60);\n const minutes = offsetAbs % 60;\n return (offset < 0 ? '+' : '-') + pad2(hours) + ':' + pad2(minutes);\n }\n\n /**\n * Returns a string like \"2022-04-01T13:06:00-11:00\"\n * @param tzid\n * @param date\n */\n static formatISOWithTimeZone(tzid: string, date: Date): string {\n if (isNaN(date.getTime())) {\n return '0000-00-00T00:00:00Z';\n }\n return (\n getPseudoISO(tzid, date).substring(0, 19) + Zmanim.timeZoneOffset(tzid, date)\n );\n }\n\n /**\n * Returns sunrise + `offset` minutes (either positive or negative).\n * If elevation is enabled, this function will include elevation in the calculation\n * unless `forceSeaLevel` is `true`.\n * @param offset minutes\n * @param roundMinute round time to nearest minute (default true)\n * @param forceSeaLevel use sea-level sunrise (default false)\n */\n sunriseOffset(offset: number, roundMinute = true, forceSeaLevel = false): Date {\n const sunrise = forceSeaLevel ? this.seaLevelSunrise() : this.sunrise();\n if (isNaN(sunrise.getTime())) {\n return sunrise;\n }\n if (roundMinute) {\n // For positive offsets only, round up to next minute if needed\n if (offset > 0 && sunrise.getUTCSeconds() >= 30) {\n offset++;\n }\n sunrise.setUTCSeconds(0, 0);\n }\n return new Date(sunrise.getTime() + offset * 60 * 1000);\n }\n\n /**\n * Returns sunset + `offset` minutes (either positive or negative).\n * If elevation is enabled, this function will include elevation in the calculation\n * unless `forceSeaLevel` is `true`.\n * @param offset minutes\n * @param roundMinute round time to nearest minute (default true)\n * @param forceSeaLevel use sea-level sunset (default false)\n */\n sunsetOffset(offset: number, roundMinute = true, forceSeaLevel = false): Date {\n const sunset = forceSeaLevel ? this.seaLevelSunset() : this.sunset();\n if (isNaN(sunset.getTime())) {\n return sunset;\n }\n if (roundMinute) {\n // For Havdalah only, round up to next minute if needed\n if (offset > 0 && sunset.getUTCSeconds() >= 30) {\n offset++;\n }\n sunset.setUTCSeconds(0, 0);\n }\n return new Date(sunset.getTime() + offset * 60 * 1000);\n }\n /**\n * Returns the Hebrew date relative to the specified location and Gregorian date,\n * taking into consideration whether the time is before or after sunset.\n *\n * For example, if the given date and is `2024-09-22T10:35` (before sunset), and\n * sunset for the specified location is **19:04**, then this function would\n * return a Hebrew date of `19th of Elul, 5784`.\n * If the given date is the same Gregorian day after sunset\n * (for example `2024-09-22T20:07`), this function would return a\n * Hebrew date of `20th of Elul, 5784`.\n * @example\n * import {GeoLocation, Zmanim, HDate} from '@hebcal/core';\n * const latitude = 48.85341;\n * const longitude = 2.3488;\n * const timezone = 'Europe/Paris';\n * const gloc = new GeoLocation(null, latitude, longitude, 0, timezone);\n * const before = Zmanim.makeSunsetAwareHDate(gloc, new Date('2024-09-22T17:38:46.123Z'), false);\n * console.log(before.toString()); // '19 Elul 5784'\n * const after = Zmanim.makeSunsetAwareHDate(gloc, new Date('2024-09-22T23:45:18.345Z'), false);\n * console.log(after.toString()); // '20 Elul 5784'\n */\n static makeSunsetAwareHDate(\n gloc: GeoLocation,\n date: Date,\n useElevation: boolean\n ): HDate {\n const zmanim = new Zmanim(gloc, date, useElevation);\n const sunset = zmanim.sunset();\n let hd = new HDate(date);\n const sunsetMillis = sunset.getTime();\n if (isNaN(sunsetMillis)) {\n return hd;\n }\n if (date.getTime() >= sunsetMillis) {\n hd = hd.next();\n }\n return hd;\n }\n}\n"],"names":[],"mappings":";;;;;;AAKA;;;;;;;;;AASG;AACH,SAAS,YAAY,CAAC,MAAc,EAAA;AAClC,IAAA,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC;;;;AAI5B,IAAA,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAAC;AACzB,IAAA,OAAO,GAAG;AACZ;AAEA;;AAEG;AACH,MAAM,gBAAgB,GAAW,EAAE;AAEnC;;;;;;;AAOG;AACH,MAAM,kBAAkB,GAAW,gBAAgB,GAAG,KAAK;AAE3D;;;AAGG;AACH,MAAM,YAAY,GAAW,gBAAgB,GAAG,CAAC;AAEjD;;;;;AAKG;AACH,SAAS,kBAAkB,CAAC,UAAkB,EAAE,QAAgB,EAAA;AAC9D,IAAA,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,GAAG,UAAU,IAAI,EAAE,CAAC;AACjD;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BG;MACU,MAAM,CAAA;AACA,IAAA,KAAK;AACL,IAAA,SAAS;AACT,IAAA,IAAI;AACJ,IAAA,IAAI;AAC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AI,YAAY,EAAE;AAClC,YAAA,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE;QAChB;AACA,QAAA,OAAO,EAAE;IACX;AACD;;"}
1
+ {"version":3,"file":"zmanim.js","sources":["../../../src/zmanim.ts"],"sourcesContent":["import 'temporal-polyfill/global';\nimport {GeoLocation, NOAACalculator} from '@hebcal/noaa';\nimport {HDate, getPseudoISO, getTimezoneOffset, isDate, pad2} from '@hebcal/hdate';\nimport {Molad} from './molad.js';\n\n/**\n * Converts an instant to a `Date`, discarding milliseconds.\n *\n * Zmanim are read out to the minute, and every accessor here reduces to an\n * instant, so we ask `@hebcal/noaa` for epoch milliseconds rather than a\n * `Temporal.ZonedDateTime`. Resolving the IANA zone to build a\n * `ZonedDateTime` costs roughly 750ns and nothing downstream uses it, which\n * made it the single most expensive step in a sunrise/sunset calculation.\n */\nfunction millisToDate(millis: number): Date {\n const res = new Date(millis);\n // UTC setter: a local-time setter re-resolves the wall-clock time and, in\n // the repeated hour at the end of DST in the process time zone, would move\n // the instant an hour earlier. See hebcal/hebcal-es6#786.\n res.setUTCMilliseconds(0);\n return res;\n}\n\n/**\n * The zenith of astronomical sunrise and sunset. The sun is 90° from the vertical 0°\n */\nconst GEOMETRIC_ZENITH = 90;\n\n/**\n * The zenith of 1.583° below geometric zenith (90°). This calculation is used for\n * calculating _netz amiti_ (sunrise) and _shkiah amiti_ (sunset) based on the opinion of the\n * [Baal Hatanya](https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi).\n *\n * @see Zmanim.sunriseBaalHatanya\n * @see Zmanim.sunsetBaalHatanya\n */\nconst ZENITH_1_POINT_583 = GEOMETRIC_ZENITH + 1.583;\n\n/**\n * The zenith of civil twilight; the sun is 6° below the horizon.\n * Matches `NOAACalculator.CIVIL_ZENITH`.\n */\nconst CIVIL_ZENITH = GEOMETRIC_ZENITH + 6;\n\n/**\n * Length of one temporal (halachic) hour in milliseconds, i.e. one twelfth of\n * the day. Mirrors `NOAACalculator.getTemporalHour()`, including its floor, so\n * that results stay identical to the `ZonedDateTime` code path.\n */\nfunction temporalHourMillis(startOfDay: number, endOfDay: number): number {\n return Math.floor((endOfDay - startOfDay) / 12);\n}\n\n/**\n * Returns the moment `hours` temporal hours after `startOfDay`, where one\n * temporal hour lasts `temporalHour` milliseconds\n */\nfunction addTemporalHours(\n startOfDay: Date,\n temporalHour: number,\n hours: number\n): Date {\n return new Date(startOfDay.getTime() + Math.floor(hours * temporalHour));\n}\n\n/**\n * Calculate halachic times (zmanim / זְמַנִּים) for a given day and location.\n * Calculations are available for tzeit / tzais (nightfall),\n * shkiah (sunset) and more.\n *\n * Zmanim are estimated using an algorithm published by the US National Oceanic\n * and Atmospheric Administration. The NOAA solar calculator is based on equations\n * from _Astronomical Algorithms_ by Jean Meeus.\n *\n * The sunrise and sunset results are theoretically accurate to within a minute for\n * locations between +/- 72° latitude, and within 10 minutes outside of those latitudes.\n * However, due to variations in atmospheric composition, temperature, pressure and\n * conditions, observed values may vary from calculations.\n * https://gml.noaa.gov/grad/solcalc/calcdetails.html\n *\n * @example\n * import {GeoLocation, Zmanim} from '@hebcal/core';\n * const latitude = 41.822232;\n * const longitude = -71.448292;\n * const tzid = 'America/New_York';\n * const friday = new Date(2023, 8, 8);\n * const gloc = new GeoLocation(null, latitude, longitude, 0, tzid);\n * const zmanim = new Zmanim(gloc, friday, false);\n * const candleLighting = zmanim.sunsetOffset(-18, true);\n * const timeStr = Zmanim.formatISOWithTimeZone(tzid, candleLighting);\n * // '2023-09-08T18:49:00-04:00'\n */\nexport class Zmanim {\n private readonly hdate: HDate;\n private readonly plainDate: Temporal.PlainDate;\n private readonly gloc: GeoLocation;\n private readonly noaa: NOAACalculator;\n private useElevation: boolean;\n /**\n * Initialize a Zmanim instance.\n * @param gloc GeoLocation including latitude, longitude, and timezone\n * @param date Regular or Hebrew Date. If `date` is a regular `Date`,\n * hours, minutes, seconds and milliseconds are ignored.\n * @param useElevation use elevation for calculations (default `false`).\n * If `true`, use elevation to affect the calculation of all sunrise/sunset based\n * zmanim. Note: there are some zmanim such as degree-based zmanim that are driven\n * by the amount of light in the sky and are not impacted by elevation.\n * These zmanim intentionally do not support elevation adjustment.\n */\n constructor(gloc: GeoLocation, date: Date | HDate, useElevation: boolean) {\n this.hdate = new HDate(date);\n const dt = isDate(date) ? date : this.hdate.greg();\n // The constructor is ~1.8x cheaper than PlainDate.from(), which has to\n // walk a property bag and apply overflow handling. The fields come from a\n // real Date, so they are always in range and never need constraining.\n this.plainDate = new Temporal.PlainDate(\n dt.getFullYear(),\n dt.getMonth() + 1,\n dt.getDate()\n );\n this.gloc = gloc;\n this.noaa = new NOAACalculator(gloc, this.plainDate);\n this.useElevation = Boolean(useElevation);\n }\n /**\n * Returns `true` if this instance uses the location's elevation when\n * calculating sunrise/sunset-based zmanim.\n */\n getUseElevation(): boolean {\n return this.useElevation;\n }\n /**\n * Enables or disables elevation adjustment for sunrise/sunset-based zmanim.\n *\n * Degree-based zmanim (such as {@link alotHaShachar} or {@link tzeit})\n * estimate the amount of light in the sky and are never affected by this\n * setting.\n * @param useElevation `true` to include the location's elevation\n */\n setUseElevation(useElevation: boolean) {\n this.useElevation = useElevation;\n }\n /**\n * Convenience function to get the time when sun is above or below the horizon\n * for a certain angle (in degrees).\n * This function does not support elevation adjustment.\n * @param angle degrees of solar depression below the horizon; for example\n * `8.5` means the center of the sun is 8.5° below the horizon\n * @param rising `true` for the morning (before sunrise), `false` for the\n * evening (after sunset)\n */\n timeAtAngle(angle: number, rising: boolean): Date {\n const offsetZenith = GEOMETRIC_ZENITH + angle;\n return millisToDate(\n rising\n ? this.sunriseMillis(offsetZenith, true)\n : this.sunsetMillis(offsetZenith, true)\n );\n }\n /**\n * Sunrise for a given zenith as epoch milliseconds, mirroring what\n * `NOAACalculator.getSunrise()` / `getSeaLevelSunrise()` /\n * `getSunriseOffsetByDegrees()` compute, minus the `ZonedDateTime`.\n *\n * Note that noaa's degree-based accessors pass `adjustForElevation = true`\n * as well; the adjustment is a no-op unless the zenith is exactly\n * {@link GEOMETRIC_ZENITH}, which is why degree-based zmanim are unaffected\n * by elevation.\n */\n private sunriseMillis(zenith: number, useElevation: boolean): number {\n const utc = useElevation\n ? this.noaa.getUTCSunrise0(zenith)\n : this.noaa.getUTCSeaLevelSunrise(zenith);\n return this.noaa.getEpochMillisFromTime(utc, true);\n }\n /**\n * Sunset counterpart of {@link sunriseMillis}.\n */\n private sunsetMillis(zenith: number, useElevation: boolean): number {\n const utc = useElevation\n ? this.noaa.getUTCSunset0(zenith)\n : this.noaa.getUTCSeaLevelSunset(zenith);\n return this.noaa.getEpochMillisFromTime(utc, false);\n }\n /**\n * Upper edge of the Sun appears over the eastern horizon in the morning (0.833° above horizon)\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n sunrise(): Date {\n return millisToDate(this.sunriseMillis(GEOMETRIC_ZENITH, this.useElevation));\n }\n /**\n * Upper edge of the Sun appears over the eastern horizon in the morning (0.833° above horizon).\n * This function does not support elevation adjustment.\n */\n seaLevelSunrise(): Date {\n return millisToDate(this.sunriseMillis(GEOMETRIC_ZENITH, false));\n }\n /**\n * When the upper edge of the Sun disappears below the horizon (0.833° below horizon).\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n sunset(): Date {\n return millisToDate(this.sunsetMillis(GEOMETRIC_ZENITH, this.useElevation));\n }\n /**\n * When the upper edge of the Sun disappears below the horizon (0.833° below horizon).\n * This function does not support elevation adjustment.\n */\n seaLevelSunset(): Date {\n return millisToDate(this.sunsetMillis(GEOMETRIC_ZENITH, false));\n }\n /**\n * Civil dawn; Sun is 6° below the horizon in the morning.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n dawn(): Date {\n return millisToDate(this.sunriseMillis(CIVIL_ZENITH, true));\n }\n /**\n * Civil dusk; Sun is 6° below the horizon in the evening.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n dusk(): Date {\n return millisToDate(this.sunsetMillis(CIVIL_ZENITH, true));\n }\n /**\n * Returns sunset for the previous day.\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n gregEve(): Date {\n const prev0 = this.plainDate.subtract({days: 1});\n const prev = new Date(prev0.year, prev0.month - 1, prev0.day);\n const zman = new Zmanim(this.gloc, prev, this.useElevation);\n return zman.sunset();\n }\n /**\n * Length in milliseconds of one halachic hour of the night, calculated as\n * one twelfth of the time between the previous day's sunset and this\n * day's sunrise. Used internally by {@link chatzotNight}.\n */\n nightHour(): number {\n return (this.sunrise().getTime() - this.gregEve().getTime()) / 12; // ms in hour\n }\n /**\n * Midday – Chatzot; Sunrise plus 6 halachic hours.\n *\n * Unlike most sunrise/sunset-based zmanim, this is always computed from\n * sea-level sunrise and sunset, so it is not affected by the\n * `useElevation` setting.\n */\n chatzot(): Date {\n const startOfDay = this.sunriseMillis(GEOMETRIC_ZENITH, false);\n const endOfDay = this.sunsetMillis(GEOMETRIC_ZENITH, false);\n // NOAACalculator.getSunTransit(): sunrise plus 6 temporal hours\n return millisToDate(startOfDay + temporalHourMillis(startOfDay, endOfDay) * 6);\n }\n /**\n * Midnight – Chatzot; Sunset plus 6 halachic hours.\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n chatzotNight(): Date {\n return new Date(this.sunrise().getTime() - this.nightHour() * 6);\n }\n /**\n * Dawn – Alot haShachar; Sun is 16.1° below the horizon in the morning.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n alotHaShachar(): Date {\n return this.timeAtAngle(16.1, true);\n }\n /**\n * Dawn – Alot haShachar; calculated as 72 minutes before sunrise or\n * sea level sunrise.\n */\n alotHaShachar72(): Date {\n return this.sunriseOffset(-72, false, false);\n }\n /**\n * Same as {@link alotHaShachar72}, but returns a `Temporal.ZonedDateTime`\n * with seconds precision (instead of a `Date` rounded to the minute), or\n * `null` if sunrise cannot be calculated for this date and location.\n */\n alotHaShachar72zdt(): Temporal.ZonedDateTime | null {\n const zdt = this.useElevation\n ? this.noaa.getSunrise()\n : this.noaa.getSeaLevelSunrise();\n if (!zdt) {\n return null;\n }\n return zdt.subtract({minutes: 72});\n }\n\n /**\n * Earliest talis & tefillin – Misheyakir; Sun is 11.5° below the horizon in the morning.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n misheyakir(): Date {\n return this.timeAtAngle(11.5, true);\n }\n /**\n * Earliest talis & tefillin – Misheyakir Machmir; Sun is 10.2° below the horizon in the morning.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n misheyakirMachmir(): Date {\n return this.timeAtAngle(10.2, true);\n }\n private getShaahZmanisBasedZmanMillis(\n startOfDay: number,\n endOfDay: number,\n hours: number\n ): number {\n const offset = Math.trunc(temporalHourMillis(startOfDay, endOfDay) * hours);\n return startOfDay + offset;\n }\n /**\n * Utility method for using elevation-aware sunrise/sunset\n * @param hours number of _shaos zmaniyos_ (solar hours) after sunrise\n */\n private getShaahZmanisBasedZman(hours: number): Date {\n const startOfDay = this.sunriseMillis(GEOMETRIC_ZENITH, this.useElevation);\n const endOfDay = this.sunsetMillis(GEOMETRIC_ZENITH, this.useElevation);\n return millisToDate(\n this.getShaahZmanisBasedZmanMillis(startOfDay, endOfDay, hours)\n );\n }\n /**\n * Latest Shema (Gra); Sunrise plus 3 halachic hours, according to the Gra.\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n sofZmanShma(): Date {\n // Gra\n return this.getShaahZmanisBasedZman(3);\n }\n /**\n * Latest Shacharit (Gra); Sunrise plus 4 halachic hours, according to the Gra.\n *\n * This method returns the latest *zman tfila* (time to recite the morning prayers)\n * that is 4 *shaos zmaniyos* (solar hours) after sunrise or sea level sunrise\n * (depending on the `useElevation` setting), according\n * to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).\n *\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n sofZmanTfilla(): Date {\n // Gra\n return this.getShaahZmanisBasedZman(4);\n }\n /**\n * This method returns the latest time for burning _chametz_ on _Erev Pesach_ according to the opinion\n * of the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon). This time is 5 halachic hours into the day, based on\n * the opinion of the GRA that the day is calculated from sunrise to sunset.\n *\n * If elevation is enabled, this function will include elevation in the calculation.\n * @return the `Date` of the latest time for burning _chametz_ on _Erev Pesach_. If the calculation can't be\n * computed, such as in the Arctic Circle where there is at least one day a year where the sun does not\n * rise and one where it does not set, an `Invalid Date` will be returned.\n */\n sofZmanBiurChametzGRA(): Date {\n return this.getShaahZmanisBasedZman(5);\n }\n /**\n * Returns a 2-element array with alot (a `Date`, 72 minutes before sunrise)\n * and the length in milliseconds of one halachic hour of the resulting day.\n * Used internally by the Magen Avraham zmanim.\n * @param forceSeaLevel ignore the `useElevation` setting and use sea-level\n * sunrise and sunset\n */\n getTemporalHour72(forceSeaLevel: boolean): [Date, number] {\n const alot72 = this.sunriseOffset(-72, false, forceSeaLevel);\n const tzeit72 = this.sunsetOffset(72, false, forceSeaLevel);\n const temporalHour = (tzeit72.getTime() - alot72.getTime()) / 12;\n return [alot72, temporalHour];\n }\n /**\n * Returns a 2-element array with alot (a `Date`, when the sun is `angle`\n * degrees below the horizon in the morning) and the length in milliseconds\n * of one halachic hour of the resulting day. Used internally by the\n * degree-based Magen Avraham zmanim.\n * @param angle degrees of solar depression below the horizon\n */\n getTemporalHourByDeg(angle: number): [Date, number] {\n const alot = this.timeAtAngle(angle, true);\n const tzeit = this.timeAtAngle(angle, false);\n const temporalHour = (tzeit.getTime() - alot.getTime()) / 12;\n return [alot, temporalHour];\n }\n /**\n * Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.\n * Based on the opinion of the MGA that the day is calculated from\n * dawn being fixed 72 minutes before sea-level sunrise, and nightfall is fixed\n * 72 minutes after sea-level sunset.\n */\n sofZmanShmaMGA(): Date {\n // Magen Avraham\n const [alot72, temporalHour] = this.getTemporalHour72(true);\n return addTemporalHours(alot72, temporalHour, 3);\n }\n /**\n * Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.\n * Based on the opinion of the MGA that the day is calculated from\n * dawn to nightfall with both being 16.1° below the horizon.\n */\n sofZmanShmaMGA16Point1(): Date {\n const [alot, temporalHour] = this.getTemporalHourByDeg(16.1);\n return addTemporalHours(alot, temporalHour, 3);\n }\n /**\n * Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.\n * Based on the opinion of the MGA that the day is calculated from\n * dawn to nightfall with both being 19.8° below the horizon.\n *\n * This calculation is based on the position of the sun 90 minutes after sunset in Jerusalem\n * around the equinox / equilux which calculates to 19.8° below geometric zenith.\n * https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/\n */\n sofZmanShmaMGA19Point8(): Date {\n const [alot, temporalHour] = this.getTemporalHourByDeg(19.8);\n return addTemporalHours(alot, temporalHour, 3);\n }\n /**\n * Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham\n */\n sofZmanTfillaMGA(): Date {\n // Magen Avraham\n const [alot72, temporalHour] = this.getTemporalHour72(true);\n return addTemporalHours(alot72, temporalHour, 4);\n }\n /**\n * Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham.\n * Based on the opinion of the MGA that the day is calculated from\n * dawn to nightfall with both being 16.1° below the horizon.\n */\n sofZmanTfillaMGA16Point1(): Date {\n const [alot, temporalHour] = this.getTemporalHourByDeg(16.1);\n return addTemporalHours(alot, temporalHour, 4);\n }\n /**\n * Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham.\n * Based on the opinion of the MGA that the day is calculated from\n * dawn to nightfall with both being 19.8° below the horizon.\n *\n * This calculation is based on the position of the sun 90 minutes after sunset in Jerusalem\n * around the equinox / equilux which calculates to 19.8° below geometric zenith.\n * https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/\n */\n sofZmanTfillaMGA19Point8(): Date {\n const [alot, temporalHour] = this.getTemporalHourByDeg(19.8);\n return addTemporalHours(alot, temporalHour, 4);\n }\n /**\n * Earliest Mincha – Mincha Gedola (GRA); Sunrise plus 6.5 halachic hours.\n * If elevation is enabled, this function will include elevation in the calculation.\n *\n * This method returns *mincha gedola*, the earliest time one can pray mincha,\n * that is 6.5 shaos zmaniyos (solar hours) after sunrise or sea level sunrise\n * (depending on the `useElevation` setting), according\n * to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).\n *\n * The Ramba\"m is of the opinion that it is better to delay *mincha* until\n * *mincha ketana* while the Ra\"sh, Tur, GRA and others are of the\n * opinion that *mincha* can be prayed *lechatchila* starting at *mincha gedola*.\n */\n minchaGedola(): Date {\n return this.getShaahZmanisBasedZman(6.5);\n }\n /**\n * Earliest Mincha – Mincha Gedola (MGA); Sunrise plus 6.5 halachic hours.\n * If elevation is enabled, this function will include elevation in the calculation.\n *\n * This method returns the time of *mincha gedola* according to the Magen Avraham\n * with the day starting 72 minutes before sunrise and ending 72 minutes after sunset.\n * This is the earliest time to pray *mincha*.\n */\n minchaGedolaMGA(): Date {\n const [alot72, temporalHour] = this.getTemporalHour72(false);\n return addTemporalHours(alot72, temporalHour, 6.5);\n }\n /**\n * Preferable earliest time to recite Minchah – Mincha Ketana; Sunrise plus 9.5 halachic hours.\n * If elevation is enabled, this function will include elevation in the calculation.\n *\n * This method returns *mincha ketana*, the preferred earliest time to pray *mincha* in the\n * opinion of the [Rambam](https://en.wikipedia.org/wiki/Maimonides) and others,\n * that is 9.5 *shaos zmaniyos* (solar hours) after sunrise or sea level sunrise\n * (depending on the `useElevation` setting), according\n * to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).\n */\n minchaKetana(): Date {\n return this.getShaahZmanisBasedZman(9.5);\n }\n /**\n * This method returns the time of *mincha ketana* according to the Magen Avraham\n * with the day starting 72 minutes before sunrise and ending 72 minutes after sunset.\n * This is the preferred earliest time to pray *mincha* according to the opinion of\n * the [Rambam](https://en.wikipedia.org/wiki/Maimonides) and others.\n *\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n minchaKetanaMGA(): Date {\n const [alot72, temporalHour] = this.getTemporalHour72(false);\n return addTemporalHours(alot72, temporalHour, 9.5);\n }\n /**\n * Plag haMincha; Sunrise plus 10.75 halachic hours.\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n plagHaMincha(): Date {\n return this.getShaahZmanisBasedZman(10.75);\n }\n /**\n * Nightfall – Tzeit HaKochavim; the sun is `angle` degrees below the\n * horizon in the evening.\n *\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n * @param [angle=8.5] optional time for solar depression.\n * Default is 8.5 degrees for 3 small stars, use 7.083 degrees for 3 medium-sized stars.\n */\n tzeit(angle = 8.5): Date {\n return this.timeAtAngle(angle, false);\n }\n /**\n * Nightfall – Tzeit HaKochavim; calculated as 72 minutes after sunset\n * (or sea-level sunset, depending on the `useElevation` setting).\n *\n * Returns a `Temporal.ZonedDateTime` with seconds precision, or `null` if\n * sunset cannot be calculated for this date and location.\n */\n tzeit72(): Temporal.ZonedDateTime | null {\n const zdt = this.useElevation\n ? this.noaa.getSunset()\n : this.noaa.getSeaLevelSunset();\n if (!zdt) {\n return null;\n }\n return zdt.add({minutes: 72});\n }\n /**\n * Alias for sunrise\n */\n neitzHaChama(): Date {\n return this.sunrise();\n }\n /**\n * Alias for sunset\n */\n shkiah(): Date {\n return this.sunset();\n }\n /**\n * Rabbeinu Tam holds that bein hashmashos is a specific time\n * between sunset and tzeis hakochavim.\n * One opinion on how to calculate this time is that\n * it is 13.5 minutes before tzies 7.083.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n beinHaShmashos(): Date {\n const tzeit = this.tzeit(7.083);\n const millis = tzeit.getTime();\n if (isNaN(millis)) {\n return tzeit;\n }\n return new Date(millis - 13.5 * 60 * 1000);\n }\n\n /**\n * Used by Molad based _zmanim_ to determine if _zmanim_ occur during the current day.\n * @return previous midnight\n */\n private getMidnightLastNight(): Temporal.ZonedDateTime {\n // reset hour, minutes, seconds and millis\n return this.plainDate.toZonedDateTime({\n timeZone: this.gloc.getTimeZone(),\n });\n }\n\n /**\n * Used by Molad based _zmanim_ to determine if _zmanim_ occur during the current day.\n * @return following midnight\n */\n private getMidnightTonight(): Temporal.ZonedDateTime {\n return this.plainDate.add({days: 1}).toZonedDateTime({\n timeZone: this.gloc.getTimeZone(),\n });\n }\n\n /**\n * Returns the Date of the _molad_ based time if it occurs on the current date. Since _Kiddush Levana_\n * can only be said during the day, there are parameters to limit it to between _alos_ and _tzais_. If\n * the time occurs between _alos_ and _tzais_, _tzais_ will be returned.\n *\n * @param moladBasedTime\n * the _molad_ based time such as _molad_, _tchilas_ and _sof zman Kiddush Levana_\n * @param alos\n * optional start of day to limit _molad_ times to the end of the night before or beginning of the next night.\n * Ignored if either _alos_ or _tzais_ are null.\n * @param tzais\n * optional end of day to limit _molad_ times to the end of the night before or beginning of the next night.\n * Ignored if either _tzais_ or _alos_ are null\n * @param techila\n * is it the start of _Kiddush Levana_ time or the end? If it is start roll it to the next _tzais_,\n * and if it is the end, return the end of the previous night (_alos_ passed in). Ignored if either\n * _alos_ or _tzais_ are null.\n * @return the _molad_ based time. If the _zman_ does not occur during the current date, `null` will be\n * returned.\n */\n private getMoladBasedTime(\n moladBasedTime: Temporal.ZonedDateTime,\n alos: Temporal.ZonedDateTime | null,\n tzais: Temporal.ZonedDateTime | null,\n techila: boolean\n ): Temporal.ZonedDateTime | null {\n const lastMidnight = this.getMidnightLastNight();\n const midnightTonight = this.getMidnightTonight();\n\n if (\n Temporal.ZonedDateTime.compare(moladBasedTime, lastMidnight) < 0 ||\n Temporal.ZonedDateTime.compare(moladBasedTime, midnightTonight) > 0\n ) {\n return null; // Invalid time, bailout\n }\n if (alos === null || tzais === null) {\n return moladBasedTime.withTimeZone(this.gloc.getTimeZone()); // Not enough info to adjust\n }\n if (\n Temporal.ZonedDateTime.compare(moladBasedTime, alos) > 0 &&\n Temporal.ZonedDateTime.compare(moladBasedTime, tzais) < 0\n ) {\n // It's the daytime (after alos but before tzais)\n // get the next/prev night\n return techila ? tzais : alos;\n }\n // It's the night, the provided time is valid\n return moladBasedTime.withTimeZone(this.gloc.getTimeZone());\n }\n\n /**\n * Returns the latest time of Kiddush Levana according to the\n * [Maharil's](https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin) opinion that it is calculated as\n * halfway between _molad_ and _molad_. This adds half the 29 days, 12 hours and 793 chalakim time between\n * _molad_ and _molad_ (14 days, 18 hours, 22 minutes and 666 milliseconds) to the month's _molad_.\n *\n * The _sof zman Kiddush Levana_ will be returned even if it occurs during the day, unless both `alos` and\n * `tzais` are supplied.\n *\n * @param alos\n * the beginning of the Jewish day. If _Kidush Levana_ occurs during the day (starting at _alos_ and\n * ending at _tzais_), the time returned will be alos. If either the _alos_ or _tzais_ parameters\n * are null, no daytime adjustment will be made.\n * @param tzais\n * the end of the Jewish day. If Kidush Levana occurs during the day (starting at alos and ending at\n * tzais), the time returned will be alos. If either the alos or tzais parameters are null, no daytime\n * adjustment will be made.\n * @return the `Temporal.ZonedDateTime` representing the moment halfway between molad and molad. If the time\n * occurs between _alos_ and _tzais_, _alos_ will be returned. If the _zman_ will not occur on this\n * day, `null` will be returned.\n */\n getSofZmanKidushLevanaBetweenMoldos(\n alos: Temporal.ZonedDateTime | null = null,\n tzais: Temporal.ZonedDateTime | null = null\n ): Temporal.ZonedDateTime | null {\n const hd = this.hdate;\n\n // Do not calculate for impossible dates, but account for extreme cases. In the extreme case of Rapa Iti in French\n // Polynesia on Dec 2027 when kiddush Levana 3 days can be said on _Rosh Chodesh_, the sof zman Kiddush Levana\n // will be on the 12th of the Teves. In the case of Anadyr, Russia on Jan, 2071, sof zman Kiddush Levana between the\n // moldos will occur is on the night of 17th of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).\n if (hd.getDate() < 11 || hd.getDate() > 16) {\n return null;\n }\n const molad = new Molad(hd.getFullYear(), hd.getMonth());\n return this.getMoladBasedTime(\n molad.getSofZmanKidushLevanaBetweenMoldos(),\n alos,\n tzais,\n false\n );\n }\n\n /**\n * Returns the latest time of _Kiddush Levana_ calculated as 15 days after the molad. This is the opinion of\n * the Shulchan Aruch (Orach Chaim 426). It should be noted that some opinions hold that the\n * [Rema](https://en.wikipedia.org/wiki/Moses_Isserles), who brings down the opinion of the\n * [Maharil](https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin) of calculating\n * {@link getSofZmanKidushLevanaBetweenMoldos half way between _molad_ and _molad_}, is of\n * the opinion that the Mechaber agrees to his opinion. Also see the Aruch Hashulchan. For additional details on\n * the subject, see Rabbi Dovid Heber's very detailed write-up in Siman Daled (chapter 4) of\n * [Shaarei Zmanim](https://hebrewbooks.org/53000).\n *\n * The _sof zman Kiddush Levana_ will be returned even if it occurs during the day, unless both `alos` and\n * `tzais` are supplied.\n *\n * @param alos\n * the beginning of the Jewish day. If either the _alos_ or _tzais_ parameters are null, no daytime\n * adjustment will be made.\n * @param tzais\n * the end of the Jewish day. If either the _alos_ or _tzais_ parameters are null, no daytime\n * adjustment will be made.\n * @return the `Temporal.ZonedDateTime` representing the moment 15 days after the _molad_. If the time occurs\n * between _alos_ and _tzais_, _alos_ will be returned. If the _zman_ will not occur on this day,\n * `null` will be returned.\n */\n getSofZmanKidushLevana15Days(\n alos: Temporal.ZonedDateTime | null = null,\n tzais: Temporal.ZonedDateTime | null = null\n ): Temporal.ZonedDateTime | null {\n const hd = this.hdate;\n\n // Do not calculate for impossible dates, but account for extreme cases. In the extreme case of Rapa Iti in\n // French Polynesia on Dec 2027 when kiddush Levana 3 days can be said on _Rosh Chodesh_, the sof zman Kiddush\n // Levana will be on the 12th of the Teves. in the case of Anadyr, Russia on Jan, 2071, sof zman kiddush levana will\n // occur after midnight on the 17th of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).\n if (hd.getDate() < 11 || hd.getDate() > 17) {\n return null;\n }\n const molad = new Molad(hd.getFullYear(), hd.getMonth());\n return this.getMoladBasedTime(\n molad.getSofZmanKidushLevana15Days(),\n alos,\n tzais,\n false\n );\n }\n\n /**\n * Returns the earliest time of _Kiddush Levana_ according to\n * [Rabbeinu Yonah](https://en.wikipedia.org/wiki/Yonah_Gerondi)'s opinion that it can be said 3 days after the _molad_.\n * If the time of _tchilas zman Kiddush Levana_ occurs during the day (between _alos_ and _tzais_ passed to\n * this method) it will return the following _tzais_. If null is passed for either _alos_ or _tzais_, the actual\n * _tchilas zman Kiddush Levana_ will be returned, regardless of if it is during the day or not.\n *\n * @param alos\n * the beginning of the Jewish day. If Kidush Levana occurs during the day (starting at _alos_ and ending\n * at _tzais_), the time returned will be _tzais_. If either the _alos_ or _tzais_ parameters\n * are null, no daytime adjustment will be made.\n * @param tzais\n * the end of the Jewish day. If _Kidush Levana_ occurs during the day (starting at _alos_ and ending at\n * _tzais_), the time returned will be _tzais_. If either the _alos_ or _tzais_ parameters\n * are null, no daytime adjustment will be made.\n *\n * @return the `Temporal.ZonedDateTime` representing the moment 3 days after the molad. If the time occurs\n * between _alos_ and _tzais_, _tzais_ will be returned. If the _zman_ will not occur on this day,\n * `null` will be returned.\n */\n getTchilasZmanKidushLevana3Days(\n alos: Temporal.ZonedDateTime | null = null,\n tzais: Temporal.ZonedDateTime | null = null\n ): Temporal.ZonedDateTime | null {\n const hd = this.hdate;\n\n // Do not calculate for impossible dates, but account for extreme cases. Tchilas zman kiddush Levana 3 days for\n // the extreme case of Rapa Iti in French Polynesia on Dec 2027 when kiddush Levana 3 days can be said on the evening\n // of the 30th, the second night of Rosh Chodesh. The 3rd day after the _molad_ will be on the 4th of the month.\n // In the case of Anadyr, Russia on Jan, 2071, when sof zman kiddush levana is on the 17th of the month, the 3rd day\n // from the molad will be on the 5th day of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).\n if (hd.getDate() > 5 && hd.getDate() < 30) {\n return null;\n }\n\n const molad = new Molad(hd.getFullYear(), hd.getMonth());\n let zman: Temporal.ZonedDateTime | null = this.getMoladBasedTime(\n molad.getTchilasZmanKidushLevana3Days(),\n alos,\n tzais,\n true\n );\n\n // Get the following month's zman kiddush Levana for the extreme case of Rapa Iti in French Polynesia on Dec 2027 when\n // kiddush Levana can be said on Rosh Chodesh (the evening of the 30th). See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (page 32)\n if (zman === null && hd.getDate() === 30) {\n const hd2 = hd.add(1, 'week');\n const molad2 = new Molad(hd2.getFullYear(), hd2.getMonth());\n zman = this.getMoladBasedTime(\n molad2.getTchilasZmanKidushLevana3Days(),\n null,\n null,\n true\n );\n }\n\n return zman;\n }\n\n /**\n * Returns the point in time of the _Molad_, if it occurs on this date. For the traditional day of week, hour,\n * minute and chalakim, see {@link Molad} and its {@link Molad.render} method.\n *\n * @return the `Temporal.ZonedDateTime` representing the moment of the molad. If the _molad_ does not occur on\n * this day, `null` will be returned.\n */\n getZmanMolad(): Temporal.ZonedDateTime | null {\n const hd = this.hdate;\n\n // Optimize to not calculate for impossible dates, but account for extreme cases. The molad in the extreme case of Rapa\n // Iti in French Polynesia on Dec 2027 occurs on the night of the 27th of Kislev. In the case of Anadyr, Russia on\n // 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).\n if (hd.getDate() > 2 && hd.getDate() < 27) {\n return null;\n }\n\n const molad = new Molad(hd.getFullYear(), hd.getMonth());\n let zman: Temporal.ZonedDateTime | null = this.getMoladBasedTime(\n molad.getInstant(),\n null,\n null,\n true\n );\n\n // deal with molad that happens on the end of the previous month\n if (zman === null && hd.getDate() > 26) {\n const hd2 = hd.add(1, 'week');\n const molad2 = new Molad(hd2.getFullYear(), hd2.getMonth());\n zman = this.getMoladBasedTime(molad2.getInstant(), null, null, true);\n }\n return zman;\n }\n\n /**\n * Returns the earliest time of _Kiddush Levana_ according to the opinions that it should not be said until 7\n * days after the _molad_. The time will be returned even if it occurs during the day when _Kiddush Levana_\n * can't be recited, unless both `alos` and `tzais` are supplied.\n *\n * @param alos\n * the beginning of the Jewish day. If _Kidush Levana_ occurs during the day (starting at _alos_ and\n * ending at _tzais_), the time returned will be _tzais_. If either the _alos_ or _tzais_ parameters\n * are null, no daytime adjustment will be made.\n * @param tzais\n * the end of the Jewish day. If either the _alos_ or _tzais_ parameters are null, no daytime\n * adjustment will be made.\n * @return the `Temporal.ZonedDateTime` representing the moment 7 days after the molad. If the _zman_\n * will not occur on this day, `null` will be returned.\n */\n getTchilasZmanKidushLevana7Days(\n alos: Temporal.ZonedDateTime | null = null,\n tzais: Temporal.ZonedDateTime | null = null\n ): Temporal.ZonedDateTime | null {\n const hd = this.hdate;\n\n // Optimize to not calculate for impossible dates, but account for extreme cases. Tchilas zman kiddush Levana 7 days for\n // the extreme case of Rapa Iti in French Polynesia on Jan 2028 (when kiddush Levana 3 days can be said on the evening\n // of the 30th, the second night of Rosh Chodesh), the 7th day after the molad will be on the 4th of the month.\n // In the case of Anadyr, Russia on Jan, 2071, when sof zman kiddush levana is on the 17th of the month, the 7th day\n // from the molad will be on the 9th day of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).\n if (hd.getDate() < 4 || hd.getDate() > 9) {\n return null;\n }\n const molad = new Molad(hd.getFullYear(), hd.getMonth());\n return this.getMoladBasedTime(\n molad.getTchilasZmanKidushLevana7Days(),\n alos,\n tzais,\n true\n );\n }\n\n /**\n * A method that returns the [Baal Hatanya](https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi)'s\n * _netz amiti_ (sunrise) without\n * elevation adjustment. This forms the base for the Baal Hatanya's dawn-based calculations that are\n * calculated as a dip below the horizon before sunrise.\n *\n * According to the Baal Hatanya, _netz amiti_, or true (halachic) sunrise, is when the top of the sun's\n * disk is visible at an elevation similar to the mountains of Eretz Yisrael. The time is calculated as the point at which\n * the center of the sun's disk is 1.583° below the horizon. This degree-based calculation can be found in Rabbi Shalom\n * DovBer Levine's commentary on\n * [The Baal Hatanya's Seder Hachnasas Shabbos](https://www.chabadlibrary.org/books/pdf/Seder-Hachnosas-Shabbos.pdf).\n * From an elevation of 546 meters, the top of [Har Hacarmel](https://en.wikipedia.org/wiki/Mount_Carmel),\n * the sun disappears when it is 1° 35' or 1.583° below the sea level horizon. This in turn is based on the Gemara\n * [Shabbos 35a](https://hebrewbooks.org/shas.aspx?mesechta=2&daf=35). There are other opinions brought down by\n * Rabbi Levine, including Rabbi Yosef Yitzchok Feigelstock who calculates it as the degrees below the horizon 4 minutes after\n * sunset in Yerushalayim (on the equinox). That is brought down as 1.583°. This is identical to the 1° 35' _zman_\n * and is probably a typo and should be 1.683°. These calculations are used by most\n * [Chabad](https://en.wikipedia.org/wiki/Chabad) calendars that use the Baal Hatanya's _zmanim_. See\n * [About Our Zmanim Calculations @ Chabad.org](https://www.chabad.org/library/article_cdo/aid/3209349/jewish/About-Our-Zmanim-Calculations.htm).\n *\n * Note: _netz amiti_ is used only for calculating certain _zmanim_, and is intentionally unpublished. For\n * practical purposes, daytime _mitzvos_ like _shofar_ and _lulav_ should not be done until after the\n * published time for _netz_ / sunrise.\n *\n * @return the exact sea level _netz amiti_ (sunrise) time. If the calculation can't be\n * computed, such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one\n * where it does not set, `null` will be returned.\n */\n private getSunriseBaalHatanya(): number {\n return this.sunriseMillis(ZENITH_1_POINT_583, true);\n }\n\n /**\n * A method that returns the [Baal Hatanya](https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi)'s\n * _shkiah amiti_ (sunset) without\n * elevation adjustment. This forms the base for the Baal Hatanya's dusk-based calculations that are calculated\n * as a dip below the horizon after sunset.\n *\n * According to the Baal Hatanya, _shkiah amiti_, true (_halachic_) sunset, is when the top of the\n * sun's disk disappears from view at an elevation similar to the mountains of _Eretz Yisrael_.\n * This time is calculated as the point at which the center of the sun's disk is 1.583 degrees below the horizon.\n *\n * Note: _shkiah amiti_ is used only for calculating certain _zmanim_, and is intentionally unpublished. For\n * practical purposes, all daytime mitzvos should be completed before the published time for _shkiah_ / sunset.\n *\n * For further explanation of the calculations used for the Baal Hatanya's _zmanim_ in this library, see\n * [About Our Zmanim Calculations @ Chabad.org](https://www.chabad.org/library/article_cdo/aid/3209349/jewish/About-Our-Zmanim-Calculations.htm).\n *\n * @return the exact sea level _shkiah amiti_ (sunset) time. If the calculation\n * can't be computed, such as in the Arctic Circle where there is at least one day a year where the sun does not\n * rise, and one where it does not set, `null` will be returned.\n */\n private getSunsetBaalHatanya(): number {\n return this.sunsetMillis(ZENITH_1_POINT_583, true);\n }\n\n /**\n * Returns the [Baal Hatanya](https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi)'s _alos_\n * (dawn) calculated as the time when the sun is 16.9° below the eastern geometric horizon\n * before {@link sunrise}.\n *\n * The zenith of 16.9° below is based on the calculation that the time between dawn\n * and _netz amiti_ (sunrise) is 72 minutes, the time that it takes to walk 4 mil at 18 minutes\n * a mil ([Rambam](https://en.wikipedia.org/wiki/Maimonides) and others). The sun's position at 72\n * minutes before _netz amiti_ (sunrise) in Jerusalem\n * [around the equinox / equilux](https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/)\n * is 16.9° below geometric zenith.\n *\n * @return the `Date` of dawn. If the calculation can't be computed, such as in northern and southern\n * locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may not reach\n * low enough below the horizon for this calculation, an `Invalid Date` will be returned.\n */\n alosBaalHatanya(): Date {\n return this.timeAtAngle(16.9, true);\n }\n\n private getShaahZmanisBaalHatanya(hours: number): Date {\n return millisToDate(\n this.getShaahZmanisBasedZmanMillis(\n this.getSunriseBaalHatanya(),\n this.getSunsetBaalHatanya(),\n hours\n )\n );\n }\n\n /**\n * This method returns the latest _zman krias shema_ (time to recite Shema in the morning). This time is 3\n * _shaos zmaniyos_ (solar hours) after _netz amiti_ (sunrise), based on the opinion of the Baal Hatanya\n * that the day is calculated from _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).\n *\n * @return the `Date` of the latest _zman shema_ according to the Baal Hatanya. If the calculation\n * can't be computed, such as in the Arctic Circle where there is at least one day a year where the sun does\n * not rise and one where it does not set, an `Invalid Date` will be returned.\n */\n sofZmanShmaBaalHatanya(): Date {\n return this.getShaahZmanisBaalHatanya(3);\n }\n\n /**\n * This method returns the latest _zman tfilah_ (time to recite the morning prayers). This time is 4\n * halachic hours into the day, based on the opinion of the Baal Hatanya that the day is\n * calculated from _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).\n *\n * @return the `Date` of the latest _zman tfilah_. If the calculation can't be computed, such as in\n * the Arctic Circle where there is at least one day a year where the sun does not rise and one where it does\n * not set, an `Invalid Date` will be returned.\n */\n sofZmanTfilaBaalHatanya(): Date {\n return this.getShaahZmanisBaalHatanya(4);\n }\n\n /**\n * This method returns the time of _mincha gedola_. _Mincha gedola_ is the earliest time one can pray\n * _mincha_. The [Rambam](https://en.wikipedia.org/wiki/Maimonides) is of the opinion that it is\n * better to delay _mincha_ until {@link minchaKetanaBaalHatanya | _mincha ketana_} while the\n * [Ra\"sh](https://en.wikipedia.org/wiki/Asher_ben_Jehiel),\n * [Tur](https://en.wikipedia.org/wiki/Jacob_ben_Asher),\n * [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon) and others are of the opinion that _mincha_ can be prayed\n * _lechatchila_ starting at _mincha gedola_. This is calculated as 6.5 sea level solar hours after\n * _netz amiti_ (sunrise), based on the opinion of the Baal Hatanya that the day is calculated from\n * _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).\n * @return the `Date` of the time of _mincha gedola_ according to the Baal Hatanya. If the calculation\n * 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\n * and one where it does not set, an `Invalid Date` will be returned.\n */\n minchaGedolaBaalHatanya(): Date {\n return this.getShaahZmanisBaalHatanya(6.5);\n }\n\n /**\n * This method returns the time of _mincha ketana_. This is the preferred earliest time to pray\n * _mincha_ in the opinion of the [Rambam](https://en.wikipedia.org/wiki/Maimonides) and others.\n * For more information on this see the documentation on {@link minchaGedolaBaalHatanya | _mincha gedola_}.\n * This is calculated as 9.5 sea level solar hours after _netz amiti_ (sunrise), based on the opinion of\n * the Baal Hatanya that the day is calculated from _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).\n *\n * @return the `Date` of the time of _mincha ketana_. If the calculation can't be computed, such as\n * in the Arctic Circle where there is at least one day a year where the sun does not rise and one where it\n * does not set, an `Invalid Date` will be returned.\n */\n minchaKetanaBaalHatanya(): Date {\n return this.getShaahZmanisBaalHatanya(9.5);\n }\n\n /**\n * This method returns the time of _plag hamincha_. This is calculated as 10.75 sea level solar hours\n * after _netz amiti_ (sunrise), based on the opinion of the Baal Hatanya that the day is calculated\n * from _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).\n *\n * @return the `Date` of the time of _plag hamincha_ according to the Baal Hatanya. If the calculation\n * can't be computed, such as in the Arctic Circle where there is at least one day a year where the sun does\n * not rise and one where it does not set, an `Invalid Date` will be returned.\n */\n plagHaminchaBaalHatanya(): Date {\n return this.getShaahZmanisBaalHatanya(10.75);\n }\n\n /**\n * A method that returns _tzais_ (nightfall) when the sun is 6° below the western geometric horizon\n * (90°) after {@link sunset}. This is the time the Baal Hatanya calls _shkiah amiti_ plus the\n * interval it takes the sun to descend a further 6°.\n *\n * @return the `Date` of nightfall. If the calculation can't be computed, such as in northern and southern\n * locations — even south of the Arctic Circle and north of the Antarctic Circle — where the sun may not\n * reach low enough below the horizon for this calculation, an `Invalid Date` will be returned.\n */\n tzaisBaalHatanya(): Date {\n return this.timeAtAngle(6, false);\n }\n\n /**\n * Uses timeFormat to return a date like '20:34'.\n * Returns `XX:XX` if the date is invalid.\n * @param dt the time to format\n * @param timeFormat formatter to use, e.g. from\n * {@link Location.getTimeFormatter}\n */\n static formatTime(dt: Date, timeFormat: Intl.DateTimeFormat): string {\n if (isNaN(dt.getTime())) {\n return 'XX:XX'; // Invalid Date\n }\n const time = timeFormat.format(dt);\n // Rewrite the h24 midnight (\"24:15\") that some locales produce. Checking\n // the two leading characters avoids the throwaway array that split(':')\n // allocated on every event; this runs once per timed event, and the\n // Intl.format() call above is already the expensive part.\n if (\n time.charCodeAt(0) === 0x32 && // '2'\n time.charCodeAt(1) === 0x34 && // '4'\n time.charCodeAt(2) === 0x3a // ':'\n ) {\n return `00${time.substring(2)}`;\n }\n return time;\n }\n\n /**\n * Discards seconds, rounding to nearest minute.\n * @param dt\n */\n static roundTime(dt: Date): Date {\n const millis = dt.getTime();\n if (isNaN(millis)) {\n return dt;\n }\n // Round up to next minute if needed\n const millisOnly = dt.getMilliseconds();\n const seconds = dt.getSeconds();\n if (seconds === 0 && millisOnly === 0) {\n return dt;\n }\n const secAndMillis = seconds * 1000 + millisOnly;\n const delta = secAndMillis >= 30000 ? 60000 - secAndMillis : -1 * secAndMillis;\n return new Date(millis + delta);\n }\n\n /**\n * Get offset string (like \"+05:00\" or \"-08:00\") from tzid (like \"Europe/Moscow\")\n * @param tzid\n * @param date\n */\n static timeZoneOffset(tzid: string, date: Date): string {\n const offset = getTimezoneOffset(tzid, date);\n const offsetAbs = Math.abs(offset);\n const hours = Math.floor(offsetAbs / 60);\n const minutes = offsetAbs % 60;\n const sign = offset < 0 ? '+' : '-';\n return `${sign}${pad2(hours)}:${pad2(minutes)}`;\n }\n\n /**\n * Returns a string like \"2022-04-01T13:06:00-11:00\"\n * @param tzid\n * @param date\n */\n static formatISOWithTimeZone(tzid: string, date: Date): string {\n if (isNaN(date.getTime())) {\n return '0000-00-00T00:00:00Z';\n }\n return (\n getPseudoISO(tzid, date).substring(0, 19) + Zmanim.timeZoneOffset(tzid, date)\n );\n }\n\n /**\n * Returns sunrise + `offset` minutes (either positive or negative).\n * If elevation is enabled, this function will include elevation in the calculation\n * unless `forceSeaLevel` is `true`.\n * @param offset minutes\n * @param roundMinute round time to nearest minute (default true)\n * @param forceSeaLevel use sea-level sunrise (default false)\n */\n sunriseOffset(offset: number, roundMinute = true, forceSeaLevel = false): Date {\n const sunrise = forceSeaLevel ? this.seaLevelSunrise() : this.sunrise();\n if (isNaN(sunrise.getTime())) {\n return sunrise;\n }\n if (roundMinute) {\n // For positive offsets only, round up to next minute if needed\n if (offset > 0 && sunrise.getUTCSeconds() >= 30) {\n offset++;\n }\n sunrise.setUTCSeconds(0, 0);\n }\n return new Date(sunrise.getTime() + offset * 60 * 1000);\n }\n\n /**\n * Returns sunset + `offset` minutes (either positive or negative).\n * If elevation is enabled, this function will include elevation in the calculation\n * unless `forceSeaLevel` is `true`.\n * @param offset minutes\n * @param roundMinute round time to nearest minute (default true)\n * @param forceSeaLevel use sea-level sunset (default false)\n */\n sunsetOffset(offset: number, roundMinute = true, forceSeaLevel = false): Date {\n const sunset = forceSeaLevel ? this.seaLevelSunset() : this.sunset();\n if (isNaN(sunset.getTime())) {\n return sunset;\n }\n if (roundMinute) {\n // For Havdalah only, round up to next minute if needed\n if (offset > 0 && sunset.getUTCSeconds() >= 30) {\n offset++;\n }\n sunset.setUTCSeconds(0, 0);\n }\n return new Date(sunset.getTime() + offset * 60 * 1000);\n }\n /**\n * Returns the Hebrew date relative to the specified location and Gregorian date,\n * taking into consideration whether the time is before or after sunset.\n *\n * For example, if the given date and is `2024-09-22T10:35` (before sunset), and\n * sunset for the specified location is **19:04**, then this function would\n * return a Hebrew date of `19th of Elul, 5784`.\n * If the given date is the same Gregorian day after sunset\n * (for example `2024-09-22T20:07`), this function would return a\n * Hebrew date of `20th of Elul, 5784`.\n * @example\n * import {GeoLocation, Zmanim, HDate} from '@hebcal/core';\n * const latitude = 48.85341;\n * const longitude = 2.3488;\n * const timezone = 'Europe/Paris';\n * const gloc = new GeoLocation(null, latitude, longitude, 0, timezone);\n * const before = Zmanim.makeSunsetAwareHDate(gloc, new Date('2024-09-22T17:38:46.123Z'), false);\n * console.log(before.toString()); // '19 Elul 5784'\n * const after = Zmanim.makeSunsetAwareHDate(gloc, new Date('2024-09-22T23:45:18.345Z'), false);\n * console.log(after.toString()); // '20 Elul 5784'\n */\n static makeSunsetAwareHDate(\n gloc: GeoLocation,\n date: Date,\n useElevation: boolean\n ): HDate {\n const zmanim = new Zmanim(gloc, date, useElevation);\n const sunset = zmanim.sunset();\n let hd = new HDate(date);\n const sunsetMillis = sunset.getTime();\n if (isNaN(sunsetMillis)) {\n return hd;\n }\n if (date.getTime() >= sunsetMillis) {\n hd = hd.next();\n }\n return hd;\n }\n}\n"],"names":[],"mappings":";;;;;;AAKA;;;;;;;;AAQG;AACH,SAAS,YAAY,CAAC,MAAc,EAAA;AAClC,IAAA,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC;;;;AAI5B,IAAA,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAAC;AACzB,IAAA,OAAO,GAAG;AACZ;AAEA;;AAEG;AACH,MAAM,gBAAgB,GAAG,EAAE;AAE3B;;;;;;;AAOG;AACH,MAAM,kBAAkB,GAAG,gBAAgB,GAAG,KAAK;AAEnD;;;AAGG;AACH,MAAM,YAAY,GAAG,gBAAgB,GAAG,CAAC;AAEzC;;;;AAIG;AACH,SAAS,kBAAkB,CAAC,UAAkB,EAAE,QAAgB,EAAA;AAC9D,IAAA,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,GAAG,UAAU,IAAI,EAAE,CAAC;AACjD;AAEA;;;AAGG;AACH,SAAS,gBAAgB,CACvB,UAAgB,EAChB,YAAoB,EACpB,KAAa,EAAA;AAEb,IAAA,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,YAAY,CAAC,CAAC;AAC1E;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BG;MACU,MAAM,CAAA;AACA,IAAA,KAAK;AACL,IAAA,SAAS;AACT,IAAA,IAAI;AACJ,IAAA,IAAI;AACb,IAAA,YAAY;AACpB;;;;;;;;;;AAUG;AACH,IAAA,WAAA,CAAY,IAAiB,EAAE,IAAkB,EAAE,YAAqB,EAAA;QACtE,IAAI,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,OAAO,EAAE,GAAG,MAAM,GAAG,EAAE,GAAG,IAAI,CAAC;IACxD;AACA;;;;;;;;;;;;;;;;;;;;AAoBG;AACH,IAAA,OAAO,oBAAoB,CACzB,IAAiB,EACjB,IAAU,EACV,YAAqB,EAAA;QAErB,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,CAAC;AACnD,QAAA,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE;AAC9B,QAAA,IAAI,EAAE,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC;AACxB,QAAA,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,EAAE;AACrC,QAAA,IAAI,KAAK,CAAC,YAAY,CAAC,EAAE;AACvB,YAAA,OAAO,EAAE;QACX;AACA,QAAA,IAAI,IAAI,CAAC,OAAO,EAAE,IAAI,YAAY,EAAE;AAClC,YAAA,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE;QAChB;AACA,QAAA,OAAO,EAAE;IACX;AACD;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hebcal/core",
3
- "version": "6.11.1",
3
+ "version": "6.13.1",
4
4
  "author": "Michael J. Radwin (https://github.com/mjradwin)",
5
5
  "contributors": [
6
6
  "Eyal Schachter (https://github.com/Scimonster)",
@@ -76,21 +76,21 @@
76
76
  "@rollup/plugin-node-resolve": "^16.0.3",
77
77
  "@rollup/plugin-terser": "^1.0.0",
78
78
  "@rollup/plugin-typescript": "^12.3.0",
79
- "@types/node": "^26.6.3",
80
- "@vitest/coverage-v8": "^5.0.2",
79
+ "@types/node": "^26.6.4",
80
+ "@vitest/coverage-v8": "^5.0.3",
81
81
  "gettext-parser": "^9.1.1",
82
- "oxlint": "^1.86.0",
82
+ "oxlint": "^1.87.0",
83
83
  "prettier": "^3.9.9",
84
84
  "pretty-bytes": "^7.2.0",
85
- "rollup": "^4.63.5",
85
+ "rollup": "^4.64.0",
86
86
  "rollup-plugin-bundle-size": "^1.0.3",
87
87
  "rollup-plugin-visualizer": "^7.1.1",
88
88
  "tslib": "^2.8.1",
89
89
  "typescript": "^6.0.3",
90
- "vitest": "^5.0.2"
90
+ "vitest": "^5.0.3"
91
91
  },
92
92
  "dependencies": {
93
- "@hebcal/hdate": "^0.22.8",
93
+ "@hebcal/hdate": "^0.23.0",
94
94
  "@hebcal/noaa": "^0.12.3",
95
95
  "quick-lru": "^7.3.0",
96
96
  "temporal-polyfill": "^1.0.5"
@@ -56,3 +56,6 @@ msgstr "סוכות ו׳ (חוה״מ)"
56
56
 
57
57
  msgid "Sukkot VII (Hoshana Raba)"
58
58
  msgstr "סוכות ז׳ (הושענא רבה)"
59
+
60
+ msgid "Swords of Iron War Memorial Day"
61
+ msgstr "יום הזיכרון לחללי מלחמת חרבות ברזל"
package/po/he.po CHANGED
@@ -647,3 +647,6 @@ msgstr "בִּעוּר חָמֵץ"
647
647
 
648
648
  msgid "Finish eating chametz"
649
649
  msgstr "סוֹף זְמַן אֲכִילַת חָמֵץ"
650
+
651
+ msgid "Swords of Iron War Memorial Day"
652
+ msgstr "יוֹם הַזִּכָּרוֹן לְחַלְלֵי מִלְחֶמֶת חַרְבוֹת בַּרְזֶל"