@hebcal/core 4.4.0 → 4.5.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 +59 -41
- package/dist/bundle.js +150 -106
- package/dist/bundle.min.js +2 -2
- package/dist/greg0.mjs +1 -1
- package/dist/hdate-bundle.js +11 -12
- package/dist/hdate-bundle.min.js +2 -2
- package/dist/hdate.js +11 -12
- package/dist/hdate.mjs +11 -10
- package/dist/hdate0-bundle.js +1 -1
- package/dist/hdate0-bundle.min.js +1 -1
- package/dist/hdate0.mjs +1 -1
- package/dist/index.js +148 -104
- package/dist/index.mjs +148 -104
- package/hebcal.d.ts +29 -8
- package/package.json +11 -12
package/README.md
CHANGED
|
@@ -68,7 +68,17 @@ holidays. <code>@hebcal/core</code> supports four locales by default</p>
|
|
|
68
68
|
<dd><p>Daily Hebrew date ("11th of Sivan, 5780")</p>
|
|
69
69
|
</dd>
|
|
70
70
|
<dt><a href="#Zmanim">Zmanim</a></dt>
|
|
71
|
-
<dd><p>
|
|
71
|
+
<dd><p>Calculate halachic times (zmanim / זְמַנִּים) for a given day and location.
|
|
72
|
+
Calculations are available for tzeit / tzais (nightfall),
|
|
73
|
+
shkiah (sunset) and more.</p>
|
|
74
|
+
<p>Zmanim are estimated using an algorithm published by the US National Oceanic
|
|
75
|
+
and Atmospheric Administration. The NOAA solar calculator is based on equations
|
|
76
|
+
from <em>Astronomical Algorithms</em> by Jean Meeus.</p>
|
|
77
|
+
<p>The sunrise and sunset results are theoretically accurate to within a minute for
|
|
78
|
+
locations between +/- 72° latitude, and within 10 minutes outside of those latitudes.
|
|
79
|
+
However, due to variations in atmospheric composition, temperature, pressure and
|
|
80
|
+
conditions, observed values may vary from calculations.
|
|
81
|
+
<a href="https://gml.noaa.gov/grad/solcalc/calcdetails.html">https://gml.noaa.gov/grad/solcalc/calcdetails.html</a></p>
|
|
72
82
|
</dd>
|
|
73
83
|
<dt><a href="#Location">Location</a></dt>
|
|
74
84
|
<dd><p>Class representing Location</p>
|
|
@@ -1083,7 +1093,19 @@ Helper function to render a Hebrew date
|
|
|
1083
1093
|
<a name="Zmanim"></a>
|
|
1084
1094
|
|
|
1085
1095
|
## Zmanim
|
|
1086
|
-
|
|
1096
|
+
Calculate halachic times (zmanim / זְמַנִּים) for a given day and location.
|
|
1097
|
+
Calculations are available for tzeit / tzais (nightfall),
|
|
1098
|
+
shkiah (sunset) and more.
|
|
1099
|
+
|
|
1100
|
+
Zmanim are estimated using an algorithm published by the US National Oceanic
|
|
1101
|
+
and Atmospheric Administration. The NOAA solar calculator is based on equations
|
|
1102
|
+
from _Astronomical Algorithms_ by Jean Meeus.
|
|
1103
|
+
|
|
1104
|
+
The sunrise and sunset results are theoretically accurate to within a minute for
|
|
1105
|
+
locations between +/- 72° latitude, and within 10 minutes outside of those latitudes.
|
|
1106
|
+
However, due to variations in atmospheric composition, temperature, pressure and
|
|
1107
|
+
conditions, observed values may vary from calculations.
|
|
1108
|
+
https://gml.noaa.gov/grad/solcalc/calcdetails.html
|
|
1087
1109
|
|
|
1088
1110
|
**Kind**: global class
|
|
1089
1111
|
|
|
@@ -1091,6 +1113,7 @@ Class representing halachic times
|
|
|
1091
1113
|
* [new Zmanim(date, latitude, longitude)](#new_Zmanim_new)
|
|
1092
1114
|
* _instance_
|
|
1093
1115
|
* ~~[.suntime()](#Zmanim+suntime) ⇒ [<code>ZmanimTimesResult</code>](#ZmanimTimesResult)~~
|
|
1116
|
+
* [.timeAtAngle(angle, rising)](#Zmanim+timeAtAngle) ⇒ <code>Date</code>
|
|
1094
1117
|
* [.sunrise()](#Zmanim+sunrise) ⇒ <code>Date</code>
|
|
1095
1118
|
* [.sunset()](#Zmanim+sunset) ⇒ <code>Date</code>
|
|
1096
1119
|
* [.dawn()](#Zmanim+dawn) ⇒ <code>Date</code>
|
|
@@ -1138,12 +1161,35 @@ Initialize a Zmanim instance.
|
|
|
1138
1161
|
| latitude | <code>number</code> | |
|
|
1139
1162
|
| longitude | <code>number</code> | |
|
|
1140
1163
|
|
|
1164
|
+
**Example**
|
|
1165
|
+
```js
|
|
1166
|
+
const {Zmanim} = require('@hebcal/core');
|
|
1167
|
+
const latitude = 41.822232;
|
|
1168
|
+
const longitude = -71.448292;
|
|
1169
|
+
const friday = new Date(2023, 8, 8);
|
|
1170
|
+
const zmanim = new Zmanim(friday, latitude, longitude);
|
|
1171
|
+
const candleLighting = zmanim.sunsetOffset(-18, true);
|
|
1172
|
+
const timeStr = Zmanim.formatISOWithTimeZone('America/New_York', candleLighting);
|
|
1173
|
+
```
|
|
1141
1174
|
<a name="Zmanim+suntime"></a>
|
|
1142
1175
|
|
|
1143
1176
|
### ~~zmanim.suntime() ⇒ [<code>ZmanimTimesResult</code>](#ZmanimTimesResult)~~
|
|
1144
1177
|
***Deprecated***
|
|
1145
1178
|
|
|
1146
1179
|
**Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
|
|
1180
|
+
<a name="Zmanim+timeAtAngle"></a>
|
|
1181
|
+
|
|
1182
|
+
### zmanim.timeAtAngle(angle, rising) ⇒ <code>Date</code>
|
|
1183
|
+
Convenience function to get the time when sun is above or below the horizon
|
|
1184
|
+
for a certain angle (in degrees).
|
|
1185
|
+
|
|
1186
|
+
**Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
|
|
1187
|
+
|
|
1188
|
+
| Param | Type |
|
|
1189
|
+
| --- | --- |
|
|
1190
|
+
| angle | <code>number</code> |
|
|
1191
|
+
| rising | <code>boolean</code> |
|
|
1192
|
+
|
|
1147
1193
|
<a name="Zmanim+sunrise"></a>
|
|
1148
1194
|
|
|
1149
1195
|
### zmanim.sunrise() ⇒ <code>Date</code>
|
|
@@ -1276,7 +1322,7 @@ Plag haMincha; Sunrise plus 10.75 halachic hours
|
|
|
1276
1322
|
|
|
1277
1323
|
| Param | Type | Default | Description |
|
|
1278
1324
|
| --- | --- | --- | --- |
|
|
1279
|
-
| [angle] | <code>number</code> | <code>8.5</code> | optional time for solar depression. Default is 8.5 degrees for 3 small stars, use 7.083
|
|
1325
|
+
| [angle] | <code>number</code> | <code>8.5</code> | optional time for solar depression. Default is 8.5 degrees for 3 small stars, use 7.083 degrees for 3 medium-sized stars. |
|
|
1280
1326
|
|
|
1281
1327
|
<a name="Zmanim+neitzHaChama"></a>
|
|
1282
1328
|
|
|
@@ -1339,7 +1385,7 @@ Returns an array with tzeit Date object and a 24-hour string formatted time.
|
|
|
1339
1385
|
|
|
1340
1386
|
| Param | Type | Description |
|
|
1341
1387
|
| --- | --- | --- |
|
|
1342
|
-
| angle | <code>number</code> | degrees for solar depression. Default is 8.5 degrees for 3 small stars, use 7.083
|
|
1388
|
+
| angle | <code>number</code> | degrees for solar depression. Default is 8.5 degrees for 3 small stars, use 7.083 degrees for 3 medium-sized stars. |
|
|
1343
1389
|
| timeFormat | <code>Intl.DateTimeFormat</code> | |
|
|
1344
1390
|
|
|
1345
1391
|
<a name="Zmanim.formatTime"></a>
|
|
@@ -2035,26 +2081,12 @@ Represents a built-in holiday like Pesach, Purim or Tu BiShvat
|
|
|
2035
2081
|
**Kind**: global class
|
|
2036
2082
|
|
|
2037
2083
|
* [HolidayEvent](#HolidayEvent)
|
|
2038
|
-
* [new HolidayEvent(date, desc, [mask], [attrs])](#new_HolidayEvent_new)
|
|
2039
2084
|
* [.basename()](#HolidayEvent+basename) ⇒ <code>string</code>
|
|
2040
2085
|
* [.url()](#HolidayEvent+url) ⇒ <code>string</code>
|
|
2041
2086
|
* [.urlDateSuffix()](#HolidayEvent+urlDateSuffix) ⇒ <code>string</code>
|
|
2042
2087
|
* [.getEmoji()](#HolidayEvent+getEmoji) ⇒ <code>string</code>
|
|
2043
2088
|
* [.getCategories()](#HolidayEvent+getCategories) ⇒ <code>Array.<string></code>
|
|
2044
2089
|
|
|
2045
|
-
<a name="new_HolidayEvent_new"></a>
|
|
2046
|
-
|
|
2047
|
-
### new HolidayEvent(date, desc, [mask], [attrs])
|
|
2048
|
-
Constructs Holiday event
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
| Param | Type | Default | Description |
|
|
2052
|
-
| --- | --- | --- | --- |
|
|
2053
|
-
| date | [<code>HDate</code>](#HDate) | | Hebrew date event occurs |
|
|
2054
|
-
| desc | <code>string</code> | | Description (not translated) |
|
|
2055
|
-
| [mask] | <code>number</code> | <code>0</code> | optional holiday flags |
|
|
2056
|
-
| [attrs] | <code>Object</code> | <code>{}</code> | |
|
|
2057
|
-
|
|
2058
2090
|
<a name="HolidayEvent+basename"></a>
|
|
2059
2091
|
|
|
2060
2092
|
### holidayEvent.basename() ⇒ <code>string</code>
|
|
@@ -2125,23 +2157,6 @@ Because Asara B'Tevet often occurs twice in the same Gregorian year,
|
|
|
2125
2157
|
we subclass HolidayEvent to override the `url()` method.
|
|
2126
2158
|
|
|
2127
2159
|
**Kind**: global class
|
|
2128
|
-
|
|
2129
|
-
* [AsaraBTevetEvent](#AsaraBTevetEvent)
|
|
2130
|
-
* [new AsaraBTevetEvent(date, desc, [mask])](#new_AsaraBTevetEvent_new)
|
|
2131
|
-
* [.urlDateSuffix()](#AsaraBTevetEvent+urlDateSuffix) ⇒ <code>string</code>
|
|
2132
|
-
|
|
2133
|
-
<a name="new_AsaraBTevetEvent_new"></a>
|
|
2134
|
-
|
|
2135
|
-
### new AsaraBTevetEvent(date, desc, [mask])
|
|
2136
|
-
Constructs AsaraBTevetEvent
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
| Param | Type | Default | Description |
|
|
2140
|
-
| --- | --- | --- | --- |
|
|
2141
|
-
| date | [<code>HDate</code>](#HDate) | | Hebrew date event occurs |
|
|
2142
|
-
| desc | <code>string</code> | | Description (not translated) |
|
|
2143
|
-
| [mask] | <code>number</code> | <code>0</code> | optional holiday flags |
|
|
2144
|
-
|
|
2145
2160
|
<a name="AsaraBTevetEvent+urlDateSuffix"></a>
|
|
2146
2161
|
|
|
2147
2162
|
### asaraBTevetEvent.urlDateSuffix() ⇒ <code>string</code>
|
|
@@ -2282,7 +2297,9 @@ Additional non-default event types can be specified:
|
|
|
2282
2297
|
* Molad announcement on Saturday before Rosh Chodesh (`options.molad`)
|
|
2283
2298
|
* Yom Kippur Katan (`options.yomKippurKatan`)
|
|
2284
2299
|
|
|
2285
|
-
Daily Study of texts
|
|
2300
|
+
Daily Study of texts are supported by the
|
|
2301
|
+
[@hebcal/learning](https://github.com/hebcal/hebcal-learning) package,
|
|
2302
|
+
for example:
|
|
2286
2303
|
* Babylonian Talmud Daf Yomi (`options.dailyLearning.dafYomi`)
|
|
2287
2304
|
* Jerusalem Talmud (Yerushalmi) Yomi (`options.dailyLearning.yerushalmi`)
|
|
2288
2305
|
* Mishna Yomi (`options.dailyLearning.mishnaYomi`)
|
|
@@ -2305,10 +2322,10 @@ option (Tzeit Hakochavim) is calculated when the sun is 8.5° below the horizon.
|
|
|
2305
2322
|
These defaults can be changed using these options:
|
|
2306
2323
|
* `options.candleLightingMins` - minutes before sundown to light candles
|
|
2307
2324
|
* `options.havdalahMins` - minutes after sundown for Havdalah (typical values are 42, 50, or 72).
|
|
2308
|
-
Havdalah times are
|
|
2325
|
+
Havdalah times are suppressed when `options.havdalahMins=0`.
|
|
2309
2326
|
* `options.havdalahDeg` - degrees for solar depression for Havdalah.
|
|
2310
|
-
Default is 8.5 degrees for 3 small stars. Use 7.083
|
|
2311
|
-
Havdalah times are
|
|
2327
|
+
Default is 8.5 degrees for 3 small stars. Use 7.083 degrees for 3 medium-sized stars.
|
|
2328
|
+
Havdalah times are suppressed when `options.havdalahDeg=0`.
|
|
2312
2329
|
|
|
2313
2330
|
If both `options.candlelighting=true` and `options.location` is specified,
|
|
2314
2331
|
Chanukah candle-lighting times and minor fast start/end times will also be generated.
|
|
@@ -2818,8 +2835,9 @@ Options to configure which events are returned
|
|
|
2818
2835
|
| end | <code>Date</code> \| [<code>HDate</code>](#HDate) \| <code>number</code> | use specific end date (requires start date) |
|
|
2819
2836
|
| candlelighting | <code>boolean</code> | calculate candle-lighting and havdalah times |
|
|
2820
2837
|
| candleLightingMins | <code>number</code> | minutes before sundown to light candles (default 18) |
|
|
2821
|
-
| havdalahMins | <code>number</code> | minutes after sundown for Havdalah (typical values are 42, 50, or 72). If `undefined` (the default), calculate Havdalah according to Tzeit Hakochavim - Nightfall (the point when 3 small stars are observable in the night time sky with the naked eye). If `0`, Havdalah times are
|
|
2822
|
-
| havdalahDeg | <code>number</code> | degrees for solar depression for Havdalah. Default is 8.5 degrees for 3 small stars. use 7.083
|
|
2838
|
+
| havdalahMins | <code>number</code> | minutes after sundown for Havdalah (typical values are 42, 50, or 72). If `undefined` (the default), calculate Havdalah according to Tzeit Hakochavim - Nightfall (the point when 3 small stars are observable in the night time sky with the naked eye). If `0`, Havdalah times are suppressed. |
|
|
2839
|
+
| havdalahDeg | <code>number</code> | degrees for solar depression for Havdalah. Default is 8.5 degrees for 3 small stars. use 7.083 degrees for 3 medium-sized stars (observed by Dr. Baruch (Berthold) Cohn in his luach published in France in 1899). If `0`, Havdalah times are suppressed. |
|
|
2840
|
+
| fastEndDeg | <code>number</code> | degrees for solar depression for end of fast days. Default is 7.083 degrees for 3 medium-sized stars. Other commonly-used values include 6.45 degrees, as calculated by Rabbi Yechiel Michel Tucazinsky. |
|
|
2823
2841
|
| sedrot | <code>boolean</code> | calculate parashah hashavua on Saturdays |
|
|
2824
2842
|
| il | <code>boolean</code> | Israeli holiday and sedra schedule |
|
|
2825
2843
|
| noMinorFast | <code>boolean</code> | suppress minor fasts |
|