@hebcal/core 6.8.2 → 6.9.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.
- package/README.md +262 -4
- package/dist/bundle.js +1530 -944
- package/dist/bundle.js.map +1 -1
- package/dist/bundle.min.js +18 -17
- package/dist/bundle.min.js.map +1 -1
- package/dist/esm/CalOptions.d.ts +12 -2
- package/dist/esm/DailyLearning.d.ts +5 -5
- package/dist/esm/DailyLearning.js +5 -5
- package/dist/esm/DailyLearning.js.map +1 -1
- package/dist/esm/HebrewDateEvent.d.ts +2 -2
- package/dist/esm/HebrewDateEvent.js +1 -1
- package/dist/esm/HebrewDateEvent.js.map +1 -1
- package/dist/esm/HolidayEvent.d.ts +9 -4
- package/dist/esm/HolidayEvent.js +8 -3
- package/dist/esm/HolidayEvent.js.map +1 -1
- package/dist/esm/MevarchimChodeshEvent.d.ts +4 -3
- package/dist/esm/MevarchimChodeshEvent.js +3 -2
- package/dist/esm/MevarchimChodeshEvent.js.map +1 -1
- package/dist/esm/ParshaEvent.d.ts +16 -3
- package/dist/esm/ParshaEvent.js +14 -1
- package/dist/esm/ParshaEvent.js.map +1 -1
- package/dist/esm/TimedEvent.d.ts +16 -8
- package/dist/esm/TimedEvent.js +13 -5
- package/dist/esm/TimedEvent.js.map +1 -1
- package/dist/esm/YomKippurKatanEvent.d.ts +4 -3
- package/dist/esm/YomKippurKatanEvent.js +3 -2
- package/dist/esm/YomKippurKatanEvent.js.map +1 -1
- package/dist/esm/ashkenazi.po.js +1 -1
- package/dist/esm/calendar.d.ts +19 -9
- package/dist/esm/calendar.js +23 -10
- package/dist/esm/calendar.js.map +1 -1
- package/dist/esm/candles.d.ts +24 -6
- package/dist/esm/candles.js +20 -2
- package/dist/esm/candles.js.map +1 -1
- package/dist/esm/cities.json.d.ts +2 -0
- package/dist/esm/cities.json.js +68 -2
- package/dist/esm/cities.json.js.map +1 -1
- package/dist/esm/event.d.ts +3 -5
- package/dist/esm/event.js +3 -5
- package/dist/esm/event.js.map +1 -1
- package/dist/esm/getStartAndEnd.d.ts +1 -1
- package/dist/esm/getStartAndEnd.js +1 -1
- package/dist/esm/getStartAndEnd.js.map +1 -1
- package/dist/esm/hallel.d.ts +1 -1
- package/dist/esm/hallel.js +1 -1
- package/dist/esm/hallel.js.map +1 -1
- package/dist/esm/he-x-NoNikud.po.js +1 -1
- package/dist/esm/he.po.js +1 -1
- package/dist/esm/hebcal.d.ts +38 -103
- package/dist/esm/hebcal.js +34 -107
- package/dist/esm/hebcal.js.map +1 -1
- package/dist/esm/holidays.d.ts +9 -2
- package/dist/esm/holidays.js +2 -2
- package/dist/esm/holidays.js.map +1 -1
- package/dist/esm/index.d.ts +29 -27
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/isAssurBemlacha.d.ts +1 -1
- package/dist/esm/isAssurBemlacha.js +6 -3
- package/dist/esm/isAssurBemlacha.js.map +1 -1
- package/dist/esm/isAveilut.js +1 -1
- package/dist/esm/isFastDay.d.ts +1 -1
- package/dist/esm/isFastDay.js +2 -2
- package/dist/esm/isFastDay.js.map +1 -1
- package/dist/esm/locale.js +1 -1
- package/dist/esm/locale.js.map +1 -1
- package/dist/esm/location.d.ts +37 -9
- package/dist/esm/location.js +38 -10
- package/dist/esm/location.js.map +1 -1
- package/dist/esm/modern.js +1 -1
- package/dist/esm/molad.d.ts +29 -23
- package/dist/esm/molad.js +27 -21
- package/dist/esm/molad.js.map +1 -1
- package/dist/esm/moladBase.d.ts +11 -0
- package/dist/esm/moladBase.js +12 -1
- package/dist/esm/moladBase.js.map +1 -1
- package/dist/esm/moladDate.d.ts +11 -7
- package/dist/esm/moladDate.js +25 -18
- package/dist/esm/moladDate.js.map +1 -1
- package/dist/esm/omer.d.ts +21 -5
- package/dist/esm/omer.js +20 -4
- package/dist/esm/omer.js.map +1 -1
- package/dist/esm/parshaName.js +1 -1
- package/dist/esm/parshaName.js.map +1 -1
- package/dist/esm/parshaYear.d.ts +3 -3
- package/dist/esm/parshaYear.js +3 -3
- package/dist/esm/parshaYear.js.map +1 -1
- package/dist/esm/pkgVersion.d.ts +1 -1
- package/dist/esm/pkgVersion.js +2 -2
- package/dist/esm/pkgVersion.js.map +1 -1
- package/dist/esm/reformatTimeStr.d.ts +15 -3
- package/dist/esm/reformatTimeStr.js +15 -3
- package/dist/esm/reformatTimeStr.js.map +1 -1
- package/dist/esm/sedra.d.ts +45 -19
- package/dist/esm/sedra.js +39 -17
- package/dist/esm/sedra.js.map +1 -1
- package/dist/esm/sefira.json.d.ts +6 -0
- package/dist/esm/sefira.json.js +65 -3
- package/dist/esm/sefira.json.js.map +1 -1
- package/dist/esm/staticHolidays.d.ts +0 -2
- package/dist/esm/staticHolidays.js +1 -3
- package/dist/esm/staticHolidays.js.map +1 -1
- package/dist/esm/string.js +1 -1
- package/dist/esm/tachanun.js +1 -1
- package/dist/esm/tachanun.js.map +1 -1
- package/dist/esm/zmanim.d.ts +177 -142
- package/dist/esm/zmanim.js +183 -148
- package/dist/esm/zmanim.js.map +1 -1
- package/package.json +18 -15
package/dist/esm/zmanim.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v6.
|
|
1
|
+
/*! @hebcal/core v6.9.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
import 'temporal-polyfill/global';
|
|
3
3
|
import { NOAACalculator } from '@hebcal/noaa';
|
|
4
4
|
import { HDate, isDate, getTimezoneOffset, pad2, getPseudoISO } from '@hebcal/hdate';
|
|
@@ -16,16 +16,16 @@ function zdtToDate(zdt) {
|
|
|
16
16
|
return res;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
* The zenith of astronomical sunrise and sunset. The sun is 90
|
|
19
|
+
* The zenith of astronomical sunrise and sunset. The sun is 90° from the vertical 0°
|
|
20
20
|
*/
|
|
21
21
|
const GEOMETRIC_ZENITH = 90;
|
|
22
22
|
/**
|
|
23
|
-
* The zenith of 1.583
|
|
23
|
+
* The zenith of 1.583° below geometric zenith (90°). This calculation is used for
|
|
24
24
|
* calculating _netz amiti_ (sunrise) and _shkiah amiti_ (sunset) based on the opinion of the
|
|
25
|
-
*
|
|
25
|
+
* [Baal Hatanya](https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi).
|
|
26
26
|
*
|
|
27
|
-
* @see Zmanim.sunriseBaalHatanya
|
|
28
|
-
* @see Zmanim.sunsetBaalHatanya
|
|
27
|
+
* @see Zmanim.sunriseBaalHatanya
|
|
28
|
+
* @see Zmanim.sunsetBaalHatanya
|
|
29
29
|
*/
|
|
30
30
|
const ZENITH_1_POINT_583 = GEOMETRIC_ZENITH + 1.583;
|
|
31
31
|
/**
|
|
@@ -44,7 +44,7 @@ const ZENITH_1_POINT_583 = GEOMETRIC_ZENITH + 1.583;
|
|
|
44
44
|
* https://gml.noaa.gov/grad/solcalc/calcdetails.html
|
|
45
45
|
*
|
|
46
46
|
* @example
|
|
47
|
-
*
|
|
47
|
+
* import {GeoLocation, Zmanim} from '@hebcal/core';
|
|
48
48
|
* const latitude = 41.822232;
|
|
49
49
|
* const longitude = -71.448292;
|
|
50
50
|
* const tzid = 'America/New_York';
|
|
@@ -53,6 +53,7 @@ const ZENITH_1_POINT_583 = GEOMETRIC_ZENITH + 1.583;
|
|
|
53
53
|
* const zmanim = new Zmanim(gloc, friday, false);
|
|
54
54
|
* const candleLighting = zmanim.sunsetOffset(-18, true);
|
|
55
55
|
* const timeStr = Zmanim.formatISOWithTimeZone(tzid, candleLighting);
|
|
56
|
+
* // '2023-09-08T18:49:00-04:00'
|
|
56
57
|
*/
|
|
57
58
|
class Zmanim {
|
|
58
59
|
hdate;
|
|
@@ -84,15 +85,19 @@ class Zmanim {
|
|
|
84
85
|
this.useElevation = Boolean(useElevation);
|
|
85
86
|
}
|
|
86
87
|
/**
|
|
87
|
-
* Returns `true` if
|
|
88
|
-
*
|
|
88
|
+
* Returns `true` if this instance uses the location's elevation when
|
|
89
|
+
* calculating sunrise/sunset-based zmanim.
|
|
89
90
|
*/
|
|
90
91
|
getUseElevation() {
|
|
91
92
|
return this.useElevation;
|
|
92
93
|
}
|
|
93
94
|
/**
|
|
94
|
-
* Enables or disables elevation adjustment for zmanim
|
|
95
|
-
*
|
|
95
|
+
* Enables or disables elevation adjustment for sunrise/sunset-based zmanim.
|
|
96
|
+
*
|
|
97
|
+
* Degree-based zmanim (such as {@link alotHaShachar} or {@link tzeit})
|
|
98
|
+
* estimate the amount of light in the sky and are never affected by this
|
|
99
|
+
* setting.
|
|
100
|
+
* @param useElevation `true` to include the location's elevation
|
|
96
101
|
*/
|
|
97
102
|
setUseElevation(useElevation) {
|
|
98
103
|
this.useElevation = useElevation;
|
|
@@ -101,8 +106,10 @@ class Zmanim {
|
|
|
101
106
|
* Convenience function to get the time when sun is above or below the horizon
|
|
102
107
|
* for a certain angle (in degrees).
|
|
103
108
|
* This function does not support elevation adjustment.
|
|
104
|
-
* @param angle
|
|
105
|
-
*
|
|
109
|
+
* @param angle degrees of solar depression below the horizon; for example
|
|
110
|
+
* `8.5` means the center of the sun is 8.5° below the horizon
|
|
111
|
+
* @param rising `true` for the morning (before sunrise), `false` for the
|
|
112
|
+
* evening (after sunset)
|
|
106
113
|
*/
|
|
107
114
|
timeAtAngle(angle, rising) {
|
|
108
115
|
const offsetZenith = GEOMETRIC_ZENITH + angle;
|
|
@@ -176,13 +183,19 @@ class Zmanim {
|
|
|
176
183
|
return zman.sunset();
|
|
177
184
|
}
|
|
178
185
|
/**
|
|
179
|
-
*
|
|
186
|
+
* Length in milliseconds of one halachic hour of the night, calculated as
|
|
187
|
+
* one twelfth of the time between the previous day's sunset and this
|
|
188
|
+
* day's sunrise. Used internally by {@link chatzotNight}.
|
|
180
189
|
*/
|
|
181
190
|
nightHour() {
|
|
182
191
|
return (this.sunrise().getTime() - this.gregEve().getTime()) / 12; // ms in hour
|
|
183
192
|
}
|
|
184
193
|
/**
|
|
185
|
-
* Midday – Chatzot; Sunrise plus 6 halachic hours
|
|
194
|
+
* Midday – Chatzot; Sunrise plus 6 halachic hours.
|
|
195
|
+
*
|
|
196
|
+
* Unlike most sunrise/sunset-based zmanim, this is always computed from
|
|
197
|
+
* sea-level sunrise and sunset, so it is not affected by the
|
|
198
|
+
* `useElevation` setting.
|
|
186
199
|
*/
|
|
187
200
|
chatzot() {
|
|
188
201
|
const startOfDay = this.noaa.getSeaLevelSunrise();
|
|
@@ -212,6 +225,11 @@ class Zmanim {
|
|
|
212
225
|
alotHaShachar72() {
|
|
213
226
|
return this.sunriseOffset(-72, false, false);
|
|
214
227
|
}
|
|
228
|
+
/**
|
|
229
|
+
* Same as {@link alotHaShachar72}, but returns a `Temporal.ZonedDateTime`
|
|
230
|
+
* with seconds precision (instead of a `Date` rounded to the minute), or
|
|
231
|
+
* `null` if sunrise cannot be calculated for this date and location.
|
|
232
|
+
*/
|
|
215
233
|
alotHaShachar72zdt() {
|
|
216
234
|
const zdt = this.useElevation
|
|
217
235
|
? this.noaa.getSunrise()
|
|
@@ -245,8 +263,7 @@ class Zmanim {
|
|
|
245
263
|
}
|
|
246
264
|
/**
|
|
247
265
|
* Utility method for using elevation-aware sunrise/sunset
|
|
248
|
-
* @
|
|
249
|
-
* @param hours
|
|
266
|
+
* @param hours number of _shaos zmaniyos_ (solar hours) after sunrise
|
|
250
267
|
*/
|
|
251
268
|
getShaahZmanisBasedZman(hours) {
|
|
252
269
|
const startOfDay = this.useElevation
|
|
@@ -269,7 +286,7 @@ class Zmanim {
|
|
|
269
286
|
/**
|
|
270
287
|
* Latest Shacharit (Gra); Sunrise plus 4 halachic hours, according to the Gra.
|
|
271
288
|
*
|
|
272
|
-
* This method returns the latest *zman tfila* (time to recite
|
|
289
|
+
* This method returns the latest *zman tfila* (time to recite the morning prayers)
|
|
273
290
|
* that is 4 *shaos zmaniyos* (solar hours) after sunrise or sea level sunrise
|
|
274
291
|
* (depending on the `useElevation` setting), according
|
|
275
292
|
* to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).
|
|
@@ -282,21 +299,23 @@ class Zmanim {
|
|
|
282
299
|
}
|
|
283
300
|
/**
|
|
284
301
|
* This method returns the latest time for burning _chametz_ on _Erev Pesach_ according to the opinion
|
|
285
|
-
* of the
|
|
286
|
-
* opinion of the
|
|
287
|
-
*
|
|
288
|
-
*
|
|
289
|
-
* @return the
|
|
290
|
-
*
|
|
291
|
-
*
|
|
292
|
-
* returned.
|
|
302
|
+
* of the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon). This time is 5 halachic hours into the day, based on
|
|
303
|
+
* the opinion of the GRA that the day is calculated from sunrise to sunset.
|
|
304
|
+
*
|
|
305
|
+
* If elevation is enabled, this function will include elevation in the calculation.
|
|
306
|
+
* @return the `Date` of the latest time for burning _chametz_ on _Erev Pesach_. If the calculation can't be
|
|
307
|
+
* computed, such as in the Arctic Circle where there is at least one day a year where the sun does not
|
|
308
|
+
* rise and one where it does not set, an `Invalid Date` will be returned.
|
|
293
309
|
*/
|
|
294
310
|
sofZmanBiurChametzGRA() {
|
|
295
311
|
return this.getShaahZmanisBasedZman(5);
|
|
296
312
|
}
|
|
297
313
|
/**
|
|
298
|
-
* Returns
|
|
299
|
-
*
|
|
314
|
+
* Returns a 2-element array with alot (a `Date`, 72 minutes before sunrise)
|
|
315
|
+
* and the length in milliseconds of one halachic hour of the resulting day.
|
|
316
|
+
* Used internally by the Magen Avraham zmanim.
|
|
317
|
+
* @param forceSeaLevel ignore the `useElevation` setting and use sea-level
|
|
318
|
+
* sunrise and sunset
|
|
300
319
|
*/
|
|
301
320
|
getTemporalHour72(forceSeaLevel) {
|
|
302
321
|
const alot72 = this.sunriseOffset(-72, false, forceSeaLevel);
|
|
@@ -305,8 +324,11 @@ class Zmanim {
|
|
|
305
324
|
return [alot72, temporalHour];
|
|
306
325
|
}
|
|
307
326
|
/**
|
|
308
|
-
* Returns
|
|
309
|
-
*
|
|
327
|
+
* Returns a 2-element array with alot (a `Date`, when the sun is `angle`
|
|
328
|
+
* degrees below the horizon in the morning) and the length in milliseconds
|
|
329
|
+
* of one halachic hour of the resulting day. Used internally by the
|
|
330
|
+
* degree-based Magen Avraham zmanim.
|
|
331
|
+
* @param angle degrees of solar depression below the horizon
|
|
310
332
|
*/
|
|
311
333
|
getTemporalHourByDeg(angle) {
|
|
312
334
|
const alot = this.timeAtAngle(angle, true);
|
|
@@ -387,7 +409,7 @@ class Zmanim {
|
|
|
387
409
|
* Earliest Mincha – Mincha Gedola (GRA); Sunrise plus 6.5 halachic hours.
|
|
388
410
|
* If elevation is enabled, this function will include elevation in the calculation.
|
|
389
411
|
*
|
|
390
|
-
* This method returns
|
|
412
|
+
* This method returns *mincha gedola*, the earliest time one can pray mincha,
|
|
391
413
|
* that is 6.5 shaos zmaniyos (solar hours) after sunrise or sea level sunrise
|
|
392
414
|
* (depending on the `useElevation` setting), according
|
|
393
415
|
* to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).
|
|
@@ -445,14 +467,24 @@ class Zmanim {
|
|
|
445
467
|
return this.getShaahZmanisBasedZman(10.75);
|
|
446
468
|
}
|
|
447
469
|
/**
|
|
448
|
-
*
|
|
449
|
-
*
|
|
470
|
+
* Nightfall – Tzeit HaKochavim; the sun is `angle` degrees below the
|
|
471
|
+
* horizon in the evening.
|
|
472
|
+
*
|
|
450
473
|
* Because degree-based functions estimate the amount of light in the sky,
|
|
451
474
|
* the result is not impacted by elevation.
|
|
475
|
+
* @param [angle=8.5] optional time for solar depression.
|
|
476
|
+
* Default is 8.5 degrees for 3 small stars, use 7.083 degrees for 3 medium-sized stars.
|
|
452
477
|
*/
|
|
453
478
|
tzeit(angle = 8.5) {
|
|
454
479
|
return this.timeAtAngle(angle, false);
|
|
455
480
|
}
|
|
481
|
+
/**
|
|
482
|
+
* Nightfall – Tzeit HaKochavim; calculated as 72 minutes after sunset
|
|
483
|
+
* (or sea-level sunset, depending on the `useElevation` setting).
|
|
484
|
+
*
|
|
485
|
+
* Returns a `Temporal.ZonedDateTime` with seconds precision, or `null` if
|
|
486
|
+
* sunset cannot be calculated for this date and location.
|
|
487
|
+
*/
|
|
456
488
|
tzeit72() {
|
|
457
489
|
const zdt = this.useElevation
|
|
458
490
|
? this.noaa.getSunset()
|
|
@@ -549,12 +581,13 @@ class Zmanim {
|
|
|
549
581
|
return moladBasedTime.withTimeZone(this.gloc.getTimeZone());
|
|
550
582
|
}
|
|
551
583
|
/**
|
|
552
|
-
* Returns the latest time of Kiddush Levana according to the
|
|
553
|
-
*
|
|
584
|
+
* Returns the latest time of Kiddush Levana according to the
|
|
585
|
+
* [Maharil's](https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin) opinion that it is calculated as
|
|
554
586
|
* halfway between _molad_ and _molad_. This adds half the 29 days, 12 hours and 793 chalakim time between
|
|
555
587
|
* _molad_ and _molad_ (14 days, 18 hours, 22 minutes and 666 milliseconds) to the month's _molad_.
|
|
556
|
-
*
|
|
557
|
-
*
|
|
588
|
+
*
|
|
589
|
+
* The _sof zman Kiddush Levana_ will be returned even if it occurs during the day, unless both `alos` and
|
|
590
|
+
* `tzais` are supplied.
|
|
558
591
|
*
|
|
559
592
|
* @param alos
|
|
560
593
|
* the beginning of the Jewish day. If _Kidush Levana_ occurs during the day (starting at _alos_ and
|
|
@@ -564,9 +597,9 @@ class Zmanim {
|
|
|
564
597
|
* the end of the Jewish day. If Kidush Levana occurs during the day (starting at alos and ending at
|
|
565
598
|
* tzais), the time returned will be alos. If either the alos or tzais parameters are null, no daytime
|
|
566
599
|
* adjustment will be made.
|
|
567
|
-
* @return the
|
|
568
|
-
* _alos_ and _tzais_, _alos_ will be returned. If the _zman_ will not occur on this
|
|
569
|
-
* day,
|
|
600
|
+
* @return the `Temporal.ZonedDateTime` representing the moment halfway between molad and molad. If the time
|
|
601
|
+
* occurs between _alos_ and _tzais_, _alos_ will be returned. If the _zman_ will not occur on this
|
|
602
|
+
* day, `null` will be returned.
|
|
570
603
|
*/
|
|
571
604
|
getSofZmanKidushLevanaBetweenMoldos(alos = null, tzais = null) {
|
|
572
605
|
const hd = this.hdate;
|
|
@@ -583,19 +616,25 @@ class Zmanim {
|
|
|
583
616
|
/**
|
|
584
617
|
* Returns the latest time of _Kiddush Levana_ calculated as 15 days after the molad. This is the opinion of
|
|
585
618
|
* the Shulchan Aruch (Orach Chaim 426). It should be noted that some opinions hold that the
|
|
586
|
-
*
|
|
587
|
-
*
|
|
588
|
-
* {@link getSofZmanKidushLevanaBetweenMoldos half way between _molad_ and _molad_} is of
|
|
589
|
-
* the opinion that the Mechaber agrees to his opinion. Also see the Aruch Hashulchan. For additional details on
|
|
590
|
-
*
|
|
591
|
-
* Zmanim
|
|
592
|
-
* between _tzais_ and _alos_, see {@link getSofZmanKidushLevana15Days}.
|
|
593
|
-
*
|
|
594
|
-
* @return the Date representing the moment 15 days after the _molad_. If the time occurs between
|
|
595
|
-
* _alos_ and _tzais_, _alos_ will be returned. If the _zman_ will not occur on this day, a
|
|
596
|
-
* `null` will be returned.
|
|
619
|
+
* [Rema](https://en.wikipedia.org/wiki/Moses_Isserles), who brings down the opinion of the
|
|
620
|
+
* [Maharil](https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin) of calculating
|
|
621
|
+
* {@link getSofZmanKidushLevanaBetweenMoldos half way between _molad_ and _molad_}, is of
|
|
622
|
+
* the opinion that the Mechaber agrees to his opinion. Also see the Aruch Hashulchan. For additional details on
|
|
623
|
+
* the subject, see Rabbi Dovid Heber's very detailed write-up in Siman Daled (chapter 4) of
|
|
624
|
+
* [Shaarei Zmanim](https://hebrewbooks.org/53000).
|
|
597
625
|
*
|
|
626
|
+
* The _sof zman Kiddush Levana_ will be returned even if it occurs during the day, unless both `alos` and
|
|
627
|
+
* `tzais` are supplied.
|
|
598
628
|
*
|
|
629
|
+
* @param alos
|
|
630
|
+
* the beginning of the Jewish day. If either the _alos_ or _tzais_ parameters are null, no daytime
|
|
631
|
+
* adjustment will be made.
|
|
632
|
+
* @param tzais
|
|
633
|
+
* the end of the Jewish day. If either the _alos_ or _tzais_ parameters are null, no daytime
|
|
634
|
+
* adjustment will be made.
|
|
635
|
+
* @return the `Temporal.ZonedDateTime` representing the moment 15 days after the _molad_. If the time occurs
|
|
636
|
+
* between _alos_ and _tzais_, _alos_ will be returned. If the _zman_ will not occur on this day,
|
|
637
|
+
* `null` will be returned.
|
|
599
638
|
*/
|
|
600
639
|
getSofZmanKidushLevana15Days(alos = null, tzais = null) {
|
|
601
640
|
const hd = this.hdate;
|
|
@@ -610,8 +649,8 @@ class Zmanim {
|
|
|
610
649
|
return this.getMoladBasedTime(molad.getSofZmanKidushLevana15Days(), alos, tzais, false);
|
|
611
650
|
}
|
|
612
651
|
/**
|
|
613
|
-
* Returns the earliest time of _Kiddush Levana_ according to
|
|
614
|
-
*
|
|
652
|
+
* Returns the earliest time of _Kiddush Levana_ according to
|
|
653
|
+
* [Rabbeinu Yonah](https://en.wikipedia.org/wiki/Yonah_Gerondi)'s opinion that it can be said 3 days after the _molad_.
|
|
615
654
|
* If the time of _tchilas zman Kiddush Levana_ occurs during the day (between _alos_ and _tzais_ passed to
|
|
616
655
|
* this method) it will return the following _tzais_. If null is passed for either _alos_ or _tzais_, the actual
|
|
617
656
|
* _tchilas zman Kiddush Levana_ will be returned, regardless of if it is during the day or not.
|
|
@@ -625,8 +664,8 @@ class Zmanim {
|
|
|
625
664
|
* _tzais_), the time returned will be _tzais_. If either the _alos_ or _tzais_ parameters
|
|
626
665
|
* are null, no daytime adjustment will be made.
|
|
627
666
|
*
|
|
628
|
-
* @return the
|
|
629
|
-
* _tzais_, _tzais_ will be returned. If the _zman_ will not occur on this day,
|
|
667
|
+
* @return the `Temporal.ZonedDateTime` representing the moment 3 days after the molad. If the time occurs
|
|
668
|
+
* between _alos_ and _tzais_, _tzais_ will be returned. If the _zman_ will not occur on this day,
|
|
630
669
|
* `null` will be returned.
|
|
631
670
|
*/
|
|
632
671
|
getTchilasZmanKidushLevana3Days(alos = null, tzais = null) {
|
|
@@ -651,13 +690,11 @@ class Zmanim {
|
|
|
651
690
|
return zman;
|
|
652
691
|
}
|
|
653
692
|
/**
|
|
654
|
-
* Returns the point in time of _Molad_
|
|
655
|
-
* minute and chalakim, {@link Molad
|
|
656
|
-
* {@link HebrewDateFormatter} that will have formatting for this.
|
|
657
|
-
*
|
|
658
|
-
* @return the Date representing the moment of the molad. If the _molad_ does not occur on this day, a
|
|
659
|
-
* `null` will be returned.
|
|
693
|
+
* Returns the point in time of the _Molad_, if it occurs on this date. For the traditional day of week, hour,
|
|
694
|
+
* minute and chalakim, see {@link Molad} and its {@link Molad.render} method.
|
|
660
695
|
*
|
|
696
|
+
* @return the `Temporal.ZonedDateTime` representing the moment of the molad. If the _molad_ does not occur on
|
|
697
|
+
* this day, `null` will be returned.
|
|
661
698
|
*/
|
|
662
699
|
getZmanMolad() {
|
|
663
700
|
const hd = this.hdate;
|
|
@@ -680,10 +717,17 @@ class Zmanim {
|
|
|
680
717
|
/**
|
|
681
718
|
* Returns the earliest time of _Kiddush Levana_ according to the opinions that it should not be said until 7
|
|
682
719
|
* days after the _molad_. The time will be returned even if it occurs during the day when _Kiddush Levana_
|
|
683
|
-
* can't be recited
|
|
720
|
+
* can't be recited, unless both `alos` and `tzais` are supplied.
|
|
684
721
|
*
|
|
685
|
-
* @
|
|
686
|
-
*
|
|
722
|
+
* @param alos
|
|
723
|
+
* the beginning of the Jewish day. If _Kidush Levana_ occurs during the day (starting at _alos_ and
|
|
724
|
+
* ending at _tzais_), the time returned will be _tzais_. If either the _alos_ or _tzais_ parameters
|
|
725
|
+
* are null, no daytime adjustment will be made.
|
|
726
|
+
* @param tzais
|
|
727
|
+
* the end of the Jewish day. If either the _alos_ or _tzais_ parameters are null, no daytime
|
|
728
|
+
* adjustment will be made.
|
|
729
|
+
* @return the `Temporal.ZonedDateTime` representing the moment 7 days after the molad. If the _zman_
|
|
730
|
+
* will not occur on this day, `null` will be returned.
|
|
687
731
|
*/
|
|
688
732
|
getTchilasZmanKidushLevana7Days(alos = null, tzais = null) {
|
|
689
733
|
const hd = this.hdate;
|
|
@@ -699,41 +743,38 @@ class Zmanim {
|
|
|
699
743
|
return this.getMoladBasedTime(molad.getTchilasZmanKidushLevana7Days(), alos, tzais, true);
|
|
700
744
|
}
|
|
701
745
|
/**
|
|
702
|
-
* A method that returns the
|
|
746
|
+
* A method that returns the [Baal Hatanya](https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi)'s
|
|
703
747
|
* _netz amiti_ (sunrise) without
|
|
704
748
|
* elevation adjustment. This forms the base for the Baal Hatanya's dawn-based calculations that are
|
|
705
749
|
* calculated as a dip below the horizon before sunrise.
|
|
706
750
|
*
|
|
707
751
|
* According to the Baal Hatanya, _netz amiti_, or true (halachic) sunrise, is when the top of the sun's
|
|
708
752
|
* disk is visible at an elevation similar to the mountains of Eretz Yisrael. The time is calculated as the point at which
|
|
709
|
-
* the center of the sun's disk is 1.583
|
|
710
|
-
* DovBer Levine's commentary on
|
|
711
|
-
* Hatanya's Seder Hachnasas Shabbos
|
|
712
|
-
*
|
|
713
|
-
* below the sea level horizon. This in turn is based on the Gemara
|
|
714
|
-
*
|
|
753
|
+
* the center of the sun's disk is 1.583° below the horizon. This degree-based calculation can be found in Rabbi Shalom
|
|
754
|
+
* DovBer Levine's commentary on
|
|
755
|
+
* [The Baal Hatanya's Seder Hachnasas Shabbos](https://www.chabadlibrary.org/books/pdf/Seder-Hachnosas-Shabbos.pdf).
|
|
756
|
+
* From an elevation of 546 meters, the top of [Har Hacarmel](https://en.wikipedia.org/wiki/Mount_Carmel),
|
|
757
|
+
* the sun disappears when it is 1° 35' or 1.583° below the sea level horizon. This in turn is based on the Gemara
|
|
758
|
+
* [Shabbos 35a](https://hebrewbooks.org/shas.aspx?mesechta=2&daf=35). There are other opinions brought down by
|
|
715
759
|
* Rabbi Levine, including Rabbi Yosef Yitzchok Feigelstock who calculates it as the degrees below the horizon 4 minutes after
|
|
716
|
-
* sunset in Yerushalayim (on the equinox). That is brought down as 1.583
|
|
717
|
-
* and is probably a typo and should be 1.683
|
|
718
|
-
*
|
|
719
|
-
*
|
|
720
|
-
* _Zmanim_ Calculations @ Chabad.org</a>.
|
|
760
|
+
* sunset in Yerushalayim (on the equinox). That is brought down as 1.583°. This is identical to the 1° 35' _zman_
|
|
761
|
+
* and is probably a typo and should be 1.683°. These calculations are used by most
|
|
762
|
+
* [Chabad](https://en.wikipedia.org/wiki/Chabad) calendars that use the Baal Hatanya's _zmanim_. See
|
|
763
|
+
* [About Our Zmanim Calculations @ Chabad.org](https://www.chabad.org/library/article_cdo/aid/3209349/jewish/About-Our-Zmanim-Calculations.htm).
|
|
721
764
|
*
|
|
722
765
|
* Note: _netz amiti_ is used only for calculating certain _zmanim_, and is intentionally unpublished. For
|
|
723
766
|
* practical purposes, daytime _mitzvos_ like _shofar_ and _lulav_ should not be done until after the
|
|
724
767
|
* published time for _netz_ / sunrise.
|
|
725
768
|
*
|
|
726
|
-
* @return the
|
|
727
|
-
* computed such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
|
|
728
|
-
* where it does not set,
|
|
729
|
-
*
|
|
730
|
-
* @see ZENITH_1_POINT_583
|
|
769
|
+
* @return the exact sea level _netz amiti_ (sunrise) time. If the calculation can't be
|
|
770
|
+
* computed, such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
|
|
771
|
+
* where it does not set, `null` will be returned.
|
|
731
772
|
*/
|
|
732
773
|
getSunriseBaalHatanya() {
|
|
733
774
|
return this.noaa.getSunriseOffsetByDegrees(ZENITH_1_POINT_583);
|
|
734
775
|
}
|
|
735
776
|
/**
|
|
736
|
-
* A method that returns the
|
|
777
|
+
* A method that returns the [Baal Hatanya](https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi)'s
|
|
737
778
|
* _shkiah amiti_ (sunset) without
|
|
738
779
|
* elevation adjustment. This forms the base for the Baal Hatanya's dusk-based calculations that are calculated
|
|
739
780
|
* as a dip below the horizon after sunset.
|
|
@@ -746,33 +787,31 @@ class Zmanim {
|
|
|
746
787
|
* practical purposes, all daytime mitzvos should be completed before the published time for _shkiah_ / sunset.
|
|
747
788
|
*
|
|
748
789
|
* For further explanation of the calculations used for the Baal Hatanya's _zmanim_ in this library, see
|
|
749
|
-
*
|
|
750
|
-
* _Zmanim_ Calculations @ Chabad.org</a>.
|
|
751
|
-
*
|
|
752
|
-
* @return the <code>Date</code> representing the exact sea level _shkiah amiti_ (sunset) time. If the calculation
|
|
753
|
-
* can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does not
|
|
754
|
-
* rise, and one where it does not set, a `null` will be returned.
|
|
790
|
+
* [About Our Zmanim Calculations @ Chabad.org](https://www.chabad.org/library/article_cdo/aid/3209349/jewish/About-Our-Zmanim-Calculations.htm).
|
|
755
791
|
*
|
|
756
|
-
* @
|
|
792
|
+
* @return the exact sea level _shkiah amiti_ (sunset) time. If the calculation
|
|
793
|
+
* can't be computed, such as in the Arctic Circle where there is at least one day a year where the sun does not
|
|
794
|
+
* rise, and one where it does not set, `null` will be returned.
|
|
757
795
|
*/
|
|
758
796
|
getSunsetBaalHatanya() {
|
|
759
797
|
return this.noaa.getSunsetOffsetByDegrees(ZENITH_1_POINT_583);
|
|
760
798
|
}
|
|
761
799
|
/**
|
|
762
|
-
* Returns the
|
|
763
|
-
* (dawn) calculated as the time when the sun is 16.9
|
|
764
|
-
* before {@link
|
|
800
|
+
* Returns the [Baal Hatanya](https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi)'s _alos_
|
|
801
|
+
* (dawn) calculated as the time when the sun is 16.9° below the eastern geometric horizon
|
|
802
|
+
* before {@link sunrise}.
|
|
765
803
|
*
|
|
766
|
-
* The zenith of 16.9
|
|
767
|
-
* and _netz amiti_ (sunrise) is 72 minutes, the time that
|
|
768
|
-
* a mil (
|
|
769
|
-
* minutes before
|
|
770
|
-
*
|
|
771
|
-
* 16.9
|
|
804
|
+
* The zenith of 16.9° below is based on the calculation that the time between dawn
|
|
805
|
+
* and _netz amiti_ (sunrise) is 72 minutes, the time that it takes to walk 4 mil at 18 minutes
|
|
806
|
+
* a mil ([Rambam](https://en.wikipedia.org/wiki/Maimonides) and others). The sun's position at 72
|
|
807
|
+
* minutes before _netz amiti_ (sunrise) in Jerusalem
|
|
808
|
+
* [around the equinox / equilux](https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/)
|
|
809
|
+
* is 16.9° below geometric zenith.
|
|
772
810
|
*
|
|
773
|
-
* @return
|
|
811
|
+
* @return the `Date` of dawn. If the calculation can't be computed, such as in northern and southern
|
|
774
812
|
* locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may not reach
|
|
775
|
-
* low enough below the horizon for this calculation,
|
|
813
|
+
* low enough below the horizon for this calculation, an `Invalid Date` will be returned.
|
|
814
|
+
*/
|
|
776
815
|
alosBaalHatanya() {
|
|
777
816
|
return this.timeAtAngle(16.9, true);
|
|
778
817
|
}
|
|
@@ -782,86 +821,79 @@ class Zmanim {
|
|
|
782
821
|
}
|
|
783
822
|
/**
|
|
784
823
|
* This method returns the latest _zman krias shema_ (time to recite Shema in the morning). This time is 3
|
|
785
|
-
*
|
|
786
|
-
*
|
|
787
|
-
* sunrise to sunset. This returns the time 3 * {@link getShaahZmanisBaalHatanya()} after {@link getSunriseBaalHatanya()
|
|
788
|
-
* _netz amiti_ (sunrise)}.
|
|
824
|
+
* _shaos zmaniyos_ (solar hours) after _netz amiti_ (sunrise), based on the opinion of the Baal Hatanya
|
|
825
|
+
* that the day is calculated from _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).
|
|
789
826
|
*
|
|
790
|
-
* @return the
|
|
791
|
-
* can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does
|
|
792
|
-
* not rise
|
|
827
|
+
* @return the `Date` of the latest _zman shema_ according to the Baal Hatanya. If the calculation
|
|
828
|
+
* can't be computed, such as in the Arctic Circle where there is at least one day a year where the sun does
|
|
829
|
+
* not rise and one where it does not set, an `Invalid Date` will be returned.
|
|
793
830
|
*/
|
|
794
831
|
sofZmanShmaBaalHatanya() {
|
|
795
832
|
return this.getShaahZmanisBaalHatanya(3);
|
|
796
833
|
}
|
|
797
834
|
/**
|
|
798
835
|
* This method returns the latest _zman tfilah_ (time to recite the morning prayers). This time is 4
|
|
799
|
-
* hours into the day based on the opinion of the Baal Hatanya that the day is
|
|
800
|
-
* calculated from sunrise to
|
|
801
|
-
* {@link getSunriseBaalHatanya() _netz amiti_ (sunrise)}.
|
|
836
|
+
* halachic hours into the day, based on the opinion of the Baal Hatanya that the day is
|
|
837
|
+
* calculated from _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).
|
|
802
838
|
*
|
|
803
|
-
* @return the
|
|
804
|
-
* the Arctic Circle where there is at least one day a year where the sun does not rise
|
|
805
|
-
* not set,
|
|
839
|
+
* @return the `Date` of the latest _zman tfilah_. If the calculation can't be computed, such as in
|
|
840
|
+
* the Arctic Circle where there is at least one day a year where the sun does not rise and one where it does
|
|
841
|
+
* not set, an `Invalid Date` will be returned.
|
|
806
842
|
*/
|
|
807
843
|
sofZmanTfilaBaalHatanya() {
|
|
808
844
|
return this.getShaahZmanisBaalHatanya(4);
|
|
809
845
|
}
|
|
810
846
|
/**
|
|
811
847
|
* This method returns the time of _mincha gedola_. _Mincha gedola_ is the earliest time one can pray
|
|
812
|
-
* _mincha_. The
|
|
813
|
-
* better to delay _mincha_ until {@link minchaKetanaBaalHatanya
|
|
814
|
-
*
|
|
815
|
-
*
|
|
816
|
-
*
|
|
817
|
-
* _lechatchila_ starting at _mincha gedola_. This is calculated as 6.5
|
|
818
|
-
*
|
|
819
|
-
*
|
|
820
|
-
*
|
|
821
|
-
*
|
|
822
|
-
*
|
|
823
|
-
* and one where it does not set, a `null` will be returned.
|
|
848
|
+
* _mincha_. The [Rambam](https://en.wikipedia.org/wiki/Maimonides) is of the opinion that it is
|
|
849
|
+
* better to delay _mincha_ until {@link minchaKetanaBaalHatanya | _mincha ketana_} while the
|
|
850
|
+
* [Ra"sh](https://en.wikipedia.org/wiki/Asher_ben_Jehiel),
|
|
851
|
+
* [Tur](https://en.wikipedia.org/wiki/Jacob_ben_Asher),
|
|
852
|
+
* [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon) and others are of the opinion that _mincha_ can be prayed
|
|
853
|
+
* _lechatchila_ starting at _mincha gedola_. This is calculated as 6.5 sea level solar hours after
|
|
854
|
+
* _netz amiti_ (sunrise), based on the opinion of the Baal Hatanya that the day is calculated from
|
|
855
|
+
* _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).
|
|
856
|
+
* @return the `Date` of the time of _mincha gedola_ according to the Baal Hatanya. If the calculation
|
|
857
|
+
* 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
|
|
858
|
+
* and one where it does not set, an `Invalid Date` will be returned.
|
|
824
859
|
*/
|
|
825
860
|
minchaGedolaBaalHatanya() {
|
|
826
861
|
return this.getShaahZmanisBaalHatanya(6.5);
|
|
827
862
|
}
|
|
828
863
|
/**
|
|
829
864
|
* This method returns the time of _mincha ketana_. This is the preferred earliest time to pray
|
|
830
|
-
* _mincha_ in the opinion of the
|
|
831
|
-
* For more information on this see the documentation on {@link minchaGedolaBaalHatanya
|
|
832
|
-
* This is calculated as 9.5 sea level solar hours after
|
|
833
|
-
*
|
|
834
|
-
* day is calculated from sunrise to sunset. This returns the time 9.5 * after
|
|
835
|
-
* _netz amiti_ (sunrise).
|
|
865
|
+
* _mincha_ in the opinion of the [Rambam](https://en.wikipedia.org/wiki/Maimonides) and others.
|
|
866
|
+
* For more information on this see the documentation on {@link minchaGedolaBaalHatanya | _mincha gedola_}.
|
|
867
|
+
* This is calculated as 9.5 sea level solar hours after _netz amiti_ (sunrise), based on the opinion of
|
|
868
|
+
* the Baal Hatanya that the day is calculated from _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).
|
|
836
869
|
*
|
|
837
|
-
* @return the
|
|
838
|
-
* in the Arctic Circle where there is at least one day a year where the sun does not rise
|
|
839
|
-
* does not set,
|
|
870
|
+
* @return the `Date` of the time of _mincha ketana_. If the calculation can't be computed, such as
|
|
871
|
+
* in the Arctic Circle where there is at least one day a year where the sun does not rise and one where it
|
|
872
|
+
* does not set, an `Invalid Date` will be returned.
|
|
840
873
|
*/
|
|
841
874
|
minchaKetanaBaalHatanya() {
|
|
842
875
|
return this.getShaahZmanisBaalHatanya(9.5);
|
|
843
876
|
}
|
|
844
877
|
/**
|
|
845
|
-
* This method returns the time of _plag hamincha_. This is calculated as 10.75
|
|
846
|
-
*
|
|
847
|
-
* from sunrise to
|
|
848
|
-
* {@link getSunriseBaalHatanya() _netz amiti_ (sunrise)}.
|
|
878
|
+
* This method returns the time of _plag hamincha_. This is calculated as 10.75 sea level solar hours
|
|
879
|
+
* after _netz amiti_ (sunrise), based on the opinion of the Baal Hatanya that the day is calculated
|
|
880
|
+
* from _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).
|
|
849
881
|
*
|
|
850
|
-
* @return the
|
|
851
|
-
* in the Arctic Circle where there is at least one day a year where the sun does
|
|
852
|
-
* does not set,
|
|
882
|
+
* @return the `Date` of the time of _plag hamincha_ according to the Baal Hatanya. If the calculation
|
|
883
|
+
* can't be computed, such as in the Arctic Circle where there is at least one day a year where the sun does
|
|
884
|
+
* not rise and one where it does not set, an `Invalid Date` will be returned.
|
|
853
885
|
*/
|
|
854
886
|
plagHaminchaBaalHatanya() {
|
|
855
887
|
return this.getShaahZmanisBaalHatanya(10.75);
|
|
856
888
|
}
|
|
857
889
|
/**
|
|
858
|
-
* A method that returns _tzais_ (nightfall) when the sun is 6
|
|
859
|
-
* (90
|
|
860
|
-
*
|
|
890
|
+
* A method that returns _tzais_ (nightfall) when the sun is 6° below the western geometric horizon
|
|
891
|
+
* (90°) after {@link sunset}. This is the time the Baal Hatanya calls _shkiah amiti_ plus the
|
|
892
|
+
* interval it takes the sun to descend a further 6°.
|
|
861
893
|
*
|
|
862
|
-
* @return
|
|
863
|
-
* locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may not
|
|
864
|
-
* low enough below the horizon for this calculation,
|
|
894
|
+
* @return the `Date` of nightfall. If the calculation can't be computed, such as in northern and southern
|
|
895
|
+
* locations — even south of the Arctic Circle and north of the Antarctic Circle — where the sun may not
|
|
896
|
+
* reach low enough below the horizon for this calculation, an `Invalid Date` will be returned.
|
|
865
897
|
*/
|
|
866
898
|
tzaisBaalHatanya() {
|
|
867
899
|
return this.timeAtAngle(6, false);
|
|
@@ -869,6 +901,9 @@ class Zmanim {
|
|
|
869
901
|
/**
|
|
870
902
|
* Uses timeFormat to return a date like '20:34'.
|
|
871
903
|
* Returns `XX:XX` if the date is invalid.
|
|
904
|
+
* @param dt the time to format
|
|
905
|
+
* @param timeFormat formatter to use, e.g. from
|
|
906
|
+
* {@link Location.getTimeFormatter}
|
|
872
907
|
*/
|
|
873
908
|
static formatTime(dt, timeFormat) {
|
|
874
909
|
if (isNaN(dt.getTime())) {
|
|
@@ -978,7 +1013,7 @@ class Zmanim {
|
|
|
978
1013
|
* (for example `2024-09-22T20:07`), this function would return a
|
|
979
1014
|
* Hebrew date of `20th of Elul, 5784`.
|
|
980
1015
|
* @example
|
|
981
|
-
*
|
|
1016
|
+
* import {GeoLocation, Zmanim, HDate} from '@hebcal/core';
|
|
982
1017
|
* const latitude = 48.85341;
|
|
983
1018
|
* const longitude = 2.3488;
|
|
984
1019
|
* const timezone = 'Europe/Paris';
|