@hebcal/core 6.14.7 → 6.16.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/README.md +25 -0
- package/dist/bundle.js +699 -404
- 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.d.ts +1 -1
- package/dist/esm/HolidayEvent.js +3 -3
- package/dist/esm/HolidayEvent.js.map +1 -1
- package/dist/esm/KiddushLevanaEvent.js +1 -1
- package/dist/esm/MevarchimChodeshEvent.js +1 -1
- package/dist/esm/ParshaEvent.js +2 -2
- package/dist/esm/ParshaEvent.js.map +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 +1 -1
- package/dist/esm/candles.js +1 -1
- package/dist/esm/cities.json.js +1 -1
- package/dist/esm/event.js +1 -1
- package/dist/esm/getStartAndEnd.js +1 -1
- package/dist/esm/hallel.d.ts +26 -3
- package/dist/esm/hallel.js +86 -29
- 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 +3 -9
- package/dist/esm/hebcal.js +6 -16
- package/dist/esm/hebcal.js.map +1 -1
- package/dist/esm/holidays.js +1 -1
- package/dist/esm/horizon.d.ts +94 -0
- package/dist/esm/horizon.js +146 -0
- package/dist/esm/horizon.js.map +1 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/isAssurBemlacha.js +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 +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.d.ts +4 -0
- package/dist/esm/omer.js +6 -2
- package/dist/esm/omer.js.map +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 +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.d.ts +2 -1
- package/dist/esm/zenith.js +4 -3
- package/dist/esm/zenith.js.map +1 -1
- package/dist/esm/zmanim.d.ts +117 -5
- package/dist/esm/zmanim.js +202 -8
- package/dist/esm/zmanim.js.map +1 -1
- package/package.json +9 -9
package/dist/esm/parshaYear.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v6.
|
|
1
|
+
/*! @hebcal/core v6.16.0, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
import { HDate, months } from '@hebcal/hdate';
|
|
3
3
|
import { ParshaEvent } from './ParshaEvent.js';
|
|
4
4
|
import { getSedra } from './sedra.js';
|
package/dist/esm/pkgVersion.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** DO NOT EDIT THIS AUTO-GENERATED FILE! */
|
|
2
|
-
export declare const version = "6.
|
|
2
|
+
export declare const version = "6.16.0";
|
package/dist/esm/pkgVersion.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @hebcal/core v6.
|
|
1
|
+
/*! @hebcal/core v6.16.0, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
/** DO NOT EDIT THIS AUTO-GENERATED FILE! */
|
|
3
|
-
const version = '6.
|
|
3
|
+
const version = '6.16.0';
|
|
4
4
|
|
|
5
5
|
export { version };
|
|
6
6
|
//# sourceMappingURL=pkgVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pkgVersion.js","sources":["../../../src/pkgVersion.ts"],"sourcesContent":["/** DO NOT EDIT THIS AUTO-GENERATED FILE! */\nexport const version = '6.
|
|
1
|
+
{"version":3,"file":"pkgVersion.js","sources":["../../../src/pkgVersion.ts"],"sourcesContent":["/** DO NOT EDIT THIS AUTO-GENERATED FILE! */\nexport const version = '6.16.0';\n"],"names":[],"mappings":";AAAA;AACO,MAAM,OAAO,GAAG;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v6.
|
|
1
|
+
/*! @hebcal/core v6.16.0, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
/** Countries that conventionally use a 12-hour clock */
|
|
3
3
|
const hour12cc = new Set([
|
|
4
4
|
'US',
|
package/dist/esm/sedra.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v6.
|
|
1
|
+
/*! @hebcal/core v6.16.0, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
import { HDate, months } from '@hebcal/hdate';
|
|
3
3
|
import QuickLRU from 'quick-lru';
|
|
4
4
|
import './locale.js';
|
package/dist/esm/sefira.json.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v6.
|
|
1
|
+
/*! @hebcal/core v6.16.0, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
var sefira = {
|
|
3
3
|
"ps67lines": [
|
|
4
4
|
"אֱלֹהִים יְחָנֵּנוּ וִיבָרְכֵנוּ יָאֵר־פָּנָיו אִתָּנוּ סֶלָה",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v6.
|
|
1
|
+
/*! @hebcal/core v6.16.0, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
import { months } from '@hebcal/hdate';
|
|
3
3
|
import { flags } from './event.js';
|
|
4
4
|
|
package/dist/esm/string.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v6.
|
|
1
|
+
/*! @hebcal/core v6.16.0, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
function smartApostrophe(str) {
|
|
3
3
|
return str.replaceAll("'", '’');
|
|
4
4
|
}
|
package/dist/esm/tachanun.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v6.
|
|
1
|
+
/*! @hebcal/core v6.16.0, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
import { HDate, months } from '@hebcal/hdate';
|
|
3
3
|
import { dateYomHaZikaron } from './modern.js';
|
|
4
4
|
|
package/dist/esm/zenith.d.ts
CHANGED
|
@@ -18,9 +18,10 @@ export declare const GEOMETRIC_ZENITH = 90;
|
|
|
18
18
|
*/
|
|
19
19
|
export declare const CIVIL_ZENITH: number;
|
|
20
20
|
/**
|
|
21
|
-
* The zenith of 1.
|
|
21
|
+
* The zenith of 1° 35' (1.58333°) below geometric zenith (90°). This calculation is used for
|
|
22
22
|
* calculating _netz amiti_ (sunrise) and _shkiah amiti_ (sunset) based on the opinion of the
|
|
23
23
|
* [Baal Hatanya](https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi).
|
|
24
|
+
* The exact 1° 35', not 1.583°, matches the times Chabad.org publishes.
|
|
24
25
|
*/
|
|
25
26
|
export declare const ZENITH_1_POINT_583: number;
|
|
26
27
|
/**
|
package/dist/esm/zenith.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v6.
|
|
1
|
+
/*! @hebcal/core v6.16.0, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
/**
|
|
3
3
|
* Solar zeniths and depression angles shared by the zmanim calculations.
|
|
4
4
|
*
|
|
@@ -19,11 +19,12 @@ const GEOMETRIC_ZENITH = 90;
|
|
|
19
19
|
*/
|
|
20
20
|
const CIVIL_ZENITH = GEOMETRIC_ZENITH + 6;
|
|
21
21
|
/**
|
|
22
|
-
* The zenith of 1.
|
|
22
|
+
* The zenith of 1° 35' (1.58333°) below geometric zenith (90°). This calculation is used for
|
|
23
23
|
* calculating _netz amiti_ (sunrise) and _shkiah amiti_ (sunset) based on the opinion of the
|
|
24
24
|
* [Baal Hatanya](https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi).
|
|
25
|
+
* The exact 1° 35', not 1.583°, matches the times Chabad.org publishes.
|
|
25
26
|
*/
|
|
26
|
-
const ZENITH_1_POINT_583 = GEOMETRIC_ZENITH + 1
|
|
27
|
+
const ZENITH_1_POINT_583 = GEOMETRIC_ZENITH + 1 + 35 / 60;
|
|
27
28
|
/**
|
|
28
29
|
* Tzeit HaKochavim as calculated by Rabbi Yechiel Michel Tucazinsky,
|
|
29
30
|
* 6.45° below the horizon. Default end time for Tish'a B'Av.
|
package/dist/esm/zenith.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zenith.js","sources":["../../../src/zenith.ts"],"sourcesContent":["/**\n * Solar zeniths and depression angles shared by the zmanim calculations.\n *\n * A _zenith_ is measured from directly overhead, so the horizon is 90°.\n * A _depression angle_ is measured below the horizon, which is what\n * {@link Zmanim.timeAtAngle}, {@link Zmanim.tzeit} and the `*Deg` fields\n * of {@link CalOptions} take; `Zmanim` adds {@link GEOMETRIC_ZENITH} back.\n * Names and values follow KosherJava's `ZENITH_*` constants in\n * [ComprehensiveZmanimCalendar](https://github.com/KosherJava/zmanim/blob/master/src/main/java/com/kosherjava/zmanim/ComprehensiveZmanimCalendar.java).\n */\n\n/**\n * The zenith of astronomical sunrise and sunset. The sun is 90° from the vertical 0°\n */\nexport const GEOMETRIC_ZENITH = 90;\n\n/**\n * The zenith of civil twilight; the sun is 6° below the horizon.\n * Matches `NOAACalculator.CIVIL_ZENITH`.\n */\nexport const CIVIL_ZENITH = GEOMETRIC_ZENITH + 6;\n\n/**\n * The zenith of 1.
|
|
1
|
+
{"version":3,"file":"zenith.js","sources":["../../../src/zenith.ts"],"sourcesContent":["/**\n * Solar zeniths and depression angles shared by the zmanim calculations.\n *\n * A _zenith_ is measured from directly overhead, so the horizon is 90°.\n * A _depression angle_ is measured below the horizon, which is what\n * {@link Zmanim.timeAtAngle}, {@link Zmanim.tzeit} and the `*Deg` fields\n * of {@link CalOptions} take; `Zmanim` adds {@link GEOMETRIC_ZENITH} back.\n * Names and values follow KosherJava's `ZENITH_*` constants in\n * [ComprehensiveZmanimCalendar](https://github.com/KosherJava/zmanim/blob/master/src/main/java/com/kosherjava/zmanim/ComprehensiveZmanimCalendar.java).\n */\n\n/**\n * The zenith of astronomical sunrise and sunset. The sun is 90° from the vertical 0°\n */\nexport const GEOMETRIC_ZENITH = 90;\n\n/**\n * The zenith of civil twilight; the sun is 6° below the horizon.\n * Matches `NOAACalculator.CIVIL_ZENITH`.\n */\nexport const CIVIL_ZENITH = GEOMETRIC_ZENITH + 6;\n\n/**\n * The zenith of 1° 35' (1.58333°) below geometric zenith (90°). This calculation is used for\n * calculating _netz amiti_ (sunrise) and _shkiah amiti_ (sunset) based on the opinion of the\n * [Baal Hatanya](https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi).\n * The exact 1° 35', not 1.583°, matches the times Chabad.org publishes.\n */\nexport const ZENITH_1_POINT_583 = GEOMETRIC_ZENITH + 1 + 35 / 60;\n\n/**\n * Tzeit HaKochavim as calculated by Rabbi Yechiel Michel Tucazinsky,\n * 6.45° below the horizon. Default end time for Tish'a B'Av.\n * KosherJava's `ZENITH_6_POINT_45`.\n */\nexport const DEG_6_POINT_45 = 6.45;\n\n/**\n * Observation of 3 medium-sized stars, 7°5′ (7.083°) below the horizon.\n * Default end time for minor fasts in the Diaspora, and the basis of\n * _bein hashmashos_. KosherJava's `ZENITH_7_POINT_083` is\n * `GEOMETRIC_ZENITH + 7 + (5.0 / 60)`; adding {@link GEOMETRIC_ZENITH} to\n * this value gives exactly the same `97.08333333333333`.\n */\nexport const DEG_7_POINT_083 = 7 + 5 / 60;\n\n/**\n * Tzeit HaKochavim, 8.5° below the horizon: the position of the sun 36\n * minutes after sunset in Jerusalem around the equinox / equilux, when the\n * Ohr Meir considers 3 small stars to be visible. Default for Havdalah.\n * KosherJava's `ZENITH_8_POINT_5`.\n */\nexport const DEG_8_POINT_5 = 8.5;\n\n/**\n * Alot HaShachar, 16.1° below the horizon. Default start time for minor\n * fasts. KosherJava's `ZENITH_16_POINT_1`.\n */\nexport const DEG_16_POINT_1 = 16.1;\n"],"names":[],"mappings":";AAAA;;;;;;;;;AASG;AAEH;;AAEG;AACI,MAAM,gBAAgB,GAAG;AAEhC;;;AAGG;AACI,MAAM,YAAY,GAAG,gBAAgB,GAAG;AAE/C;;;;;AAKG;AACI,MAAM,kBAAkB,GAAG,gBAAgB,GAAG,CAAC,GAAG,EAAE,GAAG;AAE9D;;;;AAIG;AACI,MAAM,cAAc,GAAG;AAE9B;;;;;;AAMG;MACU,eAAe,GAAG,CAAC,GAAG,CAAC,GAAG;AAEvC;;;;;AAKG;AACI,MAAM,aAAa,GAAG;AAE7B;;;AAGG;AACI,MAAM,cAAc,GAAG;;"}
|
package/dist/esm/zmanim.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import 'temporal-polyfill/global';
|
|
2
2
|
import { GeoLocation } from '@hebcal/noaa';
|
|
3
3
|
import { HDate } from '@hebcal/hdate';
|
|
4
|
+
import { HorizonProfile } from './horizon.js';
|
|
4
5
|
/**
|
|
5
6
|
* Calculate halachic times (zmanim / זְמַנִּים) for a given day and location.
|
|
6
7
|
* Calculations are available for tzeit / tzais (nightfall),
|
|
@@ -136,6 +137,10 @@ export declare class Zmanim {
|
|
|
136
137
|
* `useElevation` setting.
|
|
137
138
|
*/
|
|
138
139
|
chatzot(): Date;
|
|
140
|
+
/**
|
|
141
|
+
* {@link chatzot} as epoch milliseconds, before the seconds are cut.
|
|
142
|
+
*/
|
|
143
|
+
private chatzotMillis;
|
|
139
144
|
/**
|
|
140
145
|
* Midnight – Chatzot; Sunset plus 6 halachic hours.
|
|
141
146
|
* If elevation is enabled, this function will include elevation in the calculation.
|
|
@@ -336,6 +341,111 @@ export declare class Zmanim {
|
|
|
336
341
|
* Alias for sunset
|
|
337
342
|
*/
|
|
338
343
|
shkiah(): Date;
|
|
344
|
+
/**
|
|
345
|
+
* Visible sunrise — _netz ha-nireh_ (הנץ הנראה): the moment the sun's upper
|
|
346
|
+
* limb, bent up by atmospheric refraction, first clears the real terrain
|
|
347
|
+
* skyline to the east, rather than the flat sea-level horizon {@link sunrise}
|
|
348
|
+
* uses. In mountainous locations (most of Israel) this is noticeably later
|
|
349
|
+
* than {@link sunrise}; many printed Israeli calendars list it alongside the
|
|
350
|
+
* standard time.
|
|
351
|
+
*
|
|
352
|
+
* The caller supplies a {@link HorizonProfile} — the apparent altitude of the
|
|
353
|
+
* skyline as a function of azimuth (a constant, a list of
|
|
354
|
+
* azimuth/elevation samples, or a function). Building such a profile from
|
|
355
|
+
* terrain / digital-elevation-model data is outside this library.
|
|
356
|
+
*
|
|
357
|
+
* The method follows Keller & Hall, _Computers & Geosciences_ 26 (2000), and
|
|
358
|
+
* the Chai Tables (chaitables.com): refraction is Sinclair below 15° and
|
|
359
|
+
* Bennett at or above 15° at standard atmosphere (1010 hPa, 10 °C), applied
|
|
360
|
+
* to the sun's upper limb. No cushion or safety margin is added.
|
|
361
|
+
*
|
|
362
|
+
* The `useElevation` setting is intentionally ignored: the profile is
|
|
363
|
+
* measured from the observer's own eye position (already accounting for the
|
|
364
|
+
* observer's height, terrestrial refraction and Earth's curvature — a sea
|
|
365
|
+
* horizon seen from a height is a negative angle), so applying the library's
|
|
366
|
+
* sea-level-vs-elevation adjustment on top would double-count.
|
|
367
|
+
* @example
|
|
368
|
+
* import {GeoLocation, Zmanim} from '@hebcal/core';
|
|
369
|
+
* const gloc = new GeoLocation('Jerusalem', 31.78, 35.22, 0, 'Asia/Jerusalem');
|
|
370
|
+
* const zmanim = new Zmanim(gloc, new Date(2026, 9, 29), false);
|
|
371
|
+
* const tzid = 'Asia/Jerusalem';
|
|
372
|
+
* // A constant: the skyline is 3° above level in every direction
|
|
373
|
+
* Zmanim.formatISOWithTimeZone(tzid, zmanim.visibleSunrise(3));
|
|
374
|
+
* // '2026-10-29T06:09:07+02:00'
|
|
375
|
+
* // Samples: a 5° ridge to the east (azimuth 90), flat elsewhere; values
|
|
376
|
+
* // between samples are interpolated, and the list wraps around at 360°
|
|
377
|
+
* const ridge = [
|
|
378
|
+
* {azimuth: 60, elevation: 0},
|
|
379
|
+
* {azimuth: 80, elevation: 5},
|
|
380
|
+
* {azimuth: 100, elevation: 5},
|
|
381
|
+
* {azimuth: 120, elevation: 0},
|
|
382
|
+
* ];
|
|
383
|
+
* Zmanim.formatISOWithTimeZone(tzid, zmanim.visibleSunrise(ridge));
|
|
384
|
+
* // '2026-10-29T06:09:43+02:00'
|
|
385
|
+
* // A function of azimuth (degrees clockwise from true north)
|
|
386
|
+
* Zmanim.formatISOWithTimeZone(tzid, zmanim.visibleSunrise((az) => (az > 70 && az < 110 ? 5 : 0)));
|
|
387
|
+
* // '2026-10-29T06:19:24+02:00'
|
|
388
|
+
* // A flat profile of 0 reproduces sunrise() to within a second
|
|
389
|
+
* Zmanim.formatISOWithTimeZone(tzid, zmanim.visibleSunrise(0));
|
|
390
|
+
* // '2026-10-29T05:52:46+02:00'
|
|
391
|
+
* Zmanim.formatISOWithTimeZone(tzid, zmanim.sunrise());
|
|
392
|
+
* // '2026-10-29T05:52:46+02:00'
|
|
393
|
+
* @param horizon the terrain horizon profile
|
|
394
|
+
* @return the `Date` (to the second) when the sun first becomes visible, or
|
|
395
|
+
* an `Invalid Date` when there is no such crossing that day (polar
|
|
396
|
+
* night/day, or the sun never clears the profile).
|
|
397
|
+
*/
|
|
398
|
+
visibleSunrise(horizon: HorizonProfile): Date;
|
|
399
|
+
/**
|
|
400
|
+
* Visible sunset — _shkiah nireit_ (שקיעה נראית): the symmetric evening
|
|
401
|
+
* counterpart of {@link visibleSunrise}, the last moment the sun's upper
|
|
402
|
+
* limb is visible above the real terrain skyline to the west before it
|
|
403
|
+
* disappears behind the ridge line.
|
|
404
|
+
*
|
|
405
|
+
* See {@link visibleSunrise} for the horizon-profile argument, the
|
|
406
|
+
* refraction model, the upper-limb convention, that no cushion is added, and
|
|
407
|
+
* why `useElevation` is ignored.
|
|
408
|
+
* @example
|
|
409
|
+
* import {GeoLocation, Zmanim} from '@hebcal/core';
|
|
410
|
+
* // 300 m up on the Carmel: the sea horizon to the west sits about half a
|
|
411
|
+
* // degree *below* level, so the visible sunset is later than sunset()
|
|
412
|
+
* const tzid = 'Asia/Jerusalem';
|
|
413
|
+
* const gloc = new GeoLocation('Haifa', 32.8, 34.98, 300, tzid);
|
|
414
|
+
* const zmanim = new Zmanim(gloc, new Date(2026, 9, 29), false);
|
|
415
|
+
* Zmanim.formatISOWithTimeZone(tzid, zmanim.sunset());
|
|
416
|
+
* // '2026-10-29T16:52:01+02:00'
|
|
417
|
+
* Zmanim.formatISOWithTimeZone(tzid, zmanim.visibleSunset((az) => (az > 240 && az < 300 ? -0.5 : 0)));
|
|
418
|
+
* // '2026-10-29T16:55:07+02:00'
|
|
419
|
+
* @param horizon the terrain horizon profile
|
|
420
|
+
* @return the `Date` (to the second) when the sun was last visible, or an
|
|
421
|
+
* `Invalid Date` when there is no such crossing that day.
|
|
422
|
+
*/
|
|
423
|
+
visibleSunset(horizon: HorizonProfile): Date;
|
|
424
|
+
/**
|
|
425
|
+
* Alias for {@link visibleSunrise}
|
|
426
|
+
* @param horizon the terrain horizon profile
|
|
427
|
+
*/
|
|
428
|
+
neitzHaNireh(horizon: HorizonProfile): Date;
|
|
429
|
+
/**
|
|
430
|
+
* Alias for {@link visibleSunset}
|
|
431
|
+
* @param horizon the terrain horizon profile
|
|
432
|
+
*/
|
|
433
|
+
shkiahNireit(horizon: HorizonProfile): Date;
|
|
434
|
+
/**
|
|
435
|
+
* Shared search driving {@link visibleSunrise} / {@link visibleSunset}.
|
|
436
|
+
*
|
|
437
|
+
* Scans the sun's geometric centre altitude `a` upward from −2.5° to +10° in
|
|
438
|
+
* 0.05° steps. At each step it maps `a` to a time (via the sea-level
|
|
439
|
+
* sunrise/sunset for the zenith `90 − a`) and that time to the sun's azimuth,
|
|
440
|
+
* then compares the upper limb's apparent altitude against the horizon
|
|
441
|
+
* profile at that azimuth. The sun is visible once that difference `g` is
|
|
442
|
+
* `≥ 0`; the first upward crossing is bisected to 0.0005° and its time
|
|
443
|
+
* returned. For sunrise this is the first moment seen; for sunset (same
|
|
444
|
+
* upward scan, afternoon times) it is the last moment seen.
|
|
445
|
+
* @param horizon the terrain horizon profile
|
|
446
|
+
* @param rising `true` for the morning, `false` for the evening
|
|
447
|
+
*/
|
|
448
|
+
private visibleSunMillis;
|
|
339
449
|
/**
|
|
340
450
|
* Rabbeinu Tam holds that bein hashmashos is a specific time
|
|
341
451
|
* between sunset and tzeis hakochavim.
|
|
@@ -475,7 +585,7 @@ export declare class Zmanim {
|
|
|
475
585
|
*
|
|
476
586
|
* According to the Baal Hatanya, _netz amiti_, or true (halachic) sunrise, is when the top of the sun's
|
|
477
587
|
* disk is visible at an elevation similar to the mountains of Eretz Yisrael. The time is calculated as the point at which
|
|
478
|
-
* the center of the sun's disk is 1.
|
|
588
|
+
* the center of the sun's disk is 1° 35' (1.58333°) below the horizon. This degree-based calculation can be found in Rabbi Shalom
|
|
479
589
|
* DovBer Levine's commentary on
|
|
480
590
|
* [The Baal Hatanya's Seder Hachnasas Shabbos](https://www.chabadlibrary.org/books/pdf/Seder-Hachnosas-Shabbos.pdf).
|
|
481
591
|
* From an elevation of 546 meters, the top of [Har Hacarmel](https://en.wikipedia.org/wiki/Mount_Carmel),
|
|
@@ -504,7 +614,7 @@ export declare class Zmanim {
|
|
|
504
614
|
*
|
|
505
615
|
* According to the Baal Hatanya, _shkiah amiti_, true (_halachic_) sunset, is when the top of the
|
|
506
616
|
* sun's disk disappears from view at an elevation similar to the mountains of _Eretz Yisrael_.
|
|
507
|
-
* This time is calculated as the point at which the center of the sun's disk is 1
|
|
617
|
+
* This time is calculated as the point at which the center of the sun's disk is 1° 35' below the horizon.
|
|
508
618
|
*
|
|
509
619
|
* Note: _shkiah amiti_ is used only for calculating certain _zmanim_, and is intentionally unpublished. For
|
|
510
620
|
* practical purposes, all daytime mitzvos should be completed before the published time for _shkiah_ / sunset.
|
|
@@ -562,9 +672,11 @@ export declare class Zmanim {
|
|
|
562
672
|
* [Ra"sh](https://en.wikipedia.org/wiki/Asher_ben_Jehiel),
|
|
563
673
|
* [Tur](https://en.wikipedia.org/wiki/Jacob_ben_Asher),
|
|
564
674
|
* [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon) and others are of the opinion that _mincha_ can be prayed
|
|
565
|
-
* _lechatchila_ starting at _mincha gedola_. This is calculated as
|
|
566
|
-
*
|
|
567
|
-
* _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).
|
|
675
|
+
* _lechatchila_ starting at _mincha gedola_. This is calculated as {@link chatzot} (the midpoint of
|
|
676
|
+
* sea level sunrise and sunset) plus half a solar hour, based on the opinion of the Baal Hatanya that
|
|
677
|
+
* the day is calculated from _netz amiti_ (sunrise) to _shkiah amiti_ (sunset). This is how Chabad.org
|
|
678
|
+
* calculates it; 6.5 solar hours after _netz amiti_ differs by under a second, but that is enough to
|
|
679
|
+
* change the printed minute on a few days a year.
|
|
568
680
|
* @return the `Date` of the time of _mincha gedola_ according to the Baal Hatanya. If the calculation
|
|
569
681
|
* 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
|
|
570
682
|
* and one where it does not set, an `Invalid Date` will be returned.
|
package/dist/esm/zmanim.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
/*! @hebcal/core v6.
|
|
1
|
+
/*! @hebcal/core v6.16.0, distributed under GPLv2 or later 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';
|
|
5
5
|
import { Molad } from './molad.js';
|
|
6
6
|
import { GEOMETRIC_ZENITH, CIVIL_ZENITH, DEG_16_POINT_1, DEG_8_POINT_5, DEG_7_POINT_083, ZENITH_1_POINT_583 } from './zenith.js';
|
|
7
|
+
import { upperLimbApparentAltitude, horizonElevation } from './horizon.js';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Converts an instant to a `Date`, discarding milliseconds.
|
|
@@ -220,10 +221,16 @@ class Zmanim {
|
|
|
220
221
|
* `useElevation` setting.
|
|
221
222
|
*/
|
|
222
223
|
chatzot() {
|
|
224
|
+
return millisToDate(this.chatzotMillis());
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* {@link chatzot} as epoch milliseconds, before the seconds are cut.
|
|
228
|
+
*/
|
|
229
|
+
chatzotMillis() {
|
|
223
230
|
const startOfDay = this.sunriseMillis(GEOMETRIC_ZENITH, false);
|
|
224
231
|
const endOfDay = this.sunsetMillis(GEOMETRIC_ZENITH, false);
|
|
225
232
|
// NOAACalculator.getSunTransit(): sunrise plus 6 temporal hours
|
|
226
|
-
return
|
|
233
|
+
return startOfDay + temporalHourMillis(startOfDay, endOfDay) * 6;
|
|
227
234
|
}
|
|
228
235
|
/**
|
|
229
236
|
* Midnight – Chatzot; Sunset plus 6 halachic hours.
|
|
@@ -514,6 +521,190 @@ class Zmanim {
|
|
|
514
521
|
shkiah() {
|
|
515
522
|
return this.sunset();
|
|
516
523
|
}
|
|
524
|
+
/**
|
|
525
|
+
* Visible sunrise — _netz ha-nireh_ (הנץ הנראה): the moment the sun's upper
|
|
526
|
+
* limb, bent up by atmospheric refraction, first clears the real terrain
|
|
527
|
+
* skyline to the east, rather than the flat sea-level horizon {@link sunrise}
|
|
528
|
+
* uses. In mountainous locations (most of Israel) this is noticeably later
|
|
529
|
+
* than {@link sunrise}; many printed Israeli calendars list it alongside the
|
|
530
|
+
* standard time.
|
|
531
|
+
*
|
|
532
|
+
* The caller supplies a {@link HorizonProfile} — the apparent altitude of the
|
|
533
|
+
* skyline as a function of azimuth (a constant, a list of
|
|
534
|
+
* azimuth/elevation samples, or a function). Building such a profile from
|
|
535
|
+
* terrain / digital-elevation-model data is outside this library.
|
|
536
|
+
*
|
|
537
|
+
* The method follows Keller & Hall, _Computers & Geosciences_ 26 (2000), and
|
|
538
|
+
* the Chai Tables (chaitables.com): refraction is Sinclair below 15° and
|
|
539
|
+
* Bennett at or above 15° at standard atmosphere (1010 hPa, 10 °C), applied
|
|
540
|
+
* to the sun's upper limb. No cushion or safety margin is added.
|
|
541
|
+
*
|
|
542
|
+
* The `useElevation` setting is intentionally ignored: the profile is
|
|
543
|
+
* measured from the observer's own eye position (already accounting for the
|
|
544
|
+
* observer's height, terrestrial refraction and Earth's curvature — a sea
|
|
545
|
+
* horizon seen from a height is a negative angle), so applying the library's
|
|
546
|
+
* sea-level-vs-elevation adjustment on top would double-count.
|
|
547
|
+
* @example
|
|
548
|
+
* import {GeoLocation, Zmanim} from '@hebcal/core';
|
|
549
|
+
* const gloc = new GeoLocation('Jerusalem', 31.78, 35.22, 0, 'Asia/Jerusalem');
|
|
550
|
+
* const zmanim = new Zmanim(gloc, new Date(2026, 9, 29), false);
|
|
551
|
+
* const tzid = 'Asia/Jerusalem';
|
|
552
|
+
* // A constant: the skyline is 3° above level in every direction
|
|
553
|
+
* Zmanim.formatISOWithTimeZone(tzid, zmanim.visibleSunrise(3));
|
|
554
|
+
* // '2026-10-29T06:09:07+02:00'
|
|
555
|
+
* // Samples: a 5° ridge to the east (azimuth 90), flat elsewhere; values
|
|
556
|
+
* // between samples are interpolated, and the list wraps around at 360°
|
|
557
|
+
* const ridge = [
|
|
558
|
+
* {azimuth: 60, elevation: 0},
|
|
559
|
+
* {azimuth: 80, elevation: 5},
|
|
560
|
+
* {azimuth: 100, elevation: 5},
|
|
561
|
+
* {azimuth: 120, elevation: 0},
|
|
562
|
+
* ];
|
|
563
|
+
* Zmanim.formatISOWithTimeZone(tzid, zmanim.visibleSunrise(ridge));
|
|
564
|
+
* // '2026-10-29T06:09:43+02:00'
|
|
565
|
+
* // A function of azimuth (degrees clockwise from true north)
|
|
566
|
+
* Zmanim.formatISOWithTimeZone(tzid, zmanim.visibleSunrise((az) => (az > 70 && az < 110 ? 5 : 0)));
|
|
567
|
+
* // '2026-10-29T06:19:24+02:00'
|
|
568
|
+
* // A flat profile of 0 reproduces sunrise() to within a second
|
|
569
|
+
* Zmanim.formatISOWithTimeZone(tzid, zmanim.visibleSunrise(0));
|
|
570
|
+
* // '2026-10-29T05:52:46+02:00'
|
|
571
|
+
* Zmanim.formatISOWithTimeZone(tzid, zmanim.sunrise());
|
|
572
|
+
* // '2026-10-29T05:52:46+02:00'
|
|
573
|
+
* @param horizon the terrain horizon profile
|
|
574
|
+
* @return the `Date` (to the second) when the sun first becomes visible, or
|
|
575
|
+
* an `Invalid Date` when there is no such crossing that day (polar
|
|
576
|
+
* night/day, or the sun never clears the profile).
|
|
577
|
+
*/
|
|
578
|
+
visibleSunrise(horizon) {
|
|
579
|
+
return this.visibleSunMillis(horizon, true);
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* Visible sunset — _shkiah nireit_ (שקיעה נראית): the symmetric evening
|
|
583
|
+
* counterpart of {@link visibleSunrise}, the last moment the sun's upper
|
|
584
|
+
* limb is visible above the real terrain skyline to the west before it
|
|
585
|
+
* disappears behind the ridge line.
|
|
586
|
+
*
|
|
587
|
+
* See {@link visibleSunrise} for the horizon-profile argument, the
|
|
588
|
+
* refraction model, the upper-limb convention, that no cushion is added, and
|
|
589
|
+
* why `useElevation` is ignored.
|
|
590
|
+
* @example
|
|
591
|
+
* import {GeoLocation, Zmanim} from '@hebcal/core';
|
|
592
|
+
* // 300 m up on the Carmel: the sea horizon to the west sits about half a
|
|
593
|
+
* // degree *below* level, so the visible sunset is later than sunset()
|
|
594
|
+
* const tzid = 'Asia/Jerusalem';
|
|
595
|
+
* const gloc = new GeoLocation('Haifa', 32.8, 34.98, 300, tzid);
|
|
596
|
+
* const zmanim = new Zmanim(gloc, new Date(2026, 9, 29), false);
|
|
597
|
+
* Zmanim.formatISOWithTimeZone(tzid, zmanim.sunset());
|
|
598
|
+
* // '2026-10-29T16:52:01+02:00'
|
|
599
|
+
* Zmanim.formatISOWithTimeZone(tzid, zmanim.visibleSunset((az) => (az > 240 && az < 300 ? -0.5 : 0)));
|
|
600
|
+
* // '2026-10-29T16:55:07+02:00'
|
|
601
|
+
* @param horizon the terrain horizon profile
|
|
602
|
+
* @return the `Date` (to the second) when the sun was last visible, or an
|
|
603
|
+
* `Invalid Date` when there is no such crossing that day.
|
|
604
|
+
*/
|
|
605
|
+
visibleSunset(horizon) {
|
|
606
|
+
return this.visibleSunMillis(horizon, false);
|
|
607
|
+
}
|
|
608
|
+
/**
|
|
609
|
+
* Alias for {@link visibleSunrise}
|
|
610
|
+
* @param horizon the terrain horizon profile
|
|
611
|
+
*/
|
|
612
|
+
neitzHaNireh(horizon) {
|
|
613
|
+
return this.visibleSunrise(horizon);
|
|
614
|
+
}
|
|
615
|
+
/**
|
|
616
|
+
* Alias for {@link visibleSunset}
|
|
617
|
+
* @param horizon the terrain horizon profile
|
|
618
|
+
*/
|
|
619
|
+
shkiahNireit(horizon) {
|
|
620
|
+
return this.visibleSunset(horizon);
|
|
621
|
+
}
|
|
622
|
+
/**
|
|
623
|
+
* Shared search driving {@link visibleSunrise} / {@link visibleSunset}.
|
|
624
|
+
*
|
|
625
|
+
* Scans the sun's geometric centre altitude `a` upward from −2.5° to +10° in
|
|
626
|
+
* 0.05° steps. At each step it maps `a` to a time (via the sea-level
|
|
627
|
+
* sunrise/sunset for the zenith `90 − a`) and that time to the sun's azimuth,
|
|
628
|
+
* then compares the upper limb's apparent altitude against the horizon
|
|
629
|
+
* profile at that azimuth. The sun is visible once that difference `g` is
|
|
630
|
+
* `≥ 0`; the first upward crossing is bisected to 0.0005° and its time
|
|
631
|
+
* returned. For sunrise this is the first moment seen; for sunset (same
|
|
632
|
+
* upward scan, afternoon times) it is the last moment seen.
|
|
633
|
+
* @param horizon the terrain horizon profile
|
|
634
|
+
* @param rising `true` for the morning, `false` for the evening
|
|
635
|
+
*/
|
|
636
|
+
visibleSunMillis(horizon, rising) {
|
|
637
|
+
const lat = this.gloc.getLatitude();
|
|
638
|
+
const lon = this.gloc.getLongitude();
|
|
639
|
+
const timeAt = (a) => {
|
|
640
|
+
// adjustZenith() silently folds in refraction + semidiameter when the
|
|
641
|
+
// zenith is exactly 90° (GEOMETRIC_ZENITH), which would corrupt the
|
|
642
|
+
// geometric-altitude mapping. Nudge by 1e-9° — far below the 0.0005°
|
|
643
|
+
// bisection tolerance, so harmless — to steer clear of that branch.
|
|
644
|
+
let zenith = 90 - a;
|
|
645
|
+
if (zenith === 90) {
|
|
646
|
+
zenith = 90 + 1e-9;
|
|
647
|
+
}
|
|
648
|
+
const utc = rising
|
|
649
|
+
? this.noaa.getUTCSeaLevelSunrise(zenith)
|
|
650
|
+
: this.noaa.getUTCSeaLevelSunset(zenith);
|
|
651
|
+
return this.noaa.getEpochMillisFromTime(utc, rising);
|
|
652
|
+
};
|
|
653
|
+
const azimuthAt = (t) => {
|
|
654
|
+
// The zone must be 'UTC': getSolarAzimuth() reads .hour/.minute/.second
|
|
655
|
+
// as UTC wall-clock fields.
|
|
656
|
+
const zdt = Temporal.Instant.fromEpochMilliseconds(t).toZonedDateTimeISO('UTC');
|
|
657
|
+
// getSolarAzimuth() uses atan() without quadrant resolution, so its
|
|
658
|
+
// result is only correct modulo 180°. Fold into [0,180) and add 180° in
|
|
659
|
+
// the evening so morning azimuths lie in (0°,180°) and evening ones in
|
|
660
|
+
// (180°,360°). This is a no-op for an already-correct azimuth (a correct
|
|
661
|
+
// morning azimuth is already in (0°,180°); a correct evening azimuth maps
|
|
662
|
+
// to itself), so it stays correct if a future noaa resolves the quadrant.
|
|
663
|
+
let az = NOAACalculator.getSolarAzimuth(zdt, lat, lon);
|
|
664
|
+
az = ((az % 180) + 180) % 180;
|
|
665
|
+
if (!rising) {
|
|
666
|
+
az += 180;
|
|
667
|
+
}
|
|
668
|
+
return az;
|
|
669
|
+
};
|
|
670
|
+
const g = (a) => upperLimbApparentAltitude(a) -
|
|
671
|
+
horizonElevation(horizon, azimuthAt(timeAt(a)));
|
|
672
|
+
const aLo = -2.5;
|
|
673
|
+
const aHi = 10;
|
|
674
|
+
const step = 0.05;
|
|
675
|
+
const tol = 0.0005;
|
|
676
|
+
// Evaluate the low end first so polar day/night (NaN time) is caught at once.
|
|
677
|
+
const tLo = timeAt(aLo);
|
|
678
|
+
if (Number.isNaN(tLo)) {
|
|
679
|
+
return millisToDate(NaN);
|
|
680
|
+
}
|
|
681
|
+
if (g(aLo) >= 0) {
|
|
682
|
+
return millisToDate(tLo);
|
|
683
|
+
}
|
|
684
|
+
let prevA = aLo;
|
|
685
|
+
for (let a = aLo + step; a <= aHi + 1e-9; a += step) {
|
|
686
|
+
if (Number.isNaN(timeAt(a))) {
|
|
687
|
+
return millisToDate(NaN);
|
|
688
|
+
}
|
|
689
|
+
if (g(a) >= 0) {
|
|
690
|
+
// Crossing in (prevA, a): bisect the altitude bracket to 0.0005°.
|
|
691
|
+
let lo = prevA;
|
|
692
|
+
let hi = a;
|
|
693
|
+
while (hi - lo > tol) {
|
|
694
|
+
const mid = (lo + hi) / 2;
|
|
695
|
+
if (g(mid) >= 0) {
|
|
696
|
+
hi = mid;
|
|
697
|
+
}
|
|
698
|
+
else {
|
|
699
|
+
lo = mid;
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
return millisToDate(timeAt(hi));
|
|
703
|
+
}
|
|
704
|
+
prevA = a;
|
|
705
|
+
}
|
|
706
|
+
return millisToDate(NaN);
|
|
707
|
+
}
|
|
517
708
|
/**
|
|
518
709
|
* Rabbeinu Tam holds that bein hashmashos is a specific time
|
|
519
710
|
* between sunset and tzeis hakochavim.
|
|
@@ -758,7 +949,7 @@ class Zmanim {
|
|
|
758
949
|
*
|
|
759
950
|
* According to the Baal Hatanya, _netz amiti_, or true (halachic) sunrise, is when the top of the sun's
|
|
760
951
|
* disk is visible at an elevation similar to the mountains of Eretz Yisrael. The time is calculated as the point at which
|
|
761
|
-
* the center of the sun's disk is 1.
|
|
952
|
+
* the center of the sun's disk is 1° 35' (1.58333°) below the horizon. This degree-based calculation can be found in Rabbi Shalom
|
|
762
953
|
* DovBer Levine's commentary on
|
|
763
954
|
* [The Baal Hatanya's Seder Hachnasas Shabbos](https://www.chabadlibrary.org/books/pdf/Seder-Hachnosas-Shabbos.pdf).
|
|
764
955
|
* From an elevation of 546 meters, the top of [Har Hacarmel](https://en.wikipedia.org/wiki/Mount_Carmel),
|
|
@@ -789,7 +980,7 @@ class Zmanim {
|
|
|
789
980
|
*
|
|
790
981
|
* According to the Baal Hatanya, _shkiah amiti_, true (_halachic_) sunset, is when the top of the
|
|
791
982
|
* sun's disk disappears from view at an elevation similar to the mountains of _Eretz Yisrael_.
|
|
792
|
-
* This time is calculated as the point at which the center of the sun's disk is 1
|
|
983
|
+
* This time is calculated as the point at which the center of the sun's disk is 1° 35' below the horizon.
|
|
793
984
|
*
|
|
794
985
|
* Note: _shkiah amiti_ is used only for calculating certain _zmanim_, and is intentionally unpublished. For
|
|
795
986
|
* practical purposes, all daytime mitzvos should be completed before the published time for _shkiah_ / sunset.
|
|
@@ -857,15 +1048,18 @@ class Zmanim {
|
|
|
857
1048
|
* [Ra"sh](https://en.wikipedia.org/wiki/Asher_ben_Jehiel),
|
|
858
1049
|
* [Tur](https://en.wikipedia.org/wiki/Jacob_ben_Asher),
|
|
859
1050
|
* [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon) and others are of the opinion that _mincha_ can be prayed
|
|
860
|
-
* _lechatchila_ starting at _mincha gedola_. This is calculated as
|
|
861
|
-
*
|
|
862
|
-
* _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).
|
|
1051
|
+
* _lechatchila_ starting at _mincha gedola_. This is calculated as {@link chatzot} (the midpoint of
|
|
1052
|
+
* sea level sunrise and sunset) plus half a solar hour, based on the opinion of the Baal Hatanya that
|
|
1053
|
+
* the day is calculated from _netz amiti_ (sunrise) to _shkiah amiti_ (sunset). This is how Chabad.org
|
|
1054
|
+
* calculates it; 6.5 solar hours after _netz amiti_ differs by under a second, but that is enough to
|
|
1055
|
+
* change the printed minute on a few days a year.
|
|
863
1056
|
* @return the `Date` of the time of _mincha gedola_ according to the Baal Hatanya. If the calculation
|
|
864
1057
|
* 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
|
|
865
1058
|
* and one where it does not set, an `Invalid Date` will be returned.
|
|
866
1059
|
*/
|
|
867
1060
|
minchaGedolaBaalHatanya() {
|
|
868
|
-
|
|
1061
|
+
const hour = temporalHourMillis(this.getSunriseBaalHatanya(), this.getSunsetBaalHatanya());
|
|
1062
|
+
return millisToDate(this.chatzotMillis() + hour / 2);
|
|
869
1063
|
}
|
|
870
1064
|
/**
|
|
871
1065
|
* This method returns the time of _mincha ketana_. This is the preferred earliest time to pray
|