@hebcal/core 6.14.6 → 6.14.7
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 +1 -1
- package/dist/bundle.js +34 -30
- package/dist/bundle.js.map +1 -1
- package/dist/bundle.min.js +5 -5
- package/dist/bundle.min.js.map +1 -1
- package/dist/esm/DailyLearning.js +1 -1
- package/dist/esm/HebrewDateEvent.js +1 -1
- package/dist/esm/HolidayEvent.js +1 -1
- package/dist/esm/KiddushLevanaEvent.d.ts +15 -1
- package/dist/esm/KiddushLevanaEvent.js +17 -7
- package/dist/esm/KiddushLevanaEvent.js.map +1 -1
- package/dist/esm/MevarchimChodeshEvent.js +1 -1
- package/dist/esm/ParshaEvent.js +1 -1
- package/dist/esm/TimedEvent.js +1 -1
- package/dist/esm/YomKippurKatanEvent.js +1 -1
- package/dist/esm/ashkenazi.po.js +1 -1
- package/dist/esm/calendar.js +5 -5
- package/dist/esm/calendar.js.map +1 -1
- package/dist/esm/candles.js +7 -7
- package/dist/esm/candles.js.map +1 -1
- package/dist/esm/cities.json.js +1 -1
- package/dist/esm/event.js +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.js +1 -1
- package/dist/esm/hebcal.js +1 -1
- package/dist/esm/holidays.js +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/isAssurBemlacha.js +2 -2
- package/dist/esm/isAssurBemlacha.js.map +1 -1
- package/dist/esm/isAveilut.js +1 -1
- package/dist/esm/isFastDay.js +1 -1
- package/dist/esm/locale.js +1 -1
- package/dist/esm/location.js +3 -3
- package/dist/esm/location.js.map +1 -1
- package/dist/esm/modern.js +1 -1
- package/dist/esm/molad.js +1 -1
- package/dist/esm/moladBase.js +1 -1
- package/dist/esm/moladDate.js +1 -1
- package/dist/esm/omer.js +1 -1
- package/dist/esm/parshaName.js +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 +1 -1
- package/dist/esm/sedra.js +2 -2
- package/dist/esm/sedra.js.map +1 -1
- package/dist/esm/sefira.json.js +1 -1
- package/dist/esm/staticHolidays.js +1 -1
- package/dist/esm/string.js +1 -1
- package/dist/esm/tachanun.js +1 -1
- package/dist/esm/zenith.js +1 -1
- package/dist/esm/zmanim.js +8 -8
- package/dist/esm/zmanim.js.map +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -339,7 +339,7 @@ doesn't cross the relevant angle — it returns an `Invalid Date`; the
|
|
|
339
339
|
|
|
340
340
|
That split is transitional. The intent is to move the library to `Temporal`
|
|
341
341
|
throughout, which is a breaking change and so is planned for `@hebcal/core` version 7.
|
|
342
|
-
Until then, checking `isNaN(dt.getTime())` on `Date` results and `=== null` on
|
|
342
|
+
Until then, checking `Number.isNaN(dt.getTime())` on `Date` results and `=== null` on
|
|
343
343
|
`Temporal` results is the portable approach.
|
|
344
344
|
|
|
345
345
|
## Usage
|
package/dist/bundle.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/*! @hebcal/core v6.14.
|
|
1
|
+
/*! @hebcal/core v6.14.7, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
var hebcal = (function (exports) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
5
|
/** DO NOT EDIT THIS AUTO-GENERATED FILE! */
|
|
6
|
-
const version = '6.14.
|
|
6
|
+
const version = '6.14.7';
|
|
7
7
|
|
|
8
8
|
/*! @hebcal/hdate v0.23.1, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
9
9
|
/**
|
|
@@ -9235,11 +9235,11 @@ class Location extends GeoLocation {
|
|
|
9235
9235
|
*/
|
|
9236
9236
|
constructor(latitude, longitude, il, tzid, cityName, countryCode, geoid, elevation) {
|
|
9237
9237
|
const lat = typeof latitude === 'number' ? latitude : parseFloat(latitude);
|
|
9238
|
-
if (isNaN(lat) || lat < -90 || lat > 90) {
|
|
9238
|
+
if (Number.isNaN(lat) || lat < -90 || lat > 90) {
|
|
9239
9239
|
throw new RangeError(`Latitude ${latitude} out of range [-90,90]`);
|
|
9240
9240
|
}
|
|
9241
9241
|
const long = typeof longitude === 'number' ? longitude : parseFloat(longitude);
|
|
9242
|
-
if (isNaN(long) || long < -180 || long > 180) {
|
|
9242
|
+
if (Number.isNaN(long) || long < -180 || long > 180) {
|
|
9243
9243
|
throw new RangeError(`Longitude ${longitude} out of range [-180,180]`);
|
|
9244
9244
|
}
|
|
9245
9245
|
if (!tzid) {
|
|
@@ -10527,7 +10527,7 @@ class Zmanim {
|
|
|
10527
10527
|
beinHaShmashos() {
|
|
10528
10528
|
const tzeit = this.tzeit(DEG_7_POINT_083);
|
|
10529
10529
|
const millis = tzeit.getTime();
|
|
10530
|
-
if (isNaN(millis)) {
|
|
10530
|
+
if (Number.isNaN(millis)) {
|
|
10531
10531
|
return tzeit;
|
|
10532
10532
|
}
|
|
10533
10533
|
return new Date(millis - 13.5 * 60 * 1000);
|
|
@@ -10915,7 +10915,7 @@ class Zmanim {
|
|
|
10915
10915
|
* {@link Location.getTimeFormatter}
|
|
10916
10916
|
*/
|
|
10917
10917
|
static formatTime(dt, timeFormat) {
|
|
10918
|
-
if (isNaN(dt.getTime())) {
|
|
10918
|
+
if (Number.isNaN(dt.getTime())) {
|
|
10919
10919
|
return 'XX:XX'; // Invalid Date
|
|
10920
10920
|
}
|
|
10921
10921
|
const time = timeFormat.format(dt);
|
|
@@ -10937,7 +10937,7 @@ class Zmanim {
|
|
|
10937
10937
|
*/
|
|
10938
10938
|
static roundTime(dt) {
|
|
10939
10939
|
const millis = dt.getTime();
|
|
10940
|
-
if (isNaN(millis)) {
|
|
10940
|
+
if (Number.isNaN(millis)) {
|
|
10941
10941
|
return dt;
|
|
10942
10942
|
}
|
|
10943
10943
|
// Round up to next minute if needed
|
|
@@ -10969,7 +10969,7 @@ class Zmanim {
|
|
|
10969
10969
|
* @param date
|
|
10970
10970
|
*/
|
|
10971
10971
|
static formatISOWithTimeZone(tzid, date) {
|
|
10972
|
-
if (isNaN(date.getTime())) {
|
|
10972
|
+
if (Number.isNaN(date.getTime())) {
|
|
10973
10973
|
return '0000-00-00T00:00:00Z';
|
|
10974
10974
|
}
|
|
10975
10975
|
return (getPseudoISO(tzid, date).substring(0, 19) + Zmanim.timeZoneOffset(tzid, date));
|
|
@@ -10984,7 +10984,7 @@ class Zmanim {
|
|
|
10984
10984
|
*/
|
|
10985
10985
|
sunriseOffset(offset, roundMinute = true, forceSeaLevel = false) {
|
|
10986
10986
|
const sunrise = forceSeaLevel ? this.seaLevelSunrise() : this.sunrise();
|
|
10987
|
-
if (isNaN(sunrise.getTime())) {
|
|
10987
|
+
if (Number.isNaN(sunrise.getTime())) {
|
|
10988
10988
|
return sunrise;
|
|
10989
10989
|
}
|
|
10990
10990
|
if (roundMinute) {
|
|
@@ -11006,7 +11006,7 @@ class Zmanim {
|
|
|
11006
11006
|
*/
|
|
11007
11007
|
sunsetOffset(offset, roundMinute = true, forceSeaLevel = false) {
|
|
11008
11008
|
const sunset = forceSeaLevel ? this.seaLevelSunset() : this.sunset();
|
|
11009
|
-
if (isNaN(sunset.getTime())) {
|
|
11009
|
+
if (Number.isNaN(sunset.getTime())) {
|
|
11010
11010
|
return sunset;
|
|
11011
11011
|
}
|
|
11012
11012
|
if (roundMinute) {
|
|
@@ -11044,7 +11044,7 @@ class Zmanim {
|
|
|
11044
11044
|
const sunset = zmanim.sunset();
|
|
11045
11045
|
let hd = new HDate(date);
|
|
11046
11046
|
const sunsetMillis = sunset.getTime();
|
|
11047
|
-
if (isNaN(sunsetMillis)) {
|
|
11047
|
+
if (Number.isNaN(sunsetMillis)) {
|
|
11048
11048
|
return hd;
|
|
11049
11049
|
}
|
|
11050
11050
|
if (date.getTime() >= sunsetMillis) {
|
|
@@ -12257,7 +12257,7 @@ const parshiot = [
|
|
|
12257
12257
|
*/
|
|
12258
12258
|
function toAbsInYear(hd, rh, year) {
|
|
12259
12259
|
const abs = typeof hd === 'number' ? hd : HDate.isHDate(hd) ? hd.abs() : NaN;
|
|
12260
|
-
if (isNaN(abs)) {
|
|
12260
|
+
if (Number.isNaN(abs)) {
|
|
12261
12261
|
throw new TypeError(`Bad date argument: ${hd}`);
|
|
12262
12262
|
}
|
|
12263
12263
|
if (abs < rh) {
|
|
@@ -13010,7 +13010,7 @@ function isAssurBemlacha(currentTime, location, useElevation) {
|
|
|
13010
13010
|
// erev shabbos, YT or YT sheni and after shkiah
|
|
13011
13011
|
const sunset = zmanim.sunset();
|
|
13012
13012
|
const sunsetMillis = sunset.getTime();
|
|
13013
|
-
if (isNaN(sunsetMillis)) {
|
|
13013
|
+
if (Number.isNaN(sunsetMillis)) {
|
|
13014
13014
|
throw new Error('Could not determine sunset');
|
|
13015
13015
|
}
|
|
13016
13016
|
// erev shabbos, YT or YT sheni and after shkiah
|
|
@@ -13132,7 +13132,7 @@ function makeCandleEvent(ev, hd, options, isFriday, isSaturday) {
|
|
|
13132
13132
|
const time = useHavdalahOffset && !offset
|
|
13133
13133
|
? zmanim.tzeit(options.havdalahDeg)
|
|
13134
13134
|
: zmanim.sunsetOffset(offset, true);
|
|
13135
|
-
if (isNaN(time.getTime())) {
|
|
13135
|
+
if (Number.isNaN(time.getTime())) {
|
|
13136
13136
|
return undefined; // no sunset
|
|
13137
13137
|
}
|
|
13138
13138
|
if (havdalahTitle) {
|
|
@@ -13274,25 +13274,25 @@ function makeFastStartEnd(ev, options) {
|
|
|
13274
13274
|
let endEvent;
|
|
13275
13275
|
if (desc === "Erev Tish'a B'Av") {
|
|
13276
13276
|
const sunset = zmanim.sunset();
|
|
13277
|
-
if (!isNaN(sunset.getTime())) {
|
|
13277
|
+
if (!Number.isNaN(sunset.getTime())) {
|
|
13278
13278
|
startEvent = makeTimedEvent(ev, sunset, FAST_BEGINS, options);
|
|
13279
13279
|
}
|
|
13280
13280
|
}
|
|
13281
13281
|
else if (desc.startsWith("Tish'a B'Av")) {
|
|
13282
13282
|
const fastEnd = makeFastEndTime(zmanim, true, options);
|
|
13283
|
-
if (!isNaN(fastEnd.getTime())) {
|
|
13283
|
+
if (!Number.isNaN(fastEnd.getTime())) {
|
|
13284
13284
|
endEvent = makeTimedEvent(ev, fastEnd, FAST_ENDS, options);
|
|
13285
13285
|
}
|
|
13286
13286
|
}
|
|
13287
13287
|
else {
|
|
13288
13288
|
const fastStart = makeFastStartTime(zmanim, options);
|
|
13289
|
-
if (!isNaN(fastStart.getTime())) {
|
|
13289
|
+
if (!Number.isNaN(fastStart.getTime())) {
|
|
13290
13290
|
startEvent = makeTimedEvent(ev, fastStart, FAST_BEGINS, options);
|
|
13291
13291
|
}
|
|
13292
13292
|
if (dt.getDay() !== 5 &&
|
|
13293
13293
|
!(hd.getDate() === 14 && hd.getMonth() === months.NISAN)) {
|
|
13294
13294
|
const fastEnd = makeFastEndTime(zmanim, false, options);
|
|
13295
|
-
if (!isNaN(fastEnd.getTime())) {
|
|
13295
|
+
if (!Number.isNaN(fastEnd.getTime())) {
|
|
13296
13296
|
endEvent = makeTimedEvent(ev, fastEnd, FAST_ENDS, options);
|
|
13297
13297
|
}
|
|
13298
13298
|
}
|
|
@@ -13344,7 +13344,7 @@ function makeWeekdayChanukahCandleLighting(ev, options) {
|
|
|
13344
13344
|
const useElevation = Boolean(options.useElevation);
|
|
13345
13345
|
const zmanim = new Zmanim(location, hd.greg(), useElevation);
|
|
13346
13346
|
const candleLightingTime = zmanim.beinHaShmashos();
|
|
13347
|
-
if (isNaN(candleLightingTime.getTime())) {
|
|
13347
|
+
if (Number.isNaN(candleLightingTime.getTime())) {
|
|
13348
13348
|
return null;
|
|
13349
13349
|
}
|
|
13350
13350
|
return new TimedChanukahEvent(ev, candleLightingTime, location);
|
|
@@ -13377,10 +13377,12 @@ class KiddushLevanaEvent extends TimedEvent {
|
|
|
13377
13377
|
* @param location geographic location used to format the time
|
|
13378
13378
|
* @param molad the molad of the month
|
|
13379
13379
|
* @param options optional; `locale` and `hour12` affect the formatted times
|
|
13380
|
+
* @param adjustedTo optional; why `eventTime` was moved earlier
|
|
13380
13381
|
*/
|
|
13381
|
-
constructor(date, eventTime, location, molad, options) {
|
|
13382
|
+
constructor(date, eventTime, location, molad, options, adjustedTo) {
|
|
13382
13383
|
super(date, LATEST_KIDDUSH_LEVANA, flags.KIDDUSH_LEVANA, eventTime, location, undefined, options);
|
|
13383
13384
|
this.molad = molad;
|
|
13385
|
+
this.adjustedTo = adjustedTo;
|
|
13384
13386
|
}
|
|
13385
13387
|
getEmoji() {
|
|
13386
13388
|
return '🌔';
|
|
@@ -13394,7 +13396,7 @@ function toDate(zdt) {
|
|
|
13394
13396
|
}
|
|
13395
13397
|
function toZdt(dt, tzid) {
|
|
13396
13398
|
const millis = dt.getTime();
|
|
13397
|
-
if (isNaN(millis)) {
|
|
13399
|
+
if (Number.isNaN(millis)) {
|
|
13398
13400
|
return null;
|
|
13399
13401
|
}
|
|
13400
13402
|
return Temporal.Instant.fromEpochMilliseconds(millis).toZonedDateTimeISO(tzid);
|
|
@@ -13426,7 +13428,8 @@ function makeKiddushLevanaEvent(hyear, hmonth, options) {
|
|
|
13426
13428
|
for (let dd = 11; dd <= 16; dd++) {
|
|
13427
13429
|
const hd = new HDate(dd, hmonth, hyear);
|
|
13428
13430
|
const zmanim = new Zmanim(location, hd, useElevation);
|
|
13429
|
-
|
|
13431
|
+
const unadjusted = zmanim.getSofZmanKidushLevanaBetweenMoldos();
|
|
13432
|
+
if (unadjusted === null) {
|
|
13430
13433
|
continue;
|
|
13431
13434
|
}
|
|
13432
13435
|
// Move a daytime time back to alot hashachar that morning
|
|
@@ -13438,11 +13441,12 @@ function makeKiddushLevanaEvent(hyear, hmonth, options) {
|
|
|
13438
13441
|
return undefined;
|
|
13439
13442
|
}
|
|
13440
13443
|
const molad = new Molad(hyear, hmonth);
|
|
13444
|
+
const movedToAlot = zdt.epochMilliseconds !== unadjusted.epochMilliseconds;
|
|
13441
13445
|
// After daytime adjustment the time is at night: before alot hashachar
|
|
13442
13446
|
// it belongs to today's Hebrew date, after tzeit to tomorrow's.
|
|
13443
13447
|
const nightOf = zdt.hour < 12 ? hd : hd.next();
|
|
13444
13448
|
if (!isShabbatOrChag(nightOf, il)) {
|
|
13445
|
-
return new KiddushLevanaEvent(hd, toDate(floorMinute(zdt)), location, molad, options);
|
|
13449
|
+
return new KiddushLevanaEvent(hd, toDate(floorMinute(zdt)), location, molad, options, movedToAlot ? 'alot' : undefined);
|
|
13446
13450
|
}
|
|
13447
13451
|
// Back up to candle-lighting time before the Shabbat or Yom Tov
|
|
13448
13452
|
let first = nightOf;
|
|
@@ -13452,10 +13456,10 @@ function makeKiddushLevanaEvent(hyear, hmonth, options) {
|
|
|
13452
13456
|
const erev = first.prev();
|
|
13453
13457
|
const erevZmanim = new Zmanim(location, erev, useElevation);
|
|
13454
13458
|
const candleLighting = erevZmanim.sunsetOffset(Number(options.candleLightingMins), true);
|
|
13455
|
-
if (isNaN(candleLighting.getTime())) {
|
|
13459
|
+
if (Number.isNaN(candleLighting.getTime())) {
|
|
13456
13460
|
return undefined;
|
|
13457
13461
|
}
|
|
13458
|
-
return new KiddushLevanaEvent(erev, candleLighting, location, molad, options);
|
|
13462
|
+
return new KiddushLevanaEvent(erev, candleLighting, location, molad, options, 'candleLighting');
|
|
13459
13463
|
}
|
|
13460
13464
|
return undefined;
|
|
13461
13465
|
}
|
|
@@ -14180,7 +14184,7 @@ function getStartAndEnd(options) {
|
|
|
14180
14184
|
}
|
|
14181
14185
|
const isHebrewYear = Boolean(options.isHebrewYear);
|
|
14182
14186
|
const theYear = getYear(options);
|
|
14183
|
-
if (isNaN(theYear)) {
|
|
14187
|
+
if (Number.isNaN(theYear)) {
|
|
14184
14188
|
throw new RangeError(`Invalid year ${options.year}`);
|
|
14185
14189
|
}
|
|
14186
14190
|
if (isHebrewYear && theYear < 1) {
|
|
@@ -14770,7 +14774,7 @@ function checkCandleOptions(options) {
|
|
|
14770
14774
|
}
|
|
14771
14775
|
// Kiddush Levana needs candle-lighting time for Shabbat and Yom Tov
|
|
14772
14776
|
const min0 = options.candleLightingMins;
|
|
14773
|
-
let min = typeof min0 === 'number' && !isNaN(min0) ? Math.trunc(min0) : 18;
|
|
14777
|
+
let min = typeof min0 === 'number' && !Number.isNaN(min0) ? Math.trunc(min0) : 18;
|
|
14774
14778
|
if (location.getIsrael() && Math.abs(min) === 18) {
|
|
14775
14779
|
min = overrideIsraelCandleMins(location);
|
|
14776
14780
|
}
|
|
@@ -15098,7 +15102,7 @@ function makeOmerEvent(hd, omerDay, options) {
|
|
|
15098
15102
|
const location = options.location;
|
|
15099
15103
|
const zmanim = new Zmanim(location, hd.prev(), false);
|
|
15100
15104
|
const tzeit = zmanim.tzeit(DEG_7_POINT_083);
|
|
15101
|
-
if (!isNaN(tzeit.getTime())) {
|
|
15105
|
+
if (!Number.isNaN(tzeit.getTime())) {
|
|
15102
15106
|
omerEv.alarm = tzeit;
|
|
15103
15107
|
}
|
|
15104
15108
|
}
|
|
@@ -15111,7 +15115,7 @@ function makeErevPesachChametzEvents(erevPesachEv, options) {
|
|
|
15111
15115
|
const hd = erevPesachEv.getDate();
|
|
15112
15116
|
const zmanim = new Zmanim(location, hd, useElevation);
|
|
15113
15117
|
const zmanAchilas = zmanim.sofZmanTfilla(); // Gra
|
|
15114
|
-
if (isNaN(zmanAchilas.getTime())) {
|
|
15118
|
+
if (Number.isNaN(zmanAchilas.getTime())) {
|
|
15115
15119
|
return [];
|
|
15116
15120
|
}
|
|
15117
15121
|
const zmanAchilasEv = new TimedEvent(hd, holidayDesc.SOF_ZMAN_ACHILAT_CHAMETZ, 0, zmanAchilas, location, undefined, options);
|
|
@@ -15133,7 +15137,7 @@ function makeBiurChametzEvent(hd, options) {
|
|
|
15133
15137
|
const useElevation = Boolean(options.useElevation);
|
|
15134
15138
|
const zmanim = new Zmanim(location, hd, useElevation);
|
|
15135
15139
|
const time = zmanim.sofZmanBiurChametzGRA();
|
|
15136
|
-
if (isNaN(time.getTime())) {
|
|
15140
|
+
if (Number.isNaN(time.getTime())) {
|
|
15137
15141
|
return undefined;
|
|
15138
15142
|
}
|
|
15139
15143
|
const biurChametzEv = new TimedEvent(hd, holidayDesc.BIUR_CHAMETZ, 0, time, location, undefined, options);
|