@hebcal/core 6.0.8 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DailyLearning.d.ts +1 -1
- package/dist/HolidayEvent.d.ts +1 -0
- package/dist/ashkenazi.po.d.ts +14 -2
- package/dist/bundle.js +2085 -1535
- package/dist/bundle.js.map +1 -1
- package/dist/bundle.min.js +17 -19
- package/dist/bundle.min.js.map +1 -1
- package/dist/coverage/block-navigation.d.ts +1 -0
- package/dist/coverage/block-navigation.js +70 -0
- package/dist/coverage/prettify.d.ts +0 -0
- package/dist/coverage/prettify.js +477 -0
- package/dist/coverage/sorter.d.ts +1 -0
- package/dist/coverage/sorter.js +176 -0
- package/dist/eslint.config.d.mts +83 -0
- package/dist/eslint.config.mjs +28 -0
- package/dist/esm/DailyLearning.d.ts +1 -1
- package/dist/esm/DailyLearning.js +1 -1
- package/dist/esm/DailyLearning.js.map +1 -1
- package/dist/esm/HebrewDateEvent.js +5 -5
- package/dist/esm/HebrewDateEvent.js.map +1 -1
- package/dist/esm/HolidayEvent.d.ts +1 -0
- package/dist/esm/HolidayEvent.js +17 -1
- package/dist/esm/HolidayEvent.js.map +1 -1
- package/dist/esm/MevarchimChodeshEvent.js +2 -1
- package/dist/esm/MevarchimChodeshEvent.js.map +1 -1
- package/dist/esm/ParshaEvent.js +2 -1
- package/dist/esm/ParshaEvent.js.map +1 -1
- package/dist/esm/TimedEvent.js +9 -3
- package/dist/esm/TimedEvent.js.map +1 -1
- package/dist/esm/YomKippurKatanEvent.js +2 -1
- package/dist/esm/YomKippurKatanEvent.js.map +1 -1
- package/dist/esm/ashkenazi.po.d.ts +14 -2
- package/dist/esm/ashkenazi.po.js +2 -2
- package/dist/esm/ashkenazi.po.js.map +1 -1
- package/dist/esm/calendar.js +6 -8
- package/dist/esm/calendar.js.map +1 -1
- package/dist/esm/candles.js +11 -3
- package/dist/esm/candles.js.map +1 -1
- package/dist/esm/event.js +18 -1
- package/dist/esm/event.js.map +1 -1
- package/dist/esm/getStartAndEnd.js +2 -2
- package/dist/esm/getStartAndEnd.js.map +1 -1
- package/dist/esm/hallel.js +1 -1
- package/dist/esm/he-x-NoNikud.po.js +1 -1
- package/dist/esm/he.po.d.ts +20 -0
- package/dist/esm/he.po.js +2 -2
- package/dist/esm/he.po.js.map +1 -1
- package/dist/esm/hebcal.js +3 -3
- package/dist/esm/hebcal.js.map +1 -1
- package/dist/esm/holidays.js +3 -3
- package/dist/esm/holidays.js.map +1 -1
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/isAssurBemlacha.js +1 -1
- package/dist/esm/locale.d.ts +1 -2
- package/dist/esm/locale.js +1 -1
- package/dist/esm/locale.js.map +1 -1
- package/dist/esm/location.js +7 -1
- package/dist/esm/location.js.map +1 -1
- package/dist/esm/modern.js +1 -1
- package/dist/esm/molad.d.ts +71 -1
- package/dist/esm/molad.js +113 -12
- package/dist/esm/molad.js.map +1 -1
- package/dist/esm/moladBase.d.ts +15 -0
- package/dist/esm/moladBase.js +83 -0
- package/dist/esm/moladBase.js.map +1 -0
- package/dist/esm/moladDate.d.ts +12 -0
- package/dist/esm/moladDate.js +63 -0
- package/dist/esm/moladDate.js.map +1 -0
- package/dist/esm/omer.d.ts +0 -1
- package/dist/esm/omer.js +7 -4
- package/dist/esm/omer.js.map +1 -1
- package/dist/esm/parshaName.js +2 -2
- package/dist/esm/parshaName.js.map +1 -1
- package/dist/esm/parshaYear.js +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.js +5 -6
- package/dist/esm/reformatTimeStr.js.map +1 -1
- package/dist/esm/sedra.js +13 -7
- package/dist/esm/sedra.js.map +1 -1
- package/dist/esm/staticHolidays.js +1 -1
- package/dist/esm/tachanun.js +4 -4
- package/dist/esm/tachanun.js.map +1 -1
- package/dist/esm/zmanim.d.ts +114 -1
- package/dist/esm/zmanim.js +242 -8
- package/dist/esm/zmanim.js.map +1 -1
- package/dist/he.po.d.ts +20 -0
- package/dist/index.d.ts +2 -0
- package/dist/locale.d.ts +1 -2
- package/dist/molad.d.ts +71 -1
- package/dist/moladBase.d.ts +15 -0
- package/dist/moladDate.d.ts +12 -0
- package/dist/omer.d.ts +0 -1
- package/dist/pkgVersion.d.ts +1 -1
- package/dist/po2json.js +3 -4
- package/dist/src/DailyLearning.d.ts +1 -1
- package/dist/src/HebrewDateEvent.js +4 -4
- package/dist/src/HolidayEvent.d.ts +1 -0
- package/dist/src/HolidayEvent.js +16 -0
- package/dist/src/MevarchimChodeshEvent.js +1 -0
- package/dist/src/ParshaEvent.js +1 -0
- package/dist/src/TimedEvent.js +8 -2
- package/dist/src/YomKippurKatanEvent.js +1 -0
- package/dist/src/ashkenazi.po.d.ts +14 -2
- package/dist/src/ashkenazi.po.js +1 -1
- package/dist/src/calendar.js +5 -7
- package/dist/src/candles.js +10 -2
- package/dist/src/event.js +17 -0
- package/dist/src/getStartAndEnd.js +1 -1
- package/dist/src/he.po.d.ts +20 -0
- package/dist/src/he.po.js +1 -1
- package/dist/src/hebcal.js +2 -2
- package/dist/src/holidays.js +2 -2
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +2 -0
- package/dist/src/locale.d.ts +1 -2
- package/dist/src/locale.js +1 -1
- package/dist/src/location.js +6 -0
- package/dist/src/molad.d.ts +71 -1
- package/dist/src/molad.js +112 -11
- package/dist/src/moladBase.d.ts +15 -0
- package/dist/src/moladBase.js +78 -0
- package/dist/src/moladDate.d.ts +12 -0
- package/dist/src/moladDate.js +58 -0
- package/dist/src/omer.d.ts +0 -1
- package/dist/src/omer.js +6 -3
- package/dist/src/parshaName.js +1 -1
- package/dist/src/pkgVersion.d.ts +1 -1
- package/dist/src/pkgVersion.js +1 -1
- package/dist/src/reformatTimeStr.js +4 -5
- package/dist/src/sedra.js +12 -6
- package/dist/src/tachanun.js +3 -3
- package/dist/src/zmanim.d.ts +114 -1
- package/dist/src/zmanim.js +240 -6
- package/dist/version.js +1 -2
- package/dist/zmanim.d.ts +114 -1
- package/package.json +17 -19
- package/dist/size-demo/dist/getHoliday.d.ts +0 -1944
- package/dist/size-demo/dist/getHoliday.js +0 -3712
- package/dist/size-demo/dist/parshiyot.js +0 -10662
- package/dist/size-demo/dist/sedra.d.ts +0 -1411
- package/dist/size-demo/dist/sedra.js +0 -2359
- package/dist/size-demo/dist/tachanun.d.ts +0 -1015
- package/dist/size-demo/dist/tachanun.js +0 -1755
- package/dist/size-demo/getHoliday.d.ts +0 -1
- package/dist/size-demo/getHoliday.js +0 -3
- package/dist/size-demo/parshiyot.d.ts +0 -1
- package/dist/size-demo/parshiyot.js +0 -11
- package/dist/size-demo/rollup.config.d.ts +0 -3
- package/dist/size-demo/rollup.config.js +0 -47
- package/dist/size-demo/sedra.d.ts +0 -1
- package/dist/size-demo/sedra.js +0 -3
- package/dist/size-demo/tachanun.d.ts +0 -1
- package/dist/size-demo/tachanun.js +0 -3
package/dist/src/zmanim.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import 'temporal-polyfill/global';
|
|
2
2
|
import { NOAACalculator } from '@hebcal/noaa';
|
|
3
3
|
import { HDate, getPseudoISO, getTimezoneOffset, isDate, pad2, } from '@hebcal/hdate';
|
|
4
|
+
import { Molad } from './molad';
|
|
4
5
|
/**
|
|
5
6
|
* @private
|
|
6
7
|
*/
|
|
@@ -46,6 +47,10 @@ function getDate(date) {
|
|
|
46
47
|
* const timeStr = Zmanim.formatISOWithTimeZone(tzid, candleLighting);
|
|
47
48
|
*/
|
|
48
49
|
export class Zmanim {
|
|
50
|
+
plainDate;
|
|
51
|
+
gloc;
|
|
52
|
+
noaa;
|
|
53
|
+
useElevation;
|
|
49
54
|
/**
|
|
50
55
|
* Initialize a Zmanim instance.
|
|
51
56
|
* @param gloc GeoLocation including latitude, longitude, and timezone
|
|
@@ -59,14 +64,13 @@ export class Zmanim {
|
|
|
59
64
|
*/
|
|
60
65
|
constructor(gloc, date, useElevation) {
|
|
61
66
|
const dt = getDate(date);
|
|
62
|
-
this.
|
|
63
|
-
this.gloc = gloc;
|
|
64
|
-
const plainDate = Temporal.PlainDate.from({
|
|
67
|
+
this.plainDate = Temporal.PlainDate.from({
|
|
65
68
|
year: dt.getFullYear(),
|
|
66
69
|
month: dt.getMonth() + 1,
|
|
67
70
|
day: dt.getDate(),
|
|
68
71
|
});
|
|
69
|
-
this.
|
|
72
|
+
this.gloc = gloc;
|
|
73
|
+
this.noaa = new NOAACalculator(gloc, this.plainDate);
|
|
70
74
|
this.useElevation = Boolean(useElevation);
|
|
71
75
|
}
|
|
72
76
|
/**
|
|
@@ -156,8 +160,8 @@ export class Zmanim {
|
|
|
156
160
|
* If elevation is enabled, this function will include elevation in the calculation.
|
|
157
161
|
*/
|
|
158
162
|
gregEve() {
|
|
159
|
-
const
|
|
160
|
-
prev
|
|
163
|
+
const prev0 = this.plainDate.subtract({ days: 1 });
|
|
164
|
+
const prev = new Date(prev0.year, prev0.month - 1, prev0.day);
|
|
161
165
|
const zman = new Zmanim(this.gloc, prev, this.useElevation);
|
|
162
166
|
return zman.sunset();
|
|
163
167
|
}
|
|
@@ -198,6 +202,15 @@ export class Zmanim {
|
|
|
198
202
|
alotHaShachar72() {
|
|
199
203
|
return this.sunriseOffset(-72, false, false);
|
|
200
204
|
}
|
|
205
|
+
alotHaShachar72zdt() {
|
|
206
|
+
const zdt = this.useElevation
|
|
207
|
+
? this.noaa.getSunrise()
|
|
208
|
+
: this.noaa.getSeaLevelSunrise();
|
|
209
|
+
if (!zdt) {
|
|
210
|
+
return null;
|
|
211
|
+
}
|
|
212
|
+
return zdt.subtract({ minutes: 72 });
|
|
213
|
+
}
|
|
201
214
|
/**
|
|
202
215
|
* Earliest talis & tefillin – Misheyakir; Sun is 11.5° below the horizon in the morning.
|
|
203
216
|
* Because degree-based functions estimate the amount of light in the sky,
|
|
@@ -412,6 +425,15 @@ export class Zmanim {
|
|
|
412
425
|
tzeit(angle = 8.5) {
|
|
413
426
|
return this.timeAtAngle(angle, false);
|
|
414
427
|
}
|
|
428
|
+
tzeit72() {
|
|
429
|
+
const zdt = this.useElevation
|
|
430
|
+
? this.noaa.getSunset()
|
|
431
|
+
: this.noaa.getSeaLevelSunset();
|
|
432
|
+
if (!zdt) {
|
|
433
|
+
return null;
|
|
434
|
+
}
|
|
435
|
+
return zdt.add({ minutes: 72 });
|
|
436
|
+
}
|
|
415
437
|
/**
|
|
416
438
|
* Alias for sunrise
|
|
417
439
|
*/
|
|
@@ -440,6 +462,218 @@ export class Zmanim {
|
|
|
440
462
|
}
|
|
441
463
|
return new Date(millis - 13.5 * 60 * 1000);
|
|
442
464
|
}
|
|
465
|
+
/**
|
|
466
|
+
* Used by Molad based _zmanim_ to determine if _zmanim_ occur during the current day.
|
|
467
|
+
* @return previous midnight
|
|
468
|
+
*/
|
|
469
|
+
getMidnightLastNight() {
|
|
470
|
+
// reset hour, minutes, seconds and millis
|
|
471
|
+
return this.plainDate.toZonedDateTime({
|
|
472
|
+
timeZone: this.gloc.getTimeZone(),
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* Used by Molad based _zmanim_ to determine if _zmanim_ occur during the current day.
|
|
477
|
+
* @return following midnight
|
|
478
|
+
*/
|
|
479
|
+
getMidnightTonight() {
|
|
480
|
+
return this.plainDate.add({ days: 1 }).toZonedDateTime({
|
|
481
|
+
timeZone: this.gloc.getTimeZone(),
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* Returns the Date of the _molad_ based time if it occurs on the current date. Since _Kiddush Levana_
|
|
486
|
+
* can only be said during the day, there are parameters to limit it to between _alos_ and _tzais_. If
|
|
487
|
+
* the time occurs between _alos_ and _tzais_, _tzais_ will be returned.
|
|
488
|
+
*
|
|
489
|
+
* @param moladBasedTime
|
|
490
|
+
* the _molad_ based time such as _molad_, _tchilas_ and _sof zman Kiddush Levana_
|
|
491
|
+
* @param alos
|
|
492
|
+
* optional start of day to limit _molad_ times to the end of the night before or beginning of the next night.
|
|
493
|
+
* Ignored if either _alos_ or _tzais_ are null.
|
|
494
|
+
* @param tzais
|
|
495
|
+
* optional end of day to limit _molad_ times to the end of the night before or beginning of the next night.
|
|
496
|
+
* Ignored if either _tzais_ or _alos_ are null
|
|
497
|
+
* @param techila
|
|
498
|
+
* is it the start of _Kiddush Levana_ time or the end? If it is start roll it to the next _tzais_,
|
|
499
|
+
* and if it is the end, return the end of the previous night (_alos_ passed in). Ignored if either
|
|
500
|
+
* _alos_ or _tzais_ are null.
|
|
501
|
+
* @return the _molad_ based time. If the _zman_ does not occur during the current date, <code>null</code> will be
|
|
502
|
+
* returned.
|
|
503
|
+
*/
|
|
504
|
+
getMoladBasedTime(moladBasedTime, alos, tzais, techila) {
|
|
505
|
+
const lastMidnight = this.getMidnightLastNight();
|
|
506
|
+
const midnightTonight = this.getMidnightTonight();
|
|
507
|
+
if (Temporal.ZonedDateTime.compare(moladBasedTime, lastMidnight) < 0 ||
|
|
508
|
+
Temporal.ZonedDateTime.compare(moladBasedTime, midnightTonight) > 0) {
|
|
509
|
+
return null; // Invalid time, bailout
|
|
510
|
+
}
|
|
511
|
+
if (alos === null || tzais === null) {
|
|
512
|
+
return moladBasedTime.withTimeZone(this.gloc.getTimeZone()); // Not enough info to adjust
|
|
513
|
+
}
|
|
514
|
+
if (Temporal.ZonedDateTime.compare(moladBasedTime, alos) > 0 &&
|
|
515
|
+
Temporal.ZonedDateTime.compare(moladBasedTime, tzais) < 0) {
|
|
516
|
+
// It's the daytime (after alos but before tzais)
|
|
517
|
+
// get the next/prev night
|
|
518
|
+
return techila ? tzais : alos;
|
|
519
|
+
}
|
|
520
|
+
// It's the night, the provided time is valid
|
|
521
|
+
return moladBasedTime.withTimeZone(this.gloc.getTimeZone());
|
|
522
|
+
}
|
|
523
|
+
getHDate() {
|
|
524
|
+
const dt = new Date(this.plainDate.year, this.plainDate.month - 1, this.plainDate.day);
|
|
525
|
+
return new HDate(dt);
|
|
526
|
+
}
|
|
527
|
+
/**
|
|
528
|
+
* Returns the latest time of Kiddush Levana according to the <a
|
|
529
|
+
* href="https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin">Maharil's</a> opinion that it is calculated as
|
|
530
|
+
* halfway between _molad_ and _molad_. This adds half the 29 days, 12 hours and 793 chalakim time between
|
|
531
|
+
* _molad_ and _molad_ (14 days, 18 hours, 22 minutes and 666 milliseconds) to the month's _molad_.
|
|
532
|
+
* The _sof zman Kiddush Levana_ will be returned even if it occurs during the day. To limit the time to between
|
|
533
|
+
* _tzais_ and _alos_, see {@link #getSofZmanKidushLevanaBetweenMoldos(Date, Date)}.
|
|
534
|
+
*
|
|
535
|
+
* @param alos
|
|
536
|
+
* the beginning of the Jewish day. If _Kidush Levana_ occurs during the day (starting at _alos_ and
|
|
537
|
+
* ending at _tzais_), the time returned will be alos. If either the _alos_ or _tzais_ parameters
|
|
538
|
+
* are null, no daytime adjustment will be made.
|
|
539
|
+
* @param tzais
|
|
540
|
+
* the end of the Jewish day. If Kidush Levana occurs during the day (starting at alos and ending at
|
|
541
|
+
* tzais), the time returned will be alos. If either the alos or tzais parameters are null, no daytime
|
|
542
|
+
* adjustment will be made.
|
|
543
|
+
* @return the Date representing the moment halfway between molad and molad. If the time occurs between
|
|
544
|
+
* _alos_ and _tzais_, _alos_ will be returned. If the _zman_ will not occur on this
|
|
545
|
+
* day, a <code>null</code> will be returned.
|
|
546
|
+
*/
|
|
547
|
+
getSofZmanKidushLevanaBetweenMoldos(alos = null, tzais = null) {
|
|
548
|
+
const hd = this.getHDate();
|
|
549
|
+
// Do not calculate for impossible dates, but account for extreme cases. In the extreme case of Rapa Iti in French
|
|
550
|
+
// Polynesia on Dec 2027 when kiddush Levana 3 days can be said on _Rosh Chodesh_, the sof zman Kiddush Levana
|
|
551
|
+
// will be on the 12th of the Teves. In the case of Anadyr, Russia on Jan, 2071, sof zman Kiddush Levana between the
|
|
552
|
+
// moldos will occur is on the night of 17th of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).
|
|
553
|
+
if (hd.getDate() < 11 || hd.getDate() > 16) {
|
|
554
|
+
return null;
|
|
555
|
+
}
|
|
556
|
+
const molad = new Molad(hd.getFullYear(), hd.getMonth());
|
|
557
|
+
return this.getMoladBasedTime(molad.getSofZmanKidushLevanaBetweenMoldos(), alos, tzais, false);
|
|
558
|
+
}
|
|
559
|
+
/**
|
|
560
|
+
* Returns the latest time of _Kiddush Levana_ calculated as 15 days after the molad. This is the opinion of
|
|
561
|
+
* the Shulchan Aruch (Orach Chaim 426). It should be noted that some opinions hold that the
|
|
562
|
+
* <a href="https://en.wikipedia.org/wiki/Moses_Isserles">Rema</a> who brings down the opinion of the <a
|
|
563
|
+
* href="https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin">Maharil's</a> of calculating
|
|
564
|
+
* {@link #getSofZmanKidushLevanaBetweenMoldos(Date, Date) half way between _molad_ and _molad_} is of
|
|
565
|
+
* the opinion that the Mechaber agrees to his opinion. Also see the Aruch Hashulchan. For additional details on the subject,
|
|
566
|
+
* See Rabbi Dovid Heber's very detailed write-up in Siman Daled (chapter 4) of <a href="https://hebrewbooks.org/53000">Shaarei
|
|
567
|
+
* Zmanim</a>. The _sof zman Kiddush Levana_ will be returned even if it occurs during the day. To limit the time to
|
|
568
|
+
* between _tzais_ and _alos_, see {@link #getSofZmanKidushLevana15Days(Date, Date)}.
|
|
569
|
+
*
|
|
570
|
+
* @return the Date representing the moment 15 days after the _molad_. If the time occurs between
|
|
571
|
+
* _alos_ and _tzais_, _alos_ will be returned. If the _zman_ will not occur on this day, a
|
|
572
|
+
* <code>null</code> will be returned.
|
|
573
|
+
*
|
|
574
|
+
*
|
|
575
|
+
*/
|
|
576
|
+
getSofZmanKidushLevana15Days(alos = null, tzais = null) {
|
|
577
|
+
const hd = this.getHDate();
|
|
578
|
+
// Do not calculate for impossible dates, but account for extreme cases. In the extreme case of Rapa Iti in
|
|
579
|
+
// French Polynesia on Dec 2027 when kiddush Levana 3 days can be said on _Rosh Chodesh_, the sof zman Kiddush
|
|
580
|
+
// Levana will be on the 12th of the Teves. in the case of Anadyr, Russia on Jan, 2071, sof zman kiddush levana will
|
|
581
|
+
// occur after midnight on the 17th of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).
|
|
582
|
+
if (hd.getDate() < 11 || hd.getDate() > 17) {
|
|
583
|
+
return null;
|
|
584
|
+
}
|
|
585
|
+
const molad = new Molad(hd.getFullYear(), hd.getMonth());
|
|
586
|
+
return this.getMoladBasedTime(molad.getSofZmanKidushLevana15Days(), alos, tzais, false);
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* Returns the earliest time of _Kiddush Levana_ according to <a href=
|
|
590
|
+
* "https://en.wikipedia.org/wiki/Yonah_Gerondi">Rabbeinu Yonah</a>'s opinion that it can be said 3 days after the _molad_.
|
|
591
|
+
* If the time of _tchilas zman Kiddush Levana_ occurs during the day (between _alos_ and _tzais_ passed to
|
|
592
|
+
* this method) it will return the following _tzais_. If null is passed for either _alos_ or _tzais_, the actual
|
|
593
|
+
* _tchilas zman Kiddush Levana_ will be returned, regardless of if it is during the day or not.
|
|
594
|
+
*
|
|
595
|
+
* @param alos
|
|
596
|
+
* the beginning of the Jewish day. If Kidush Levana occurs during the day (starting at _alos_ and ending
|
|
597
|
+
* at _tzais_), the time returned will be _tzais_. If either the _alos_ or _tzais_ parameters
|
|
598
|
+
* are null, no daytime adjustment will be made.
|
|
599
|
+
* @param tzais
|
|
600
|
+
* the end of the Jewish day. If _Kidush Levana_ occurs during the day (starting at _alos_ and ending at
|
|
601
|
+
* _tzais_), the time returned will be _tzais_. If either the _alos_ or _tzais_ parameters
|
|
602
|
+
* are null, no daytime adjustment will be made.
|
|
603
|
+
*
|
|
604
|
+
* @return the Date representing the moment 3 days after the molad. If the time occurs between _alos_ and
|
|
605
|
+
* _tzais_, _tzais_ will be returned. If the _zman_ will not occur on this day, a
|
|
606
|
+
* <code>null</code> will be returned.
|
|
607
|
+
*/
|
|
608
|
+
getTchilasZmanKidushLevana3Days(alos = null, tzais = null) {
|
|
609
|
+
const hd = this.getHDate();
|
|
610
|
+
// Do not calculate for impossible dates, but account for extreme cases. Tchilas zman kiddush Levana 3 days for
|
|
611
|
+
// the extreme case of Rapa Iti in French Polynesia on Dec 2027 when kiddush Levana 3 days can be said on the evening
|
|
612
|
+
// of the 30th, the second night of Rosh Chodesh. The 3rd day after the _molad_ will be on the 4th of the month.
|
|
613
|
+
// In the case of Anadyr, Russia on Jan, 2071, when sof zman kiddush levana is on the 17th of the month, the 3rd day
|
|
614
|
+
// from the molad will be on the 5th day of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).
|
|
615
|
+
if (hd.getDate() > 5 && hd.getDate() < 30) {
|
|
616
|
+
return null;
|
|
617
|
+
}
|
|
618
|
+
const molad = new Molad(hd.getFullYear(), hd.getMonth());
|
|
619
|
+
let zman = this.getMoladBasedTime(molad.getTchilasZmanKidushLevana3Days(), alos, tzais, true);
|
|
620
|
+
// Get the following month's zman kiddush Levana for the extreme case of Rapa Iti in French Polynesia on Dec 2027 when
|
|
621
|
+
// kiddush Levana can be said on Rosh Chodesh (the evening of the 30th). See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (page 32)
|
|
622
|
+
if (zman === null && hd.getDate() === 30) {
|
|
623
|
+
const hd2 = hd.add(1, 'week');
|
|
624
|
+
const molad2 = new Molad(hd2.getFullYear(), hd2.getMonth());
|
|
625
|
+
zman = this.getMoladBasedTime(molad2.getTchilasZmanKidushLevana3Days(), null, null, true);
|
|
626
|
+
}
|
|
627
|
+
return zman;
|
|
628
|
+
}
|
|
629
|
+
/**
|
|
630
|
+
* Returns the point in time of _Molad_ as a <code>Date</code> Object. For the traditional day of week, hour,
|
|
631
|
+
* minute and chalakim, {@link Molad.getInstant()} and the not yet completed
|
|
632
|
+
* {@link HebrewDateFormatter} that will have formatting for this.
|
|
633
|
+
*
|
|
634
|
+
* @return the Date representing the moment of the molad. If the _molad_ does not occur on this day, a
|
|
635
|
+
* <code>null</code> will be returned.
|
|
636
|
+
*
|
|
637
|
+
*/
|
|
638
|
+
getZmanMolad() {
|
|
639
|
+
const hd = this.getHDate();
|
|
640
|
+
// Optimize to not calculate for impossible dates, but account for extreme cases. The molad in the extreme case of Rapa
|
|
641
|
+
// Iti in French Polynesia on Dec 2027 occurs on the night of the 27th of Kislev. In the case of Anadyr, Russia on
|
|
642
|
+
// 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).
|
|
643
|
+
if (hd.getDate() > 2 && hd.getDate() < 27) {
|
|
644
|
+
return null;
|
|
645
|
+
}
|
|
646
|
+
const molad = new Molad(hd.getFullYear(), hd.getMonth());
|
|
647
|
+
let zman = this.getMoladBasedTime(molad.getInstant(), null, null, true);
|
|
648
|
+
// deal with molad that happens on the end of the previous month
|
|
649
|
+
if (zman === null && hd.getDate() > 26) {
|
|
650
|
+
const hd2 = hd.add(1, 'week');
|
|
651
|
+
const molad2 = new Molad(hd2.getFullYear(), hd2.getMonth());
|
|
652
|
+
zman = this.getMoladBasedTime(molad2.getInstant(), null, null, true);
|
|
653
|
+
}
|
|
654
|
+
return zman;
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* Returns the earliest time of _Kiddush Levana_ according to the opinions that it should not be said until 7
|
|
658
|
+
* days after the _molad_. The time will be returned even if it occurs during the day when _Kiddush Levana_
|
|
659
|
+
* can't be recited. Use {@link #getTchilasZmanKidushLevana7Days(Date, Date)} if you want to limit the time to night hours.
|
|
660
|
+
*
|
|
661
|
+
* @return the Date representing the moment 7 days after the molad regardless of it is day or night. If the _zman_
|
|
662
|
+
* will not occur on this day, a <code>null</code> will be returned.
|
|
663
|
+
*/
|
|
664
|
+
getTchilasZmanKidushLevana7Days(alos = null, tzais = null) {
|
|
665
|
+
const hd = this.getHDate();
|
|
666
|
+
// Optimize to not calculate for impossible dates, but account for extreme cases. Tchilas zman kiddush Levana 7 days for
|
|
667
|
+
// the extreme case of Rapa Iti in French Polynesia on Jan 2028 (when kiddush Levana 3 days can be said on the evening
|
|
668
|
+
// of the 30th, the second night of Rosh Chodesh), the 7th day after the molad will be on the 4th of the month.
|
|
669
|
+
// In the case of Anadyr, Russia on Jan, 2071, when sof zman kiddush levana is on the 17th of the month, the 7th day
|
|
670
|
+
// from the molad will be on the 9th day of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).
|
|
671
|
+
if (hd.getDate() < 4 || hd.getDate() > 9) {
|
|
672
|
+
return null;
|
|
673
|
+
}
|
|
674
|
+
const molad = new Molad(hd.getFullYear(), hd.getMonth());
|
|
675
|
+
return this.getMoladBasedTime(molad.getTchilasZmanKidushLevana7Days(), alos, tzais, true);
|
|
676
|
+
}
|
|
443
677
|
/**
|
|
444
678
|
* Uses timeFormat to return a date like '20:34'.
|
|
445
679
|
* Returns `XX:XX` if the date is invalid.
|
package/dist/version.js
CHANGED
package/dist/zmanim.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ import { HDate } from '@hebcal/hdate';
|
|
|
28
28
|
* const timeStr = Zmanim.formatISOWithTimeZone(tzid, candleLighting);
|
|
29
29
|
*/
|
|
30
30
|
export declare class Zmanim {
|
|
31
|
-
private readonly
|
|
31
|
+
private readonly plainDate;
|
|
32
32
|
private readonly gloc;
|
|
33
33
|
private readonly noaa;
|
|
34
34
|
private useElevation;
|
|
@@ -123,6 +123,7 @@ export declare class Zmanim {
|
|
|
123
123
|
* sea level sunrise.
|
|
124
124
|
*/
|
|
125
125
|
alotHaShachar72(): Date;
|
|
126
|
+
alotHaShachar72zdt(): Temporal.ZonedDateTime | null;
|
|
126
127
|
/**
|
|
127
128
|
* Earliest talis & tefillin – Misheyakir; Sun is 11.5° below the horizon in the morning.
|
|
128
129
|
* Because degree-based functions estimate the amount of light in the sky,
|
|
@@ -265,6 +266,7 @@ export declare class Zmanim {
|
|
|
265
266
|
* the result is not impacted by elevation.
|
|
266
267
|
*/
|
|
267
268
|
tzeit(angle?: number): Date;
|
|
269
|
+
tzeit72(): Temporal.ZonedDateTime | null;
|
|
268
270
|
/**
|
|
269
271
|
* Alias for sunrise
|
|
270
272
|
*/
|
|
@@ -282,6 +284,117 @@ export declare class Zmanim {
|
|
|
282
284
|
* the result is not impacted by elevation.
|
|
283
285
|
*/
|
|
284
286
|
beinHaShmashos(): Date;
|
|
287
|
+
/**
|
|
288
|
+
* Used by Molad based _zmanim_ to determine if _zmanim_ occur during the current day.
|
|
289
|
+
* @return previous midnight
|
|
290
|
+
*/
|
|
291
|
+
private getMidnightLastNight;
|
|
292
|
+
/**
|
|
293
|
+
* Used by Molad based _zmanim_ to determine if _zmanim_ occur during the current day.
|
|
294
|
+
* @return following midnight
|
|
295
|
+
*/
|
|
296
|
+
private getMidnightTonight;
|
|
297
|
+
/**
|
|
298
|
+
* Returns the Date of the _molad_ based time if it occurs on the current date. Since _Kiddush Levana_
|
|
299
|
+
* can only be said during the day, there are parameters to limit it to between _alos_ and _tzais_. If
|
|
300
|
+
* the time occurs between _alos_ and _tzais_, _tzais_ will be returned.
|
|
301
|
+
*
|
|
302
|
+
* @param moladBasedTime
|
|
303
|
+
* the _molad_ based time such as _molad_, _tchilas_ and _sof zman Kiddush Levana_
|
|
304
|
+
* @param alos
|
|
305
|
+
* optional start of day to limit _molad_ times to the end of the night before or beginning of the next night.
|
|
306
|
+
* Ignored if either _alos_ or _tzais_ are null.
|
|
307
|
+
* @param tzais
|
|
308
|
+
* optional end of day to limit _molad_ times to the end of the night before or beginning of the next night.
|
|
309
|
+
* Ignored if either _tzais_ or _alos_ are null
|
|
310
|
+
* @param techila
|
|
311
|
+
* is it the start of _Kiddush Levana_ time or the end? If it is start roll it to the next _tzais_,
|
|
312
|
+
* and if it is the end, return the end of the previous night (_alos_ passed in). Ignored if either
|
|
313
|
+
* _alos_ or _tzais_ are null.
|
|
314
|
+
* @return the _molad_ based time. If the _zman_ does not occur during the current date, <code>null</code> will be
|
|
315
|
+
* returned.
|
|
316
|
+
*/
|
|
317
|
+
private getMoladBasedTime;
|
|
318
|
+
private getHDate;
|
|
319
|
+
/**
|
|
320
|
+
* Returns the latest time of Kiddush Levana according to the <a
|
|
321
|
+
* href="https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin">Maharil's</a> opinion that it is calculated as
|
|
322
|
+
* halfway between _molad_ and _molad_. This adds half the 29 days, 12 hours and 793 chalakim time between
|
|
323
|
+
* _molad_ and _molad_ (14 days, 18 hours, 22 minutes and 666 milliseconds) to the month's _molad_.
|
|
324
|
+
* The _sof zman Kiddush Levana_ will be returned even if it occurs during the day. To limit the time to between
|
|
325
|
+
* _tzais_ and _alos_, see {@link #getSofZmanKidushLevanaBetweenMoldos(Date, Date)}.
|
|
326
|
+
*
|
|
327
|
+
* @param alos
|
|
328
|
+
* the beginning of the Jewish day. If _Kidush Levana_ occurs during the day (starting at _alos_ and
|
|
329
|
+
* ending at _tzais_), the time returned will be alos. If either the _alos_ or _tzais_ parameters
|
|
330
|
+
* are null, no daytime adjustment will be made.
|
|
331
|
+
* @param tzais
|
|
332
|
+
* the end of the Jewish day. If Kidush Levana occurs during the day (starting at alos and ending at
|
|
333
|
+
* tzais), the time returned will be alos. If either the alos or tzais parameters are null, no daytime
|
|
334
|
+
* adjustment will be made.
|
|
335
|
+
* @return the Date representing the moment halfway between molad and molad. If the time occurs between
|
|
336
|
+
* _alos_ and _tzais_, _alos_ will be returned. If the _zman_ will not occur on this
|
|
337
|
+
* day, a <code>null</code> will be returned.
|
|
338
|
+
*/
|
|
339
|
+
getSofZmanKidushLevanaBetweenMoldos(alos?: Temporal.ZonedDateTime | null, tzais?: Temporal.ZonedDateTime | null): Temporal.ZonedDateTime | null;
|
|
340
|
+
/**
|
|
341
|
+
* Returns the latest time of _Kiddush Levana_ calculated as 15 days after the molad. This is the opinion of
|
|
342
|
+
* the Shulchan Aruch (Orach Chaim 426). It should be noted that some opinions hold that the
|
|
343
|
+
* <a href="https://en.wikipedia.org/wiki/Moses_Isserles">Rema</a> who brings down the opinion of the <a
|
|
344
|
+
* href="https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin">Maharil's</a> of calculating
|
|
345
|
+
* {@link #getSofZmanKidushLevanaBetweenMoldos(Date, Date) half way between _molad_ and _molad_} is of
|
|
346
|
+
* the opinion that the Mechaber agrees to his opinion. Also see the Aruch Hashulchan. For additional details on the subject,
|
|
347
|
+
* See Rabbi Dovid Heber's very detailed write-up in Siman Daled (chapter 4) of <a href="https://hebrewbooks.org/53000">Shaarei
|
|
348
|
+
* Zmanim</a>. The _sof zman Kiddush Levana_ will be returned even if it occurs during the day. To limit the time to
|
|
349
|
+
* between _tzais_ and _alos_, see {@link #getSofZmanKidushLevana15Days(Date, Date)}.
|
|
350
|
+
*
|
|
351
|
+
* @return the Date representing the moment 15 days after the _molad_. If the time occurs between
|
|
352
|
+
* _alos_ and _tzais_, _alos_ will be returned. If the _zman_ will not occur on this day, a
|
|
353
|
+
* <code>null</code> will be returned.
|
|
354
|
+
*
|
|
355
|
+
*
|
|
356
|
+
*/
|
|
357
|
+
getSofZmanKidushLevana15Days(alos?: Temporal.ZonedDateTime | null, tzais?: Temporal.ZonedDateTime | null): Temporal.ZonedDateTime | null;
|
|
358
|
+
/**
|
|
359
|
+
* Returns the earliest time of _Kiddush Levana_ according to <a href=
|
|
360
|
+
* "https://en.wikipedia.org/wiki/Yonah_Gerondi">Rabbeinu Yonah</a>'s opinion that it can be said 3 days after the _molad_.
|
|
361
|
+
* If the time of _tchilas zman Kiddush Levana_ occurs during the day (between _alos_ and _tzais_ passed to
|
|
362
|
+
* this method) it will return the following _tzais_. If null is passed for either _alos_ or _tzais_, the actual
|
|
363
|
+
* _tchilas zman Kiddush Levana_ will be returned, regardless of if it is during the day or not.
|
|
364
|
+
*
|
|
365
|
+
* @param alos
|
|
366
|
+
* the beginning of the Jewish day. If Kidush Levana occurs during the day (starting at _alos_ and ending
|
|
367
|
+
* at _tzais_), the time returned will be _tzais_. If either the _alos_ or _tzais_ parameters
|
|
368
|
+
* are null, no daytime adjustment will be made.
|
|
369
|
+
* @param tzais
|
|
370
|
+
* the end of the Jewish day. If _Kidush Levana_ occurs during the day (starting at _alos_ and ending at
|
|
371
|
+
* _tzais_), the time returned will be _tzais_. If either the _alos_ or _tzais_ parameters
|
|
372
|
+
* are null, no daytime adjustment will be made.
|
|
373
|
+
*
|
|
374
|
+
* @return the Date representing the moment 3 days after the molad. If the time occurs between _alos_ and
|
|
375
|
+
* _tzais_, _tzais_ will be returned. If the _zman_ will not occur on this day, a
|
|
376
|
+
* <code>null</code> will be returned.
|
|
377
|
+
*/
|
|
378
|
+
getTchilasZmanKidushLevana3Days(alos?: Temporal.ZonedDateTime | null, tzais?: Temporal.ZonedDateTime | null): Temporal.ZonedDateTime | null;
|
|
379
|
+
/**
|
|
380
|
+
* Returns the point in time of _Molad_ as a <code>Date</code> Object. For the traditional day of week, hour,
|
|
381
|
+
* minute and chalakim, {@link Molad.getInstant()} and the not yet completed
|
|
382
|
+
* {@link HebrewDateFormatter} that will have formatting for this.
|
|
383
|
+
*
|
|
384
|
+
* @return the Date representing the moment of the molad. If the _molad_ does not occur on this day, a
|
|
385
|
+
* <code>null</code> will be returned.
|
|
386
|
+
*
|
|
387
|
+
*/
|
|
388
|
+
getZmanMolad(): Temporal.ZonedDateTime | null;
|
|
389
|
+
/**
|
|
390
|
+
* Returns the earliest time of _Kiddush Levana_ according to the opinions that it should not be said until 7
|
|
391
|
+
* days after the _molad_. The time will be returned even if it occurs during the day when _Kiddush Levana_
|
|
392
|
+
* can't be recited. Use {@link #getTchilasZmanKidushLevana7Days(Date, Date)} if you want to limit the time to night hours.
|
|
393
|
+
*
|
|
394
|
+
* @return the Date representing the moment 7 days after the molad regardless of it is day or night. If the _zman_
|
|
395
|
+
* will not occur on this day, a <code>null</code> will be returned.
|
|
396
|
+
*/
|
|
397
|
+
getTchilasZmanKidushLevana7Days(alos?: Temporal.ZonedDateTime | null, tzais?: Temporal.ZonedDateTime | null): Temporal.ZonedDateTime | null;
|
|
285
398
|
/**
|
|
286
399
|
* Uses timeFormat to return a date like '20:34'.
|
|
287
400
|
* Returns `XX:XX` if the date is invalid.
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hebcal/core",
|
|
3
|
-
"version": "6.0
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"author": "Michael J. Radwin (https://github.com/mjradwin)",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Eyal Schachter (https://github.com/Scimonster)",
|
|
7
7
|
"Danny Sadinoff (https://github.com/dsadinoff)",
|
|
8
|
+
"Eliyahu Hershfeld (https://github.com/KosherJava)",
|
|
8
9
|
"Yisroel Yakovson (https://github.com/YizYah)",
|
|
9
10
|
"Schabse Laks (https://github.com/SLaks)",
|
|
10
11
|
"Benny Powers (https://github.com/bennypowers)"
|
|
@@ -49,7 +50,7 @@
|
|
|
49
50
|
],
|
|
50
51
|
"scripts": {
|
|
51
52
|
"build:rollup": "rollup -c",
|
|
52
|
-
"size-demo:rollup": "rollup -c size-demo/rollup.config.
|
|
53
|
+
"size-demo:rollup": "rollup -c size-demo/rollup.config.js",
|
|
53
54
|
"size-demo": "npm run build && npm run size-demo:rollup",
|
|
54
55
|
"build": "npm run po2json && npm run version && npm run build:rollup --production",
|
|
55
56
|
"prepublish": "npm run build",
|
|
@@ -63,32 +64,29 @@
|
|
|
63
64
|
"clean": "gts clean",
|
|
64
65
|
"fix": "gts fix",
|
|
65
66
|
"compile": "tsc",
|
|
66
|
-
"prepare": "npm run compile"
|
|
67
|
-
"posttest": "npm run lint"
|
|
67
|
+
"prepare": "npm run compile"
|
|
68
68
|
},
|
|
69
69
|
"license": "GPL-2.0",
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
72
|
-
"@rollup/plugin-terser": "^0.
|
|
72
|
+
"@rollup/plugin-terser": "^1.0.0",
|
|
73
73
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
74
|
-
"@types/node": "^25.0
|
|
75
|
-
"@vitest/coverage-v8": "^4.
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"gts": "^6.0.2",
|
|
74
|
+
"@types/node": "^25.6.0",
|
|
75
|
+
"@vitest/coverage-v8": "^4.1.4",
|
|
76
|
+
"gettext-parser": "^9.0.2",
|
|
77
|
+
"gts": "^7.0.0",
|
|
79
78
|
"pretty-bytes": "^7.1.0",
|
|
80
|
-
"rollup": "^4.
|
|
79
|
+
"rollup": "^4.60.1",
|
|
81
80
|
"rollup-plugin-bundle-size": "^1.0.3",
|
|
82
|
-
"rollup-plugin-visualizer": "^
|
|
83
|
-
"typedoc": "^0.28.
|
|
84
|
-
"typescript": "^
|
|
85
|
-
"vitest": "^4.
|
|
81
|
+
"rollup-plugin-visualizer": "^7.0.1",
|
|
82
|
+
"typedoc": "^0.28.18",
|
|
83
|
+
"typescript": "^6.0.2",
|
|
84
|
+
"vitest": "^4.1.4"
|
|
86
85
|
},
|
|
87
86
|
"dependencies": {
|
|
88
|
-
"@hebcal/hdate": "^0.
|
|
89
|
-
"@hebcal/noaa": "^0.
|
|
87
|
+
"@hebcal/hdate": "^0.22.0",
|
|
88
|
+
"@hebcal/noaa": "^0.10.1",
|
|
90
89
|
"quick-lru": "^7.3.0",
|
|
91
|
-
"temporal-polyfill": "^0.3.
|
|
92
|
-
"tslib": "^2.8.1"
|
|
90
|
+
"temporal-polyfill": "^0.3.2"
|
|
93
91
|
}
|
|
94
92
|
}
|