@hebcal/core 4.5.1 → 5.0.0-rc1
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 +1109 -457
- package/dist/bundle.js +5124 -1331
- package/dist/bundle.min.js +2 -2
- package/dist/index.js +2216 -1525
- package/dist/index.mjs +2215 -1524
- package/hebcal.d.ts +7 -121
- package/package.json +10 -8
- package/dist/greg0.mjs +0 -159
- package/dist/hdate-bundle.js +0 -1864
- package/dist/hdate-bundle.min.js +0 -2
- package/dist/hdate.js +0 -1853
- package/dist/hdate.mjs +0 -1909
- package/dist/hdate0-bundle.js +0 -444
- package/dist/hdate0-bundle.min.js +0 -2
- package/dist/hdate0.mjs +0 -465
package/README.md
CHANGED
|
@@ -67,6 +67,26 @@ holidays. <code>@hebcal/core</code> supports four locales by default</p>
|
|
|
67
67
|
<dt><a href="#HebrewDateEvent">HebrewDateEvent</a></dt>
|
|
68
68
|
<dd><p>Daily Hebrew date ("11th of Sivan, 5780")</p>
|
|
69
69
|
</dd>
|
|
70
|
+
<dt><a href="#GeoLocation">GeoLocation</a></dt>
|
|
71
|
+
<dd><p>A class that contains location information such as latitude and longitude required for astronomical calculations. The
|
|
72
|
+
elevation field may not be used by some calculation engines and would be ignored if set. Check the documentation for
|
|
73
|
+
specific implementations of the <a href="AstronomicalCalculator">AstronomicalCalculator</a> to see if elevation is calculated as part of the
|
|
74
|
+
algorithm.</p>
|
|
75
|
+
</dd>
|
|
76
|
+
<dt><a href="#NOAACalculator">NOAACalculator</a></dt>
|
|
77
|
+
<dd><p>Implementation of sunrise and sunset methods to calculate astronomical times based on the <a
|
|
78
|
+
href="http://noaa.gov">NOAA</a> algorithm. This calculator uses the Java algorithm based on the implementation by <a
|
|
79
|
+
href="http://noaa.gov">NOAA - National Oceanic and Atmospheric Administration</a>'s <a href =
|
|
80
|
+
"http://www.srrb.noaa.gov/highlights/sunrise/sunrise.html">Surface Radiation Research Branch</a>. NOAA's <a
|
|
81
|
+
href="http://www.srrb.noaa.gov/highlights/sunrise/solareqns.PDF">implementation</a> is based on equations from <a
|
|
82
|
+
href="http://www.willbell.com/math/mc1.htm">Astronomical Algorithms</a> by <a
|
|
83
|
+
href="http://en.wikipedia.org/wiki/Jean_Meeus">Jean Meeus</a>. Added to the algorithm is an adjustment of the zenith
|
|
84
|
+
to account for elevation. The algorithm can be found in the <a
|
|
85
|
+
href="http://en.wikipedia.org/wiki/Sunrise_equation">Wikipedia Sunrise Equation</a> article.</p>
|
|
86
|
+
</dd>
|
|
87
|
+
<dt><a href="#Location">Location</a></dt>
|
|
88
|
+
<dd><p>Class representing Location</p>
|
|
89
|
+
</dd>
|
|
70
90
|
<dt><a href="#Zmanim">Zmanim</a></dt>
|
|
71
91
|
<dd><p>Calculate halachic times (zmanim / זְמַנִּים) for a given day and location.
|
|
72
92
|
Calculations are available for tzeit / tzais (nightfall),
|
|
@@ -80,9 +100,6 @@ However, due to variations in atmospheric composition, temperature, pressure and
|
|
|
80
100
|
conditions, observed values may vary from calculations.
|
|
81
101
|
<a href="https://gml.noaa.gov/grad/solcalc/calcdetails.html">https://gml.noaa.gov/grad/solcalc/calcdetails.html</a></p>
|
|
82
102
|
</dd>
|
|
83
|
-
<dt><a href="#Location">Location</a></dt>
|
|
84
|
-
<dd><p>Class representing Location</p>
|
|
85
|
-
</dd>
|
|
86
103
|
<dt><a href="#TimedEvent">TimedEvent</a></dt>
|
|
87
104
|
<dd><p>An event that has an <code>eventTime</code> and <code>eventTimeStr</code></p>
|
|
88
105
|
</dd>
|
|
@@ -132,12 +149,17 @@ Event names can be rendered in several languges using the <code>locale</code> op
|
|
|
132
149
|
</dd>
|
|
133
150
|
</dl>
|
|
134
151
|
|
|
135
|
-
##
|
|
152
|
+
## Members
|
|
136
153
|
|
|
137
154
|
<dl>
|
|
138
155
|
<dt><a href="#greg">greg</a></dt>
|
|
139
156
|
<dd><p>Gregorian date helper functions.</p>
|
|
140
157
|
</dd>
|
|
158
|
+
</dl>
|
|
159
|
+
|
|
160
|
+
## Constants
|
|
161
|
+
|
|
162
|
+
<dl>
|
|
141
163
|
<dt><a href="#parshiot">parshiot</a> : <code>Array.<string></code></dt>
|
|
142
164
|
<dd><p>The 54 parshiyot of the Torah as transilterated strings
|
|
143
165
|
parshiot[0] == 'Bereshit', parshiot[1] == 'Noach', parshiot[53] == "Ha'azinu".</p>
|
|
@@ -158,13 +180,87 @@ we omit the thousands (which is presently 5 [ה]).</p>
|
|
|
158
180
|
Ignores final Hebrew letters such as <code>ך</code> (kaf sofit) or <code>ם</code> (mem sofit)
|
|
159
181
|
and vowels (nekudot).</p>
|
|
160
182
|
</dd>
|
|
183
|
+
<dt><a href="#hebrew2abs">hebrew2abs(year, month, day)</a> ⇒ <code>number</code></dt>
|
|
184
|
+
<dd><p>Converts Hebrew date to R.D. (Rata Die) fixed days.
|
|
185
|
+
R.D. 1 is the imaginary date Monday, January 1, 1 on the Gregorian
|
|
186
|
+
Calendar.</p>
|
|
187
|
+
</dd>
|
|
188
|
+
<dt><a href="#abs2hebrew">abs2hebrew(abs)</a> ⇒ <code>SimpleHebrewDate</code></dt>
|
|
189
|
+
<dd><p>Converts absolute R.D. days to Hebrew date</p>
|
|
190
|
+
</dd>
|
|
191
|
+
<dt><a href="#isLeapYear">isLeapYear(year)</a> ⇒ <code>boolean</code></dt>
|
|
192
|
+
<dd><p>Returns true if Hebrew year is a leap year</p>
|
|
193
|
+
</dd>
|
|
194
|
+
<dt><a href="#monthsInYear">monthsInYear(year)</a> ⇒ <code>number</code></dt>
|
|
195
|
+
<dd><p>Number of months in this Hebrew year (either 12 or 13 depending on leap year)</p>
|
|
196
|
+
</dd>
|
|
197
|
+
<dt><a href="#daysInMonth">daysInMonth(month, year)</a> ⇒ <code>number</code></dt>
|
|
198
|
+
<dd><p>Number of days in Hebrew month in a given year (29 or 30)</p>
|
|
199
|
+
</dd>
|
|
200
|
+
<dt><a href="#getMonthName">getMonthName(month, year)</a></dt>
|
|
201
|
+
<dd><p>Returns a transliterated string name of Hebrew month in year,
|
|
202
|
+
for example 'Elul' or 'Cheshvan'.</p>
|
|
203
|
+
</dd>
|
|
204
|
+
<dt><a href="#elapsedDays">elapsedDays(year)</a> ⇒ <code>number</code></dt>
|
|
205
|
+
<dd><p>Days from sunday prior to start of Hebrew calendar to mean
|
|
206
|
+
conjunction of Tishrei in Hebrew YEAR</p>
|
|
207
|
+
</dd>
|
|
208
|
+
<dt><a href="#daysInYear">daysInYear(year)</a> ⇒ <code>number</code></dt>
|
|
209
|
+
<dd><p>Number of days in the hebrew YEAR.
|
|
210
|
+
A common Hebrew calendar year can have a length of 353, 354 or 355 days
|
|
211
|
+
A leap Hebrew calendar year can have a length of 383, 384 or 385 days</p>
|
|
212
|
+
</dd>
|
|
213
|
+
<dt><a href="#longCheshvan">longCheshvan(year)</a> ⇒ <code>boolean</code></dt>
|
|
214
|
+
<dd><p>true if Cheshvan is long in Hebrew year</p>
|
|
215
|
+
</dd>
|
|
216
|
+
<dt><a href="#shortKislev">shortKislev(year)</a> ⇒ <code>boolean</code></dt>
|
|
217
|
+
<dd><p>true if Kislev is short in Hebrew year</p>
|
|
218
|
+
</dd>
|
|
219
|
+
<dt><a href="#getYahrzeit">getYahrzeit(hyear, date)</a> ⇒ <code>Date</code></dt>
|
|
220
|
+
<dd><p>Calculates yahrzeit.
|
|
221
|
+
<code>hyear</code> must be after original <code>date</code> of death.
|
|
222
|
+
Returns <code>undefined</code> when requested year preceeds or is same as original year.</p>
|
|
223
|
+
<p>Hebcal uses the algorithm defined in "Calendrical Calculations"
|
|
224
|
+
by Edward M. Reingold and Nachum Dershowitz.</p>
|
|
225
|
+
<p>The customary anniversary date of a death is more complicated and depends
|
|
226
|
+
also on the character of the year in which the first anniversary occurs.
|
|
227
|
+
There are several cases:</p>
|
|
228
|
+
<ul>
|
|
229
|
+
<li>If the date of death is Marcheshvan 30, the anniversary in general depends
|
|
230
|
+
on the first anniversary; if that first anniversary was not Marcheshvan 30,
|
|
231
|
+
use the day before Kislev 1.</li>
|
|
232
|
+
<li>If the date of death is Kislev 30, the anniversary in general again depends
|
|
233
|
+
on the first anniversary — if that was not Kislev 30, use the day before
|
|
234
|
+
Tevet 1.</li>
|
|
235
|
+
<li>If the date of death is Adar II, the anniversary is the same day in the
|
|
236
|
+
last month of the Hebrew year (Adar or Adar II).</li>
|
|
237
|
+
<li>If the date of death is Adar I 30, the anniversary in a Hebrew year that
|
|
238
|
+
is not a leap year (in which Adar only has 29 days) is the last day in
|
|
239
|
+
Shevat.</li>
|
|
240
|
+
<li>In all other cases, use the normal (that is, same month number) anniversary
|
|
241
|
+
of the date of death. [Calendrical Calculations p. 113]</li>
|
|
242
|
+
</ul>
|
|
243
|
+
</dd>
|
|
244
|
+
<dt><a href="#getBirthdayOrAnniversary">getBirthdayOrAnniversary(hyear, date)</a> ⇒ <code>Date</code></dt>
|
|
245
|
+
<dd><p>Calculates a birthday or anniversary (non-yahrzeit).
|
|
246
|
+
<code>hyear</code> must be after original <code>date</code> of anniversary.
|
|
247
|
+
Returns <code>undefined</code> when requested year preceeds or is same as original year.</p>
|
|
248
|
+
<p>Hebcal uses the algorithm defined in "Calendrical Calculations"
|
|
249
|
+
by Edward M. Reingold and Nachum Dershowitz.</p>
|
|
250
|
+
<p>The birthday of someone born in Adar of an ordinary year or Adar II of
|
|
251
|
+
a leap year is also always in the last month of the year, be that Adar
|
|
252
|
+
or Adar II. The birthday in an ordinary year of someone born during the
|
|
253
|
+
first 29 days of Adar I in a leap year is on the corresponding day of Adar;
|
|
254
|
+
in a leap year, the birthday occurs in Adar I, as expected.</p>
|
|
255
|
+
<p>Someone born on the thirtieth day of Marcheshvan, Kislev, or Adar I
|
|
256
|
+
has his birthday postponed until the first of the following month in
|
|
257
|
+
years where that day does not occur. [Calendrical Calculations p. 111]</p>
|
|
258
|
+
</dd>
|
|
161
259
|
</dl>
|
|
162
260
|
|
|
163
261
|
## Typedefs
|
|
164
262
|
|
|
165
263
|
<dl>
|
|
166
|
-
<dt><a href="#ZmanimTimesResult">ZmanimTimesResult</a> : <code>Object</code></dt>
|
|
167
|
-
<dd></dd>
|
|
168
264
|
<dt><a href="#SedraResult">SedraResult</a> : <code>Object</code></dt>
|
|
169
265
|
<dd><p>Result of Sedra.lookup</p>
|
|
170
266
|
</dd>
|
|
@@ -864,7 +960,6 @@ Represents an Event with a title, date, and flags
|
|
|
864
960
|
* [.observedInIsrael()](#Event+observedInIsrael) ⇒ <code>boolean</code>
|
|
865
961
|
* [.observedInDiaspora()](#Event+observedInDiaspora) ⇒ <code>boolean</code>
|
|
866
962
|
* [.observedIn(il)](#Event+observedIn) ⇒ <code>boolean</code>
|
|
867
|
-
* ~~[.getAttrs()](#Event+getAttrs) ⇒ <code>Object</code>~~
|
|
868
963
|
* [.clone()](#Event+clone) ⇒ [<code>Event</code>](#Event)
|
|
869
964
|
* [.getCategories()](#Event+getCategories) ⇒ <code>Array.<string></code>
|
|
870
965
|
|
|
@@ -998,12 +1093,6 @@ const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);
|
|
|
998
1093
|
ev2.observedIn(false); // true
|
|
999
1094
|
ev2.observedIn(true); // true
|
|
1000
1095
|
```
|
|
1001
|
-
<a name="Event+getAttrs"></a>
|
|
1002
|
-
|
|
1003
|
-
### ~~event.getAttrs() ⇒ <code>Object</code>~~
|
|
1004
|
-
***Deprecated***
|
|
1005
|
-
|
|
1006
|
-
**Kind**: instance method of [<code>Event</code>](#Event)
|
|
1007
1096
|
<a name="Event+clone"></a>
|
|
1008
1097
|
|
|
1009
1098
|
### event.clone() ⇒ [<code>Event</code>](#Event)
|
|
@@ -1025,11 +1114,8 @@ Daily Hebrew date ("11th of Sivan, 5780")
|
|
|
1025
1114
|
|
|
1026
1115
|
* [HebrewDateEvent](#HebrewDateEvent)
|
|
1027
1116
|
* [new HebrewDateEvent(date)](#new_HebrewDateEvent_new)
|
|
1028
|
-
*
|
|
1029
|
-
|
|
1030
|
-
* [.renderBrief([locale])](#HebrewDateEvent+renderBrief) ⇒ <code>string</code>
|
|
1031
|
-
* _static_
|
|
1032
|
-
* ~~[.renderHebrew(day, monthName, fullYear)](#HebrewDateEvent.renderHebrew) ⇒ <code>string</code>~~
|
|
1117
|
+
* [.render([locale])](#HebrewDateEvent+render) ⇒ <code>string</code>
|
|
1118
|
+
* [.renderBrief([locale])](#HebrewDateEvent+renderBrief) ⇒ <code>string</code>
|
|
1033
1119
|
|
|
1034
1120
|
<a name="new_HebrewDateEvent_new"></a>
|
|
1035
1121
|
|
|
@@ -1075,365 +1161,601 @@ const ev = new HebrewDateEvent(hd);
|
|
|
1075
1161
|
console.log(ev.renderBrief()); // '15th of Cheshvan'
|
|
1076
1162
|
console.log(ev.renderBrief('he')); // 'ט״ו חֶשְׁוָן'
|
|
1077
1163
|
```
|
|
1078
|
-
<a name="
|
|
1164
|
+
<a name="GeoLocation"></a>
|
|
1079
1165
|
|
|
1080
|
-
|
|
1081
|
-
|
|
1166
|
+
## GeoLocation
|
|
1167
|
+
A class that contains location information such as latitude and longitude required for astronomical calculations. The
|
|
1168
|
+
elevation field may not be used by some calculation engines and would be ignored if set. Check the documentation for
|
|
1169
|
+
specific implementations of the [AstronomicalCalculator](AstronomicalCalculator) to see if elevation is calculated as part of the
|
|
1170
|
+
algorithm.
|
|
1082
1171
|
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
**
|
|
1172
|
+
**Kind**: global class
|
|
1173
|
+
**Version**: 1.1
|
|
1174
|
+
**Author**: © Eliyahu Hershfeld 2004 - 2016
|
|
1086
1175
|
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1176
|
+
* [GeoLocation](#GeoLocation)
|
|
1177
|
+
* [new GeoLocation(name, latitude, longitude, elevation, timeZoneId)](#new_GeoLocation_new)
|
|
1178
|
+
* [.getElevation()](#GeoLocation+getElevation) ⇒ <code>number</code>
|
|
1179
|
+
* [.setElevation(elevation)](#GeoLocation+setElevation)
|
|
1180
|
+
* [.getLatitude()](#GeoLocation+getLatitude) ⇒ <code>number</code>
|
|
1181
|
+
* [.getLongitude()](#GeoLocation+getLongitude) ⇒ <code>number</code>
|
|
1182
|
+
* [.getLocationName()](#GeoLocation+getLocationName) ⇒ <code>string</code> \| <code>null</code>
|
|
1183
|
+
* [.setLocationName(name)](#GeoLocation+setLocationName)
|
|
1184
|
+
* [.getTimeZone()](#GeoLocation+getTimeZone) ⇒ <code>string</code>
|
|
1185
|
+
* [.setTimeZone(timeZone)](#GeoLocation+setTimeZone)
|
|
1092
1186
|
|
|
1093
|
-
<a name="
|
|
1187
|
+
<a name="new_GeoLocation_new"></a>
|
|
1094
1188
|
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
Calculations are available for tzeit / tzais (nightfall),
|
|
1098
|
-
shkiah (sunset) and more.
|
|
1189
|
+
### new GeoLocation(name, latitude, longitude, elevation, timeZoneId)
|
|
1190
|
+
GeoLocation constructor with parameters for all required fields.
|
|
1099
1191
|
|
|
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
1192
|
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1193
|
+
| Param | Type | Description |
|
|
1194
|
+
| --- | --- | --- |
|
|
1195
|
+
| name | <code>string</code> | The location name for display use such as "Lakewood, NJ" |
|
|
1196
|
+
| latitude | <code>number</code> | the latitude in a double format such as 40.095965 for Lakewood, NJ. <b>Note: </b> For latitudes south of the equator, a negative value should be used. |
|
|
1197
|
+
| longitude | <code>number</code> | double the longitude in a double format such as -74.222130 for Lakewood, NJ. <b>Note: </b> For longitudes east of the <a href="http://en.wikipedia.org/wiki/Prime_Meridian">Prime Meridian </a> (Greenwich), a negative value should be used. |
|
|
1198
|
+
| elevation | <code>number</code> | the elevation above sea level in Meters. Elevation is not used in most algorithms used for calculating sunrise and set. |
|
|
1199
|
+
| timeZoneId | <code>string</code> | the <code>TimeZone</code> for the location. |
|
|
1109
1200
|
|
|
1110
|
-
|
|
1201
|
+
<a name="GeoLocation+getElevation"></a>
|
|
1111
1202
|
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
* _instance_
|
|
1115
|
-
* ~~[.suntime()](#Zmanim+suntime) ⇒ [<code>ZmanimTimesResult</code>](#ZmanimTimesResult)~~
|
|
1116
|
-
* [.timeAtAngle(angle, rising)](#Zmanim+timeAtAngle) ⇒ <code>Date</code>
|
|
1117
|
-
* [.sunrise()](#Zmanim+sunrise) ⇒ <code>Date</code>
|
|
1118
|
-
* [.sunset()](#Zmanim+sunset) ⇒ <code>Date</code>
|
|
1119
|
-
* [.dawn()](#Zmanim+dawn) ⇒ <code>Date</code>
|
|
1120
|
-
* [.dusk()](#Zmanim+dusk) ⇒ <code>Date</code>
|
|
1121
|
-
* [.hour()](#Zmanim+hour) ⇒ <code>number</code>
|
|
1122
|
-
* [.hourMins()](#Zmanim+hourMins) ⇒ <code>number</code>
|
|
1123
|
-
* [.gregEve()](#Zmanim+gregEve) ⇒ <code>Date</code>
|
|
1124
|
-
* [.nightHour()](#Zmanim+nightHour) ⇒ <code>number</code>
|
|
1125
|
-
* [.nightHourMins()](#Zmanim+nightHourMins) ⇒ <code>number</code>
|
|
1126
|
-
* [.hourOffset(hours)](#Zmanim+hourOffset) ⇒ <code>Date</code>
|
|
1127
|
-
* [.chatzot()](#Zmanim+chatzot) ⇒ <code>Date</code>
|
|
1128
|
-
* [.chatzotNight()](#Zmanim+chatzotNight) ⇒ <code>Date</code>
|
|
1129
|
-
* [.alotHaShachar()](#Zmanim+alotHaShachar) ⇒ <code>Date</code>
|
|
1130
|
-
* [.misheyakir()](#Zmanim+misheyakir) ⇒ <code>Date</code>
|
|
1131
|
-
* [.misheyakirMachmir()](#Zmanim+misheyakirMachmir) ⇒ <code>Date</code>
|
|
1132
|
-
* [.sofZmanShma()](#Zmanim+sofZmanShma) ⇒ <code>Date</code>
|
|
1133
|
-
* [.sofZmanTfilla()](#Zmanim+sofZmanTfilla) ⇒ <code>Date</code>
|
|
1134
|
-
* [.sofZmanShmaMGA()](#Zmanim+sofZmanShmaMGA) ⇒ <code>Date</code>
|
|
1135
|
-
* [.sofZmanTfillaMGA()](#Zmanim+sofZmanTfillaMGA) ⇒ <code>Date</code>
|
|
1136
|
-
* [.minchaGedola()](#Zmanim+minchaGedola) ⇒ <code>Date</code>
|
|
1137
|
-
* [.minchaKetana()](#Zmanim+minchaKetana) ⇒ <code>Date</code>
|
|
1138
|
-
* [.plagHaMincha()](#Zmanim+plagHaMincha) ⇒ <code>Date</code>
|
|
1139
|
-
* [.tzeit([angle])](#Zmanim+tzeit) ⇒ <code>Date</code>
|
|
1140
|
-
* [.neitzHaChama()](#Zmanim+neitzHaChama) ⇒ <code>Date</code>
|
|
1141
|
-
* [.shkiah()](#Zmanim+shkiah) ⇒ <code>Date</code>
|
|
1142
|
-
* [.sunriseOffset(offset, roundMinute)](#Zmanim+sunriseOffset) ⇒ <code>Date</code>
|
|
1143
|
-
* [.sunsetOffset(offset, roundMinute)](#Zmanim+sunsetOffset) ⇒ <code>Date</code>
|
|
1144
|
-
* ~~[.sunsetOffsetTime(offset, timeFormat)](#Zmanim+sunsetOffsetTime) ⇒ <code>Array.<Object></code>~~
|
|
1145
|
-
* ~~[.tzeitTime(angle, timeFormat)](#Zmanim+tzeitTime) ⇒ <code>Array.<Object></code>~~
|
|
1146
|
-
* _static_
|
|
1147
|
-
* [.formatTime(dt, timeFormat)](#Zmanim.formatTime) ⇒ <code>string</code>
|
|
1148
|
-
* [.roundTime(dt)](#Zmanim.roundTime) ⇒ <code>Date</code>
|
|
1149
|
-
* [.timeZoneOffset(tzid, date)](#Zmanim.timeZoneOffset) ⇒ <code>string</code>
|
|
1150
|
-
* [.formatISOWithTimeZone(tzid, date)](#Zmanim.formatISOWithTimeZone) ⇒ <code>string</code>
|
|
1203
|
+
### geoLocation.getElevation() ⇒ <code>number</code>
|
|
1204
|
+
Method to get the elevation in Meters.
|
|
1151
1205
|
|
|
1152
|
-
<
|
|
1206
|
+
**Kind**: instance method of [<code>GeoLocation</code>](#GeoLocation)
|
|
1207
|
+
**Returns**: <code>number</code> - Returns the elevation in Meters.
|
|
1208
|
+
<a name="GeoLocation+setElevation"></a>
|
|
1153
1209
|
|
|
1154
|
-
###
|
|
1155
|
-
|
|
1210
|
+
### geoLocation.setElevation(elevation)
|
|
1211
|
+
Method to set the elevation in Meters <b>above </b> sea level.
|
|
1156
1212
|
|
|
1213
|
+
**Kind**: instance method of [<code>GeoLocation</code>](#GeoLocation)
|
|
1157
1214
|
|
|
1158
1215
|
| Param | Type | Description |
|
|
1159
1216
|
| --- | --- | --- |
|
|
1160
|
-
|
|
|
1161
|
-
| latitude | <code>number</code> | |
|
|
1162
|
-
| longitude | <code>number</code> | |
|
|
1217
|
+
| elevation | <code>number</code> | The elevation to set in Meters. An IllegalArgumentException will be thrown if the value is a negative. |
|
|
1163
1218
|
|
|
1164
|
-
|
|
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
|
-
```
|
|
1174
|
-
<a name="Zmanim+suntime"></a>
|
|
1219
|
+
<a name="GeoLocation+getLatitude"></a>
|
|
1175
1220
|
|
|
1176
|
-
###
|
|
1177
|
-
|
|
1221
|
+
### geoLocation.getLatitude() ⇒ <code>number</code>
|
|
1222
|
+
**Kind**: instance method of [<code>GeoLocation</code>](#GeoLocation)
|
|
1223
|
+
**Returns**: <code>number</code> - Returns the latitude.
|
|
1224
|
+
<a name="GeoLocation+getLongitude"></a>
|
|
1178
1225
|
|
|
1179
|
-
|
|
1180
|
-
<
|
|
1226
|
+
### geoLocation.getLongitude() ⇒ <code>number</code>
|
|
1227
|
+
**Kind**: instance method of [<code>GeoLocation</code>](#GeoLocation)
|
|
1228
|
+
**Returns**: <code>number</code> - Returns the longitude.
|
|
1229
|
+
<a name="GeoLocation+getLocationName"></a>
|
|
1181
1230
|
|
|
1182
|
-
###
|
|
1183
|
-
|
|
1184
|
-
|
|
1231
|
+
### geoLocation.getLocationName() ⇒ <code>string</code> \| <code>null</code>
|
|
1232
|
+
**Kind**: instance method of [<code>GeoLocation</code>](#GeoLocation)
|
|
1233
|
+
**Returns**: <code>string</code> \| <code>null</code> - Returns the location name.
|
|
1234
|
+
<a name="GeoLocation+setLocationName"></a>
|
|
1185
1235
|
|
|
1186
|
-
|
|
1236
|
+
### geoLocation.setLocationName(name)
|
|
1237
|
+
**Kind**: instance method of [<code>GeoLocation</code>](#GeoLocation)
|
|
1187
1238
|
|
|
1188
|
-
| Param | Type |
|
|
1189
|
-
| --- | --- |
|
|
1190
|
-
|
|
|
1191
|
-
| rising | <code>boolean</code> |
|
|
1239
|
+
| Param | Type | Description |
|
|
1240
|
+
| --- | --- | --- |
|
|
1241
|
+
| name | <code>string</code> \| <code>null</code> | The setter method for the display name. |
|
|
1192
1242
|
|
|
1193
|
-
<a name="
|
|
1243
|
+
<a name="GeoLocation+getTimeZone"></a>
|
|
1194
1244
|
|
|
1195
|
-
###
|
|
1196
|
-
|
|
1245
|
+
### geoLocation.getTimeZone() ⇒ <code>string</code>
|
|
1246
|
+
**Kind**: instance method of [<code>GeoLocation</code>](#GeoLocation)
|
|
1247
|
+
**Returns**: <code>string</code> - Returns the timeZone.
|
|
1248
|
+
<a name="GeoLocation+setTimeZone"></a>
|
|
1197
1249
|
|
|
1198
|
-
|
|
1199
|
-
|
|
1250
|
+
### geoLocation.setTimeZone(timeZone)
|
|
1251
|
+
Method to set the TimeZone. If this is ever set after the GeoLocation is set in the
|
|
1252
|
+
[AstronomicalCalendar](AstronomicalCalendar), it is critical that
|
|
1253
|
+
[AstronomicalCalendar#getCalendar()](AstronomicalCalendar#getCalendar()).
|
|
1254
|
+
[setTimeZone(TimeZone)](java.util.Calendar#setTimeZone(TimeZone)) be called in order for the
|
|
1255
|
+
AstronomicalCalendar to output times in the expected offset. This situation will arise if the
|
|
1256
|
+
AstronomicalCalendar is ever [cloned](AstronomicalCalendar#clone()).
|
|
1200
1257
|
|
|
1201
|
-
|
|
1202
|
-
When the upper edge of the Sun disappears below the horizon (0.833° below horizon)
|
|
1258
|
+
**Kind**: instance method of [<code>GeoLocation</code>](#GeoLocation)
|
|
1203
1259
|
|
|
1204
|
-
|
|
1205
|
-
|
|
1260
|
+
| Param | Type | Description |
|
|
1261
|
+
| --- | --- | --- |
|
|
1262
|
+
| timeZone | <code>string</code> | The timeZone to set. |
|
|
1206
1263
|
|
|
1207
|
-
|
|
1208
|
-
Civil dawn; Sun is 6° below the horizon in the morning
|
|
1264
|
+
<a name="NOAACalculator"></a>
|
|
1209
1265
|
|
|
1210
|
-
|
|
1211
|
-
<a
|
|
1266
|
+
## NOAACalculator
|
|
1267
|
+
Implementation of sunrise and sunset methods to calculate astronomical times based on the <a
|
|
1268
|
+
href="http://noaa.gov">NOAA</a> algorithm. This calculator uses the Java algorithm based on the implementation by <a
|
|
1269
|
+
href="http://noaa.gov">NOAA - National Oceanic and Atmospheric Administration</a>'s <a href =
|
|
1270
|
+
"http://www.srrb.noaa.gov/highlights/sunrise/sunrise.html">Surface Radiation Research Branch</a>. NOAA's <a
|
|
1271
|
+
href="http://www.srrb.noaa.gov/highlights/sunrise/solareqns.PDF">implementation</a> is based on equations from <a
|
|
1272
|
+
href="http://www.willbell.com/math/mc1.htm">Astronomical Algorithms</a> by <a
|
|
1273
|
+
href="http://en.wikipedia.org/wiki/Jean_Meeus">Jean Meeus</a>. Added to the algorithm is an adjustment of the zenith
|
|
1274
|
+
to account for elevation. The algorithm can be found in the <a
|
|
1275
|
+
href="http://en.wikipedia.org/wiki/Sunrise_equation">Wikipedia Sunrise Equation</a> article.
|
|
1212
1276
|
|
|
1213
|
-
|
|
1214
|
-
|
|
1277
|
+
**Kind**: global class
|
|
1278
|
+
**See**: #setAstronomicalCalculator(AstronomicalCalculator) for changing the calculator class.
|
|
1279
|
+
**Author**: © Eliyahu Hershfeld 2011 - 2019
|
|
1215
1280
|
|
|
1216
|
-
|
|
1217
|
-
|
|
1281
|
+
* [NOAACalculator](#NOAACalculator)
|
|
1282
|
+
* [new NOAACalculator(geoLocation, date)](#new_NOAACalculator_new)
|
|
1283
|
+
* _instance_
|
|
1284
|
+
* [.getSunrise()](#NOAACalculator+getSunrise) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
|
|
1285
|
+
* [.getSeaLevelSunrise()](#NOAACalculator+getSeaLevelSunrise) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
|
|
1286
|
+
* [.getBeginCivilTwilight()](#NOAACalculator+getBeginCivilTwilight) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
|
|
1287
|
+
* [.getBeginNauticalTwilight()](#NOAACalculator+getBeginNauticalTwilight) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
|
|
1288
|
+
* [.getBeginAstronomicalTwilight()](#NOAACalculator+getBeginAstronomicalTwilight) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
|
|
1289
|
+
* [.getSunset()](#NOAACalculator+getSunset) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
|
|
1290
|
+
* [.getSeaLevelSunset()](#NOAACalculator+getSeaLevelSunset) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
|
|
1291
|
+
* [.getEndCivilTwilight()](#NOAACalculator+getEndCivilTwilight) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
|
|
1292
|
+
* [.getEndNauticalTwilight()](#NOAACalculator+getEndNauticalTwilight) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
|
|
1293
|
+
* [.getEndAstronomicalTwilight()](#NOAACalculator+getEndAstronomicalTwilight) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
|
|
1294
|
+
* [.getSunriseOffsetByDegrees(offsetZenith)](#NOAACalculator+getSunriseOffsetByDegrees) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
|
|
1295
|
+
* [.getSunsetOffsetByDegrees(offsetZenith)](#NOAACalculator+getSunsetOffsetByDegrees) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
|
|
1296
|
+
* [.getUTCSunrise0(zenith)](#NOAACalculator+getUTCSunrise0) ⇒ <code>number</code>
|
|
1297
|
+
* [.getUTCSeaLevelSunrise(zenith)](#NOAACalculator+getUTCSeaLevelSunrise) ⇒ <code>number</code>
|
|
1298
|
+
* [.getUTCSunset0(zenith)](#NOAACalculator+getUTCSunset0) ⇒ <code>number</code>
|
|
1299
|
+
* [.getUTCSeaLevelSunset(zenith)](#NOAACalculator+getUTCSeaLevelSunset) ⇒ <code>number</code>
|
|
1300
|
+
* [.getElevationAdjustment(elevation)](#NOAACalculator+getElevationAdjustment) ⇒ <code>number</code>
|
|
1301
|
+
* [.adjustZenith(zenith, elevation)](#NOAACalculator+adjustZenith) ⇒ <code>number</code>
|
|
1302
|
+
* [.getUTCSunrise()](#NOAACalculator+getUTCSunrise)
|
|
1303
|
+
* [.getUTCSunset()](#NOAACalculator+getUTCSunset)
|
|
1304
|
+
* [.getTemporalHour(startOfDay, endOfDay)](#NOAACalculator+getTemporalHour) ⇒ <code>number</code>
|
|
1305
|
+
* [.getSunTransit(startOfDay, endOfDay)](#NOAACalculator+getSunTransit) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
|
|
1306
|
+
* [.getDateFromTime(time, isSunrise)](#NOAACalculator+getDateFromTime) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
|
|
1307
|
+
* _static_
|
|
1308
|
+
* [.CIVIL_ZENITH](#NOAACalculator.CIVIL_ZENITH)
|
|
1309
|
+
* [.NAUTICAL_ZENITH](#NOAACalculator.NAUTICAL_ZENITH)
|
|
1310
|
+
* [.ASTRONOMICAL_ZENITH](#NOAACalculator.ASTRONOMICAL_ZENITH)
|
|
1311
|
+
* [.getTimeOffset(time, offset)](#NOAACalculator.getTimeOffset) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
|
|
1312
|
+
* [.getSolarElevation(date, lat, lon)](#NOAACalculator.getSolarElevation) ⇒ <code>number</code>
|
|
1313
|
+
* [.getSolarAzimuth(date, latitude, lon)](#NOAACalculator.getSolarAzimuth) ⇒ <code>number</code>
|
|
1314
|
+
|
|
1315
|
+
<a name="new_NOAACalculator_new"></a>
|
|
1316
|
+
|
|
1317
|
+
### new NOAACalculator(geoLocation, date)
|
|
1318
|
+
A constructor that takes in <a href="http://en.wikipedia.org/wiki/Geolocation">geolocation</a> information as a
|
|
1319
|
+
parameter. The default [AstronomicalCalculator](AstronomicalCalculator#getDefault()) used for solar
|
|
1320
|
+
calculations is the the [NOAACalculator](#NOAACalculator).
|
|
1321
|
+
|
|
1322
|
+
|
|
1323
|
+
| Param | Type | Description |
|
|
1324
|
+
| --- | --- | --- |
|
|
1325
|
+
| geoLocation | [<code>GeoLocation</code>](#GeoLocation) | The location information used for calculating astronomical sun times. |
|
|
1326
|
+
| date | <code>Temporal.PlainDate</code> | |
|
|
1327
|
+
|
|
1328
|
+
<a name="NOAACalculator+getSunrise"></a>
|
|
1329
|
+
|
|
1330
|
+
### noaaCalculator.getSunrise() ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
|
|
1331
|
+
The getSunrise method Returns a `Date` representing the
|
|
1332
|
+
[elevation adjusted](AstronomicalCalculator#getElevationAdjustment(double)) sunrise time. The zenith used
|
|
1333
|
+
for the calculation uses [geometric zenith](#GEOMETRIC_ZENITH) of 90° plus
|
|
1334
|
+
[AstronomicalCalculator#getElevationAdjustment(double)](AstronomicalCalculator#getElevationAdjustment(double)). This is adjusted by the
|
|
1335
|
+
[AstronomicalCalculator](AstronomicalCalculator) to add approximately 50/60 of a degree to account for 34 archminutes of refraction
|
|
1336
|
+
and 16 archminutes for the sun's radius for a total of [90.83333°](AstronomicalCalculator#adjustZenith).
|
|
1337
|
+
See documentation for the specific implementation of the [AstronomicalCalculator](AstronomicalCalculator) that you are using.
|
|
1338
|
+
|
|
1339
|
+
**Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
|
|
1340
|
+
**Returns**: <code>Temporal.ZonedDateTime</code> \| <code>null</code> - the `Date` representing the exact sunrise time. If the calculation can't be computed such as
|
|
1341
|
+
in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
|
|
1342
|
+
does not set, a null will be returned. See detailed explanation on top of the page.
|
|
1343
|
+
**See**
|
|
1344
|
+
|
|
1345
|
+
- AstronomicalCalculator#adjustZenith
|
|
1346
|
+
- #getSeaLevelSunrise()
|
|
1347
|
+
- AstronomicalCalendar#getUTCSunrise
|
|
1348
|
+
|
|
1349
|
+
<a name="NOAACalculator+getSeaLevelSunrise"></a>
|
|
1350
|
+
|
|
1351
|
+
### noaaCalculator.getSeaLevelSunrise() ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
|
|
1352
|
+
A method that returns the sunrise without [elevation
|
|
1353
|
+
adjustment](AstronomicalCalculator#getElevationAdjustment(double)). Non-sunrise and sunset calculations such as dawn and dusk, depend on the amount of visible light,
|
|
1354
|
+
something that is not affected by elevation. This method returns sunrise calculated at sea level. This forms the
|
|
1355
|
+
base for dawn calculations that are calculated as a dip below the horizon before sunrise.
|
|
1356
|
+
|
|
1357
|
+
**Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
|
|
1358
|
+
**Returns**: <code>Temporal.ZonedDateTime</code> \| <code>null</code> - the `Date` representing the exact sea-level sunrise time. If the calculation can't be computed
|
|
1359
|
+
such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
|
|
1360
|
+
where it does not set, a null will be returned. See detailed explanation on top of the page.
|
|
1361
|
+
**See**
|
|
1362
|
+
|
|
1363
|
+
- AstronomicalCalendar#getSunrise
|
|
1364
|
+
- AstronomicalCalendar#getUTCSeaLevelSunrise
|
|
1365
|
+
- #getSeaLevelSunset()
|
|
1366
|
+
|
|
1367
|
+
<a name="NOAACalculator+getBeginCivilTwilight"></a>
|
|
1368
|
+
|
|
1369
|
+
### noaaCalculator.getBeginCivilTwilight() ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
|
|
1370
|
+
A method that returns the beginning of civil twilight (dawn) using a zenith of [96°](#CIVIL_ZENITH).
|
|
1371
|
+
|
|
1372
|
+
**Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
|
|
1373
|
+
**Returns**: <code>Temporal.ZonedDateTime</code> \| <code>null</code> - The `Date` of the beginning of civil twilight using a zenith of 96°. If the calculation
|
|
1374
|
+
can't be computed, null will be returned. See detailed explanation on top of the page.
|
|
1375
|
+
**See**: #CIVIL_ZENITH
|
|
1376
|
+
<a name="NOAACalculator+getBeginNauticalTwilight"></a>
|
|
1377
|
+
|
|
1378
|
+
### noaaCalculator.getBeginNauticalTwilight() ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
|
|
1379
|
+
A method that returns the beginning of nautical twilight using a zenith of [102°](#NAUTICAL_ZENITH).
|
|
1380
|
+
|
|
1381
|
+
**Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
|
|
1382
|
+
**Returns**: <code>Temporal.ZonedDateTime</code> \| <code>null</code> - The `Date` of the beginning of nautical twilight using a zenith of 102°. If the
|
|
1383
|
+
calculation can't be computed null will be returned. See detailed explanation on top of the page.
|
|
1384
|
+
**See**: #NAUTICAL_ZENITH
|
|
1385
|
+
<a name="NOAACalculator+getBeginAstronomicalTwilight"></a>
|
|
1386
|
+
|
|
1387
|
+
### noaaCalculator.getBeginAstronomicalTwilight() ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
|
|
1388
|
+
A method that returns the beginning of astronomical twilight using a zenith of [108°](#ASTRONOMICAL_ZENITH).
|
|
1389
|
+
|
|
1390
|
+
**Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
|
|
1391
|
+
**Returns**: <code>Temporal.ZonedDateTime</code> \| <code>null</code> - The `Date` of the beginning of astronomical twilight using a zenith of 108°. If the
|
|
1392
|
+
calculation can't be computed, null will be returned. See detailed explanation on top of the page.
|
|
1393
|
+
**See**: #ASTRONOMICAL_ZENITH
|
|
1394
|
+
<a name="NOAACalculator+getSunset"></a>
|
|
1218
1395
|
|
|
1219
|
-
###
|
|
1220
|
-
|
|
1221
|
-
|
|
1396
|
+
### noaaCalculator.getSunset() ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
|
|
1397
|
+
The getSunset method Returns a `Date` representing the
|
|
1398
|
+
[elevation adjusted](AstronomicalCalculator#getElevationAdjustment(double)) sunset time. The zenith used for
|
|
1399
|
+
the calculation uses [geometric zenith](#GEOMETRIC_ZENITH) of 90° plus
|
|
1400
|
+
[AstronomicalCalculator#getElevationAdjustment(double)](AstronomicalCalculator#getElevationAdjustment(double)). This is adjusted by the
|
|
1401
|
+
[AstronomicalCalculator](AstronomicalCalculator) to add approximately 50/60 of a degree to account for 34 archminutes of refraction
|
|
1402
|
+
and 16 archminutes for the sun's radius for a total of [90.83333°](AstronomicalCalculator#adjustZenith).
|
|
1403
|
+
See documentation for the specific implementation of the [AstronomicalCalculator](AstronomicalCalculator) that you are using. Note:
|
|
1404
|
+
In certain cases the calculates sunset will occur before sunrise. This will typically happen when a timezone
|
|
1405
|
+
other than the local timezone is used (calculating Los Angeles sunset using a GMT timezone for example). In this
|
|
1406
|
+
case the sunset date will be incremented to the following date.
|
|
1222
1407
|
|
|
1223
|
-
|
|
1224
|
-
**
|
|
1225
|
-
|
|
1408
|
+
**Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
|
|
1409
|
+
**Returns**: <code>Temporal.ZonedDateTime</code> \| <code>null</code> - The `Date` representing the exact sunset time. If the calculation can't be computed such as in
|
|
1410
|
+
the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
|
|
1411
|
+
does not set, a null will be returned. See detailed explanation on top of the page.
|
|
1412
|
+
**See**
|
|
1226
1413
|
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1414
|
+
- AstronomicalCalculator#adjustZenith
|
|
1415
|
+
- #getSeaLevelSunset()
|
|
1416
|
+
- AstronomicalCalendar#getUTCSunset
|
|
1230
1417
|
|
|
1231
|
-
|
|
1232
|
-
**Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
|
|
1233
|
-
<a name="Zmanim+nightHourMins"></a>
|
|
1418
|
+
<a name="NOAACalculator+getSeaLevelSunset"></a>
|
|
1234
1419
|
|
|
1235
|
-
###
|
|
1236
|
-
|
|
1237
|
-
|
|
1420
|
+
### noaaCalculator.getSeaLevelSunset() ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
|
|
1421
|
+
A method that returns the sunset without [elevation
|
|
1422
|
+
adjustment](AstronomicalCalculator#getElevationAdjustment(double)). Non-sunrise and sunset calculations such as dawn and dusk, depend on the amount of visible light,
|
|
1423
|
+
something that is not affected by elevation. This method returns sunset calculated at sea level. This forms the
|
|
1424
|
+
base for dusk calculations that are calculated as a dip below the horizon after sunset.
|
|
1238
1425
|
|
|
1239
|
-
|
|
1240
|
-
**
|
|
1426
|
+
**Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
|
|
1427
|
+
**Returns**: <code>Temporal.ZonedDateTime</code> \| <code>null</code> - The `Date` representing the exact sea-level sunset time. If the calculation can't be computed
|
|
1428
|
+
such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
|
|
1429
|
+
where it does not set, a null will be returned. See detailed explanation on top of the page.
|
|
1430
|
+
**See**
|
|
1241
1431
|
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
| hours | <code>number</code> |
|
|
1432
|
+
- AstronomicalCalendar#getSunset
|
|
1433
|
+
- AstronomicalCalendar#getUTCSeaLevelSunset 2see [#getSunset()](#getSunset())
|
|
1245
1434
|
|
|
1246
|
-
<a name="
|
|
1435
|
+
<a name="NOAACalculator+getEndCivilTwilight"></a>
|
|
1247
1436
|
|
|
1248
|
-
###
|
|
1249
|
-
|
|
1437
|
+
### noaaCalculator.getEndCivilTwilight() ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
|
|
1438
|
+
A method that returns the end of civil twilight using a zenith of [96°](#CIVIL_ZENITH).
|
|
1250
1439
|
|
|
1251
|
-
**Kind**: instance method of [<code>
|
|
1252
|
-
<a
|
|
1440
|
+
**Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
|
|
1441
|
+
**Returns**: <code>Temporal.ZonedDateTime</code> \| <code>null</code> - The `Date` of the end of civil twilight using a zenith of [96°](#CIVIL_ZENITH). If
|
|
1442
|
+
the calculation can't be computed, null will be returned. See detailed explanation on top of the page.
|
|
1443
|
+
**See**: #CIVIL_ZENITH
|
|
1444
|
+
<a name="NOAACalculator+getEndNauticalTwilight"></a>
|
|
1253
1445
|
|
|
1254
|
-
###
|
|
1255
|
-
|
|
1446
|
+
### noaaCalculator.getEndNauticalTwilight() ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
|
|
1447
|
+
A method that returns the end of nautical twilight using a zenith of [102°](#NAUTICAL_ZENITH).
|
|
1256
1448
|
|
|
1257
|
-
**Kind**: instance method of [<code>
|
|
1258
|
-
<a
|
|
1449
|
+
**Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
|
|
1450
|
+
**Returns**: <code>Temporal.ZonedDateTime</code> \| <code>null</code> - The `Date` of the end of nautical twilight using a zenith of [102°](#NAUTICAL_ZENITH)
|
|
1451
|
+
. If the calculation can't be computed, null will be returned. See detailed explanation on top of the
|
|
1452
|
+
page.
|
|
1453
|
+
**See**: #NAUTICAL_ZENITH
|
|
1454
|
+
<a name="NOAACalculator+getEndAstronomicalTwilight"></a>
|
|
1259
1455
|
|
|
1260
|
-
###
|
|
1261
|
-
|
|
1456
|
+
### noaaCalculator.getEndAstronomicalTwilight() ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
|
|
1457
|
+
A method that returns the end of astronomical twilight using a zenith of [108°](#ASTRONOMICAL_ZENITH).
|
|
1262
1458
|
|
|
1263
|
-
**Kind**: instance method of [<code>
|
|
1264
|
-
<a
|
|
1459
|
+
**Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
|
|
1460
|
+
**Returns**: <code>Temporal.ZonedDateTime</code> \| <code>null</code> - The `Date` of the end of astronomical twilight using a zenith of [108°](#ASTRONOMICAL_ZENITH). If the calculation can't be computed, null will be returned. See detailed explanation on top
|
|
1461
|
+
of the page.
|
|
1462
|
+
**See**: #ASTRONOMICAL_ZENITH
|
|
1463
|
+
<a name="NOAACalculator+getSunriseOffsetByDegrees"></a>
|
|
1265
1464
|
|
|
1266
|
-
###
|
|
1267
|
-
|
|
1465
|
+
### noaaCalculator.getSunriseOffsetByDegrees(offsetZenith) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
|
|
1466
|
+
A utility method that returns the time of an offset by degrees below or above the horizon of
|
|
1467
|
+
[sunrise](#getSunrise()). Note that the degree offset is from the vertical, so for a calculation of 14°
|
|
1468
|
+
before sunrise, an offset of 14 + [#GEOMETRIC_ZENITH](#GEOMETRIC_ZENITH) = 104 would have to be passed as a parameter.
|
|
1268
1469
|
|
|
1269
|
-
**Kind**: instance method of [<code>
|
|
1270
|
-
<
|
|
1470
|
+
**Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
|
|
1471
|
+
**Returns**: <code>Temporal.ZonedDateTime</code> \| <code>null</code> - The `Date` of the offset after (or before) [#getSunrise()](#getSunrise()). If the calculation
|
|
1472
|
+
can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does
|
|
1473
|
+
not rise, and one where it does not set, a null will be returned. See detailed explanation on top of the
|
|
1474
|
+
page.
|
|
1271
1475
|
|
|
1272
|
-
|
|
1273
|
-
|
|
1476
|
+
| Param | Type | Description |
|
|
1477
|
+
| --- | --- | --- |
|
|
1478
|
+
| offsetZenith | <code>number</code> | the degrees before [#getSunrise()](#getSunrise()) to use in the calculation. For time after sunrise use negative numbers. Note that the degree offset is from the vertical, so for a calculation of 14° before sunrise, an offset of 14 + [#GEOMETRIC_ZENITH](#GEOMETRIC_ZENITH) = 104 would have to be passed as a parameter. |
|
|
1274
1479
|
|
|
1275
|
-
|
|
1276
|
-
<a name="Zmanim+sofZmanShma"></a>
|
|
1480
|
+
<a name="NOAACalculator+getSunsetOffsetByDegrees"></a>
|
|
1277
1481
|
|
|
1278
|
-
###
|
|
1279
|
-
|
|
1482
|
+
### noaaCalculator.getSunsetOffsetByDegrees(offsetZenith) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
|
|
1483
|
+
A utility method that returns the time of an offset by degrees below or above the horizon of [sunset](#getSunset()). Note that the degree offset is from the vertical, so for a calculation of 14° after sunset, an
|
|
1484
|
+
offset of 14 + [#GEOMETRIC_ZENITH](#GEOMETRIC_ZENITH) = 104 would have to be passed as a parameter.
|
|
1280
1485
|
|
|
1281
|
-
**Kind**: instance method of [<code>
|
|
1282
|
-
<
|
|
1486
|
+
**Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
|
|
1487
|
+
**Returns**: <code>Temporal.ZonedDateTime</code> \| <code>null</code> - The `Date`of the offset after (or before) [#getSunset()](#getSunset()). If the calculation can't
|
|
1488
|
+
be computed such as in the Arctic Circle where there is at least one day a year where the sun does not
|
|
1489
|
+
rise, and one where it does not set, a null will be returned. See detailed explanation on top of the
|
|
1490
|
+
page.
|
|
1283
1491
|
|
|
1284
|
-
|
|
1285
|
-
|
|
1492
|
+
| Param | Type | Description |
|
|
1493
|
+
| --- | --- | --- |
|
|
1494
|
+
| offsetZenith | <code>number</code> | the degrees after [#getSunset()](#getSunset()) to use in the calculation. For time before sunset use negative numbers. Note that the degree offset is from the vertical, so for a calculation of 14° after sunset, an offset of 14 + [#GEOMETRIC_ZENITH](#GEOMETRIC_ZENITH) = 104 would have to be passed as a parameter. |
|
|
1286
1495
|
|
|
1287
|
-
|
|
1288
|
-
<a name="Zmanim+sofZmanShmaMGA"></a>
|
|
1496
|
+
<a name="NOAACalculator+getUTCSunrise0"></a>
|
|
1289
1497
|
|
|
1290
|
-
###
|
|
1291
|
-
|
|
1498
|
+
### noaaCalculator.getUTCSunrise0(zenith) ⇒ <code>number</code>
|
|
1499
|
+
A method that returns the sunrise in UTC time without correction for time zone offset from GMT and without using
|
|
1500
|
+
daylight savings time.
|
|
1292
1501
|
|
|
1293
|
-
**Kind**: instance method of [<code>
|
|
1294
|
-
<
|
|
1502
|
+
**Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
|
|
1503
|
+
**Returns**: <code>number</code> - The time in the format: 18.75 for 18:45:00 UTC/GMT. If the calculation can't be computed such as in the
|
|
1504
|
+
Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
|
|
1505
|
+
not set, [Double#NaN](Double#NaN) will be returned. See detailed explanation on top of the page.
|
|
1295
1506
|
|
|
1296
|
-
|
|
1297
|
-
|
|
1507
|
+
| Param | Type | Description |
|
|
1508
|
+
| --- | --- | --- |
|
|
1509
|
+
| zenith | <code>number</code> | the degrees below the horizon. For time after sunrise use negative numbers. |
|
|
1298
1510
|
|
|
1299
|
-
|
|
1300
|
-
<a name="Zmanim+minchaGedola"></a>
|
|
1511
|
+
<a name="NOAACalculator+getUTCSeaLevelSunrise"></a>
|
|
1301
1512
|
|
|
1302
|
-
###
|
|
1303
|
-
|
|
1513
|
+
### noaaCalculator.getUTCSeaLevelSunrise(zenith) ⇒ <code>number</code>
|
|
1514
|
+
A method that returns the sunrise in UTC time without correction for time zone offset from GMT and without using
|
|
1515
|
+
daylight savings time. Non-sunrise and sunset calculations such as dawn and dusk, depend on the amount of visible
|
|
1516
|
+
light, something that is not affected by elevation. This method returns UTC sunrise calculated at sea level. This
|
|
1517
|
+
forms the base for dawn calculations that are calculated as a dip below the horizon before sunrise.
|
|
1304
1518
|
|
|
1305
|
-
**Kind**: instance method of [<code>
|
|
1306
|
-
<
|
|
1519
|
+
**Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
|
|
1520
|
+
**Returns**: <code>number</code> - The time in the format: 18.75 for 18:45:00 UTC/GMT. If the calculation can't be computed such as in the
|
|
1521
|
+
Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
|
|
1522
|
+
not set, [Double#NaN](Double#NaN) will be returned. See detailed explanation on top of the page.
|
|
1523
|
+
**See**
|
|
1307
1524
|
|
|
1308
|
-
|
|
1309
|
-
|
|
1525
|
+
- AstronomicalCalendar#getUTCSunrise
|
|
1526
|
+
- AstronomicalCalendar#getUTCSeaLevelSunset
|
|
1310
1527
|
|
|
1311
|
-
**Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
|
|
1312
|
-
<a name="Zmanim+plagHaMincha"></a>
|
|
1313
1528
|
|
|
1314
|
-
|
|
1315
|
-
|
|
1529
|
+
| Param | Type | Description |
|
|
1530
|
+
| --- | --- | --- |
|
|
1531
|
+
| zenith | <code>number</code> | the degrees below the horizon. For time after sunrise use negative numbers. |
|
|
1316
1532
|
|
|
1317
|
-
|
|
1318
|
-
<a name="Zmanim+tzeit"></a>
|
|
1533
|
+
<a name="NOAACalculator+getUTCSunset0"></a>
|
|
1319
1534
|
|
|
1320
|
-
###
|
|
1321
|
-
|
|
1535
|
+
### noaaCalculator.getUTCSunset0(zenith) ⇒ <code>number</code>
|
|
1536
|
+
A method that returns the sunset in UTC time without correction for time zone offset from GMT and without using
|
|
1537
|
+
daylight savings time.
|
|
1322
1538
|
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1539
|
+
**Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
|
|
1540
|
+
**Returns**: <code>number</code> - The time in the format: 18.75 for 18:45:00 UTC/GMT. If the calculation can't be computed such as in the
|
|
1541
|
+
Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
|
|
1542
|
+
not set, [Double#NaN](Double#NaN) will be returned. See detailed explanation on top of the page.
|
|
1543
|
+
**See**: AstronomicalCalendar#getUTCSeaLevelSunset
|
|
1326
1544
|
|
|
1327
|
-
|
|
1545
|
+
| Param | Type | Description |
|
|
1546
|
+
| --- | --- | --- |
|
|
1547
|
+
| zenith | <code>number</code> | the degrees below the horizon. For time after sunset use negative numbers. |
|
|
1328
1548
|
|
|
1329
|
-
|
|
1330
|
-
Alias for sunrise
|
|
1549
|
+
<a name="NOAACalculator+getUTCSeaLevelSunset"></a>
|
|
1331
1550
|
|
|
1332
|
-
|
|
1333
|
-
|
|
1551
|
+
### noaaCalculator.getUTCSeaLevelSunset(zenith) ⇒ <code>number</code>
|
|
1552
|
+
A method that returns the sunset in UTC time without correction for elevation, time zone offset from GMT and
|
|
1553
|
+
without using daylight savings time. Non-sunrise and sunset calculations such as dawn and dusk, depend on the
|
|
1554
|
+
amount of visible light, something that is not affected by elevation. This method returns UTC sunset calculated
|
|
1555
|
+
at sea level. This forms the base for dusk calculations that are calculated as a dip below the horizon after
|
|
1556
|
+
sunset.
|
|
1334
1557
|
|
|
1335
|
-
|
|
1336
|
-
|
|
1558
|
+
**Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
|
|
1559
|
+
**Returns**: <code>number</code> - The time in the format: 18.75 for 18:45:00 UTC/GMT. If the calculation can't be computed such as in the
|
|
1560
|
+
Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
|
|
1561
|
+
not set, [Double#NaN](Double#NaN) will be returned. See detailed explanation on top of the page.
|
|
1562
|
+
**See**
|
|
1337
1563
|
|
|
1338
|
-
|
|
1339
|
-
|
|
1564
|
+
- AstronomicalCalendar#getUTCSunset
|
|
1565
|
+
- AstronomicalCalendar#getUTCSeaLevelSunrise
|
|
1340
1566
|
|
|
1341
|
-
### zmanim.sunriseOffset(offset, roundMinute) ⇒ <code>Date</code>
|
|
1342
|
-
Returns sunrise + `offset` minutes (either positive or negative).
|
|
1343
1567
|
|
|
1344
|
-
|
|
1568
|
+
| Param | Type | Description |
|
|
1569
|
+
| --- | --- | --- |
|
|
1570
|
+
| zenith | <code>number</code> | the degrees below the horizon. For time before sunset use negative numbers. |
|
|
1345
1571
|
|
|
1346
|
-
|
|
1347
|
-
| --- | --- | --- | --- |
|
|
1348
|
-
| offset | <code>number</code> | | minutes |
|
|
1349
|
-
| roundMinute | <code>boolean</code> | <code>true</code> | round time to nearest minute (default true) |
|
|
1572
|
+
<a name="NOAACalculator+getElevationAdjustment"></a>
|
|
1350
1573
|
|
|
1351
|
-
<
|
|
1574
|
+
### noaaCalculator.getElevationAdjustment(elevation) ⇒ <code>number</code>
|
|
1575
|
+
Method to return the adjustment to the zenith required to account for the elevation. Since a person at a higher
|
|
1576
|
+
elevation can see farther below the horizon, the calculation for sunrise / sunset is calculated below the horizon
|
|
1577
|
+
used at sea level. This is only used for sunrise and sunset and not times before or after it such as
|
|
1578
|
+
[nautical twilight](AstronomicalCalendar#getBeginNauticalTwilight()) since those
|
|
1579
|
+
calculations are based on the level of available light at the given dip below the horizon, something that is not
|
|
1580
|
+
affected by elevation, the adjustment should only made if the zenith == 90° [adjusted](#adjustZenith)
|
|
1581
|
+
for refraction and solar radius. The algorithm used is
|
|
1352
1582
|
|
|
1353
|
-
|
|
1354
|
-
|
|
1583
|
+
<pre>
|
|
1584
|
+
elevationAdjustment = Math.toDegrees(Math.acos(earthRadiusInMeters / (earthRadiusInMeters + elevationMeters)));
|
|
1585
|
+
</pre>
|
|
1355
1586
|
|
|
1356
|
-
|
|
1587
|
+
The source of this algorithm is <a href="http://www.calendarists.com">Calendrical Calculations</a> by Edward M.
|
|
1588
|
+
Reingold and Nachum Dershowitz. An alternate algorithm that produces an almost identical (but not accurate)
|
|
1589
|
+
result found in Ma'aglay Tzedek by Moishe Kosower and other sources is:
|
|
1357
1590
|
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
| roundMinute | <code>boolean</code> | <code>true</code> | round time to nearest minute (default true) |
|
|
1591
|
+
<pre>
|
|
1592
|
+
elevationAdjustment = 0.0347 * Math.sqrt(elevationMeters);
|
|
1593
|
+
</pre>
|
|
1362
1594
|
|
|
1363
|
-
<
|
|
1595
|
+
**Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
|
|
1596
|
+
**Returns**: <code>number</code> - the adjusted zenith
|
|
1364
1597
|
|
|
1365
|
-
|
|
1366
|
-
|
|
1598
|
+
| Param | Type | Description |
|
|
1599
|
+
| --- | --- | --- |
|
|
1600
|
+
| elevation | <code>number</code> | elevation in Meters. |
|
|
1367
1601
|
|
|
1368
|
-
|
|
1602
|
+
<a name="NOAACalculator+adjustZenith"></a>
|
|
1369
1603
|
|
|
1370
|
-
|
|
1604
|
+
### noaaCalculator.adjustZenith(zenith, elevation) ⇒ <code>number</code>
|
|
1605
|
+
Adjusts the zenith of astronomical sunrise and sunset to account for solar refraction, solar radius and
|
|
1606
|
+
elevation. The value for Sun's zenith and true rise/set Zenith (used in this class and subclasses) is the angle
|
|
1607
|
+
that the center of the Sun makes to a line perpendicular to the Earth's surface. If the Sun were a point and the
|
|
1608
|
+
Earth were without an atmosphere, true sunset and sunrise would correspond to a 90° zenith. Because the Sun
|
|
1609
|
+
is not a point, and because the atmosphere refracts light, this 90° zenith does not, in fact, correspond to
|
|
1610
|
+
true sunset or sunrise, instead the centre of the Sun's disk must lie just below the horizon for the upper edge
|
|
1611
|
+
to be obscured. This means that a zenith of just above 90° must be used. The Sun subtends an angle of 16
|
|
1612
|
+
minutes of arc (this can be changed via the [#setSolarRadius(double)](#setSolarRadius(double)) method , and atmospheric refraction
|
|
1613
|
+
accounts for 34 minutes or so (this can be changed via the [#setRefraction(double)](#setRefraction(double)) method), giving a total
|
|
1614
|
+
of 50 arcminutes. The total value for ZENITH is 90+(5/6) or 90.8333333° for true sunrise/sunset. Since a
|
|
1615
|
+
person at an elevation can see blow the horizon of a person at sea level, this will also adjust the zenith to
|
|
1616
|
+
account for elevation if available. Note that this will only adjust the value if the zenith is exactly 90 degrees.
|
|
1617
|
+
For values below and above this no correction is done. As an example, astronomical twilight is when the sun is
|
|
1618
|
+
18° below the horizon or [108°
|
|
1619
|
+
below the zenith](AstronomicalCalendar#ASTRONOMICAL_ZENITH). This is traditionally calculated with none of the above mentioned adjustments. The same goes
|
|
1620
|
+
for various <em>tzais</em> and <em>alos</em> times such as the
|
|
1621
|
+
[16.1°](ZmanimCalendar#ZENITH_16_POINT_1) dip used in
|
|
1622
|
+
[ComplexZmanimCalendar#getAlos16Point1Degrees()](ComplexZmanimCalendar#getAlos16Point1Degrees()).
|
|
1371
1623
|
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1624
|
+
**Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
|
|
1625
|
+
**Returns**: <code>number</code> - The zenith adjusted to include the [sun's radius](#getSolarRadius), [refraction](#getRefraction) and [elevation](#getElevationAdjustment) adjustment. This will only be adjusted for
|
|
1626
|
+
sunrise and sunset (if the zenith == 90°)
|
|
1627
|
+
**See**: #getElevationAdjustment(double)
|
|
1628
|
+
|
|
1629
|
+
| Param | Type | Description |
|
|
1630
|
+
| --- | --- | --- |
|
|
1631
|
+
| zenith | <code>number</code> | the azimuth below the vertical zenith of 90°. For sunset typically the [zenith](#adjustZenith) used for the calculation uses geometric zenith of 90° and [adjusts](#adjustZenith) this slightly to account for solar refraction and the sun's radius. Another example would be [AstronomicalCalendar#getEndNauticalTwilight()](AstronomicalCalendar#getEndNauticalTwilight()) that passes [AstronomicalCalendar#NAUTICAL_ZENITH](AstronomicalCalendar#NAUTICAL_ZENITH) to this method. |
|
|
1632
|
+
| elevation | <code>number</code> | elevation in Meters. |
|
|
1376
1633
|
|
|
1377
|
-
<a name="
|
|
1634
|
+
<a name="NOAACalculator+getUTCSunrise"></a>
|
|
1378
1635
|
|
|
1379
|
-
###
|
|
1380
|
-
|
|
1636
|
+
### noaaCalculator.getUTCSunrise()
|
|
1637
|
+
**Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
|
|
1638
|
+
**See**: AstronomicalCalculator#getUTCSunrise(Calendar, GeoLocation, double, boolean)
|
|
1639
|
+
<a name="NOAACalculator+getUTCSunset"></a>
|
|
1381
1640
|
|
|
1382
|
-
|
|
1641
|
+
### noaaCalculator.getUTCSunset()
|
|
1642
|
+
**Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
|
|
1643
|
+
**See**: AstronomicalCalculator#getUTCSunset(Calendar, GeoLocation, double, boolean)
|
|
1644
|
+
<a name="NOAACalculator+getTemporalHour"></a>
|
|
1383
1645
|
|
|
1384
|
-
|
|
1646
|
+
### noaaCalculator.getTemporalHour(startOfDay, endOfDay) ⇒ <code>number</code>
|
|
1647
|
+
A utility method that will allow the calculation of a temporal (solar) hour based on the sunrise and sunset
|
|
1648
|
+
passed as parameters to this method. An example of the use of this method would be the calculation of a
|
|
1649
|
+
non-elevation adjusted temporal hour by passing in [sea level sunrise](#getSeaLevelSunrise()) and
|
|
1650
|
+
[sea level sunset](#getSeaLevelSunset()) as parameters.
|
|
1651
|
+
|
|
1652
|
+
**Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
|
|
1653
|
+
**Returns**: <code>number</code> - the <code>long</code> millisecond length of the temporal hour. If the calculation can't be computed a
|
|
1654
|
+
[Long#MIN_VALUE](Long#MIN_VALUE) will be returned. See detailed explanation on top of the page.
|
|
1655
|
+
**See**: #getTemporalHour()
|
|
1385
1656
|
|
|
1386
1657
|
| Param | Type | Description |
|
|
1387
1658
|
| --- | --- | --- |
|
|
1388
|
-
|
|
|
1389
|
-
|
|
|
1659
|
+
| startOfDay | <code>Temporal.ZonedDateTime</code> \| <code>null</code> | The start of the day. |
|
|
1660
|
+
| endOfDay | <code>Temporal.ZonedDateTime</code> \| <code>null</code> | The end of the day. |
|
|
1390
1661
|
|
|
1391
|
-
<a name="
|
|
1662
|
+
<a name="NOAACalculator+getSunTransit"></a>
|
|
1392
1663
|
|
|
1393
|
-
###
|
|
1394
|
-
|
|
1664
|
+
### noaaCalculator.getSunTransit(startOfDay, endOfDay) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
|
|
1665
|
+
A method that returns sundial or solar noon. It occurs when the Sun is <a href
|
|
1666
|
+
="http://en.wikipedia.org/wiki/Transit_%28astronomy%29">transiting</a> the <a
|
|
1667
|
+
href="http://en.wikipedia.org/wiki/Meridian_%28astronomy%29">celestial meridian</a>. In this class it is
|
|
1668
|
+
calculated as halfway between the sunrise and sunset passed to this method. This time can be slightly off the
|
|
1669
|
+
real transit time due to changes in declination (the lengthening or shortening day).
|
|
1395
1670
|
|
|
1396
|
-
**Kind**:
|
|
1671
|
+
**Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
|
|
1672
|
+
**Returns**: <code>Temporal.ZonedDateTime</code> \| <code>null</code> - The `Date` representing Sun's transit. If the calculation can't be computed such as in the
|
|
1673
|
+
Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
|
|
1674
|
+
not set, null will be returned. See detailed explanation on top of the page.
|
|
1397
1675
|
|
|
1398
|
-
| Param | Type |
|
|
1399
|
-
| --- | --- |
|
|
1400
|
-
|
|
|
1401
|
-
|
|
|
1676
|
+
| Param | Type | Description |
|
|
1677
|
+
| --- | --- | --- |
|
|
1678
|
+
| startOfDay | <code>Temporal.ZonedDateTime</code> \| <code>null</code> | the start of day for calculating the sun's transit. This can be sea level sunrise, visual sunrise (or any arbitrary start of day) passed to this method. |
|
|
1679
|
+
| endOfDay | <code>Temporal.ZonedDateTime</code> \| <code>null</code> | the end of day for calculating the sun's transit. This can be sea level sunset, visual sunset (or any arbitrary end of day) passed to this method. |
|
|
1402
1680
|
|
|
1403
|
-
<a name="
|
|
1681
|
+
<a name="NOAACalculator+getDateFromTime"></a>
|
|
1404
1682
|
|
|
1405
|
-
###
|
|
1406
|
-
|
|
1683
|
+
### noaaCalculator.getDateFromTime(time, isSunrise) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
|
|
1684
|
+
A method that returns a `Date` from the time passed in as a parameter.
|
|
1407
1685
|
|
|
1408
|
-
**Kind**:
|
|
1686
|
+
**Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
|
|
1687
|
+
**Returns**: <code>Temporal.ZonedDateTime</code> \| <code>null</code> - The Date.
|
|
1688
|
+
**Access**: protected
|
|
1409
1689
|
|
|
1410
|
-
| Param | Type |
|
|
1411
|
-
| --- | --- |
|
|
1412
|
-
|
|
|
1690
|
+
| Param | Type | Description |
|
|
1691
|
+
| --- | --- | --- |
|
|
1692
|
+
| time | <code>number</code> | The time to be set as the time for the `Date`. The time expected is in the format: 18.75 for 6:45:00 PM. |
|
|
1693
|
+
| isSunrise | <code>boolean</code> | true if the time is sunrise, and false if it is sunset |
|
|
1413
1694
|
|
|
1414
|
-
<a name="
|
|
1695
|
+
<a name="NOAACalculator.CIVIL_ZENITH"></a>
|
|
1415
1696
|
|
|
1416
|
-
###
|
|
1417
|
-
|
|
1697
|
+
### NOAACalculator.CIVIL\_ZENITH
|
|
1698
|
+
Sun's zenith at civil twilight (96°).
|
|
1418
1699
|
|
|
1419
|
-
**Kind**: static
|
|
1700
|
+
**Kind**: static property of [<code>NOAACalculator</code>](#NOAACalculator)
|
|
1701
|
+
<a name="NOAACalculator.NAUTICAL_ZENITH"></a>
|
|
1420
1702
|
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
| tzid | <code>string</code> |
|
|
1424
|
-
| date | <code>Date</code> |
|
|
1703
|
+
### NOAACalculator.NAUTICAL\_ZENITH
|
|
1704
|
+
Sun's zenith at nautical twilight (102°).
|
|
1425
1705
|
|
|
1426
|
-
<
|
|
1706
|
+
**Kind**: static property of [<code>NOAACalculator</code>](#NOAACalculator)
|
|
1707
|
+
<a name="NOAACalculator.ASTRONOMICAL_ZENITH"></a>
|
|
1427
1708
|
|
|
1428
|
-
###
|
|
1429
|
-
|
|
1709
|
+
### NOAACalculator.ASTRONOMICAL\_ZENITH
|
|
1710
|
+
Sun's zenith at astronomical twilight (108°).
|
|
1430
1711
|
|
|
1431
|
-
**Kind**: static
|
|
1712
|
+
**Kind**: static property of [<code>NOAACalculator</code>](#NOAACalculator)
|
|
1713
|
+
<a name="NOAACalculator.getTimeOffset"></a>
|
|
1432
1714
|
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1715
|
+
### NOAACalculator.getTimeOffset(time, offset) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
|
|
1716
|
+
A utility method that returns a date offset by the offset time passed in. Please note that the level of light
|
|
1717
|
+
during twilight is not affected by elevation, so if this is being used to calculate an offset before sunrise or
|
|
1718
|
+
after sunset with the intent of getting a rough "level of light" calculation, the sunrise or sunset time passed
|
|
1719
|
+
to this method should be sea level sunrise and sunset.
|
|
1720
|
+
|
|
1721
|
+
**Kind**: static method of [<code>NOAACalculator</code>](#NOAACalculator)
|
|
1722
|
+
**Returns**: <code>Temporal.ZonedDateTime</code> \| <code>null</code> - the `Date` with the offset in milliseconds added to it
|
|
1723
|
+
|
|
1724
|
+
| Param | Type | Description |
|
|
1725
|
+
| --- | --- | --- |
|
|
1726
|
+
| time | <code>Temporal.ZonedDateTime</code> \| <code>null</code> | the start time |
|
|
1727
|
+
| offset | <code>number</code> | the offset in milliseconds to add to the time. |
|
|
1728
|
+
|
|
1729
|
+
<a name="NOAACalculator.getSolarElevation"></a>
|
|
1730
|
+
|
|
1731
|
+
### NOAACalculator.getSolarElevation(date, lat, lon) ⇒ <code>number</code>
|
|
1732
|
+
Return the <a href="http://en.wikipedia.org/wiki/Celestial_coordinate_system">Solar Elevation</a> for the
|
|
1733
|
+
horizontal coordinate system at the given location at the given time. Can be negative if the sun is below the
|
|
1734
|
+
horizon. Not corrected for altitude.
|
|
1735
|
+
|
|
1736
|
+
**Kind**: static method of [<code>NOAACalculator</code>](#NOAACalculator)
|
|
1737
|
+
**Returns**: <code>number</code> - solar elevation in degrees - horizon is 0 degrees, civil twilight is -6 degrees
|
|
1738
|
+
|
|
1739
|
+
| Param | Type | Description |
|
|
1740
|
+
| --- | --- | --- |
|
|
1741
|
+
| date | <code>Temporal.ZonedDateTime</code> | time of calculation |
|
|
1742
|
+
| lat | <code>number</code> | latitude of location for calculation |
|
|
1743
|
+
| lon | <code>number</code> | longitude of location for calculation |
|
|
1744
|
+
|
|
1745
|
+
<a name="NOAACalculator.getSolarAzimuth"></a>
|
|
1746
|
+
|
|
1747
|
+
### NOAACalculator.getSolarAzimuth(date, latitude, lon) ⇒ <code>number</code>
|
|
1748
|
+
Return the <a href="http://en.wikipedia.org/wiki/Celestial_coordinate_system">Solar Azimuth</a> for the
|
|
1749
|
+
horizontal coordinate system at the given location at the given time. Not corrected for altitude. True south is 0
|
|
1750
|
+
degrees.
|
|
1751
|
+
|
|
1752
|
+
**Kind**: static method of [<code>NOAACalculator</code>](#NOAACalculator)
|
|
1753
|
+
|
|
1754
|
+
| Param | Type | Description |
|
|
1755
|
+
| --- | --- | --- |
|
|
1756
|
+
| date | <code>Temporal.ZonedDateTime</code> | time of calculation |
|
|
1757
|
+
| latitude | <code>number</code> | latitude of location for calculation |
|
|
1758
|
+
| lon | <code>number</code> | longitude of location for calculation |
|
|
1437
1759
|
|
|
1438
1760
|
<a name="Location"></a>
|
|
1439
1761
|
|
|
@@ -1443,10 +1765,8 @@ Class representing Location
|
|
|
1443
1765
|
**Kind**: global class
|
|
1444
1766
|
|
|
1445
1767
|
* [Location](#Location)
|
|
1446
|
-
* [new Location(latitude, longitude, il, tzid, cityName, countryCode, geoid)](#new_Location_new)
|
|
1768
|
+
* [new Location(latitude, longitude, il, tzid, cityName, countryCode, [geoid], [elevation])](#new_Location_new)
|
|
1447
1769
|
* _instance_
|
|
1448
|
-
* [.getLatitude()](#Location+getLatitude) ⇒ <code>number</code>
|
|
1449
|
-
* [.getLongitude()](#Location+getLongitude) ⇒ <code>number</code>
|
|
1450
1770
|
* [.getIsrael()](#Location+getIsrael) ⇒ <code>boolean</code>
|
|
1451
1771
|
* [.getName()](#Location+getName) ⇒ <code>string</code>
|
|
1452
1772
|
* [.getShortName()](#Location+getShortName) ⇒ <code>string</code>
|
|
@@ -1454,19 +1774,16 @@ Class representing Location
|
|
|
1454
1774
|
* [.getTzid()](#Location+getTzid) ⇒ <code>string</code>
|
|
1455
1775
|
* [.getTimeFormatter()](#Location+getTimeFormatter) ⇒ <code>Intl.DateTimeFormat</code>
|
|
1456
1776
|
* [.getGeoId()](#Location+getGeoId) ⇒ <code>string</code>
|
|
1457
|
-
* ~~[.sunset(hdate)](#Location+sunset) ⇒ <code>Date</code>~~
|
|
1458
|
-
* ~~[.tzeit(hdate, [angle])](#Location+tzeit) ⇒ <code>Date</code>~~
|
|
1459
1777
|
* [.toString()](#Location+toString) ⇒ <code>string</code>
|
|
1460
1778
|
* _static_
|
|
1461
1779
|
* [.lookup(name)](#Location.lookup) ⇒ [<code>Location</code>](#Location)
|
|
1462
1780
|
* [.legacyTzToTzid(tz, dst)](#Location.legacyTzToTzid) ⇒ <code>string</code>
|
|
1463
1781
|
* [.getUsaTzid(state, tz, dst)](#Location.getUsaTzid) ⇒ <code>string</code>
|
|
1464
|
-
* ~~[.geonameCityDescr(cityName, admin1, countryName)](#Location.geonameCityDescr) ⇒ <code>string</code>~~
|
|
1465
1782
|
* [.addLocation(cityName, location)](#Location.addLocation) ⇒ <code>boolean</code>
|
|
1466
1783
|
|
|
1467
1784
|
<a name="new_Location_new"></a>
|
|
1468
1785
|
|
|
1469
|
-
### new Location(latitude, longitude, il, tzid, cityName, countryCode, geoid)
|
|
1786
|
+
### new Location(latitude, longitude, il, tzid, cityName, countryCode, [geoid], [elevation])
|
|
1470
1787
|
Initialize a Location instance
|
|
1471
1788
|
|
|
1472
1789
|
|
|
@@ -1478,16 +1795,9 @@ Initialize a Location instance
|
|
|
1478
1795
|
| tzid | <code>string</code> | Olson timezone ID, e.g. "America/Chicago" |
|
|
1479
1796
|
| cityName | <code>string</code> | optional descriptive city name |
|
|
1480
1797
|
| countryCode | <code>string</code> | ISO 3166 alpha-2 country code (e.g. "FR") |
|
|
1481
|
-
| geoid | <code>string</code> | optional string or numeric geographic ID |
|
|
1482
|
-
|
|
1483
|
-
<a name="Location+getLatitude"></a>
|
|
1484
|
-
|
|
1485
|
-
### location.getLatitude() ⇒ <code>number</code>
|
|
1486
|
-
**Kind**: instance method of [<code>Location</code>](#Location)
|
|
1487
|
-
<a name="Location+getLongitude"></a>
|
|
1798
|
+
| [geoid] | <code>string</code> | optional string or numeric geographic ID |
|
|
1799
|
+
| [elevation] | <code>number</code> | in meters (default `0`) |
|
|
1488
1800
|
|
|
1489
|
-
### location.getLongitude() ⇒ <code>number</code>
|
|
1490
|
-
**Kind**: instance method of [<code>Location</code>](#Location)
|
|
1491
1801
|
<a name="Location+getIsrael"></a>
|
|
1492
1802
|
|
|
1493
1803
|
### location.getIsrael() ⇒ <code>boolean</code>
|
|
@@ -1520,29 +1830,6 @@ Gets a 24-hour time formatter (e.g. 07:41 or 20:03) for this location
|
|
|
1520
1830
|
|
|
1521
1831
|
### location.getGeoId() ⇒ <code>string</code>
|
|
1522
1832
|
**Kind**: instance method of [<code>Location</code>](#Location)
|
|
1523
|
-
<a name="Location+sunset"></a>
|
|
1524
|
-
|
|
1525
|
-
### ~~location.sunset(hdate) ⇒ <code>Date</code>~~
|
|
1526
|
-
***Deprecated***
|
|
1527
|
-
|
|
1528
|
-
**Kind**: instance method of [<code>Location</code>](#Location)
|
|
1529
|
-
|
|
1530
|
-
| Param | Type |
|
|
1531
|
-
| --- | --- |
|
|
1532
|
-
| hdate | <code>Date</code> \| [<code>HDate</code>](#HDate) |
|
|
1533
|
-
|
|
1534
|
-
<a name="Location+tzeit"></a>
|
|
1535
|
-
|
|
1536
|
-
### ~~location.tzeit(hdate, [angle]) ⇒ <code>Date</code>~~
|
|
1537
|
-
***Deprecated***
|
|
1538
|
-
|
|
1539
|
-
**Kind**: instance method of [<code>Location</code>](#Location)
|
|
1540
|
-
|
|
1541
|
-
| Param | Type |
|
|
1542
|
-
| --- | --- |
|
|
1543
|
-
| hdate | <code>Date</code> \| [<code>HDate</code>](#HDate) |
|
|
1544
|
-
| [angle] | <code>number</code> |
|
|
1545
|
-
|
|
1546
1833
|
<a name="Location+toString"></a>
|
|
1547
1834
|
|
|
1548
1835
|
### location.toString() ⇒ <code>string</code>
|
|
@@ -1574,61 +1861,339 @@ The following city names are supported:
|
|
|
1574
1861
|
|
|
1575
1862
|
<a name="Location.legacyTzToTzid"></a>
|
|
1576
1863
|
|
|
1577
|
-
### Location.legacyTzToTzid(tz, dst) ⇒ <code>string</code>
|
|
1578
|
-
Converts legacy Hebcal timezone to a standard Olson tzid.
|
|
1864
|
+
### Location.legacyTzToTzid(tz, dst) ⇒ <code>string</code>
|
|
1865
|
+
Converts legacy Hebcal timezone to a standard Olson tzid.
|
|
1866
|
+
|
|
1867
|
+
**Kind**: static method of [<code>Location</code>](#Location)
|
|
1868
|
+
|
|
1869
|
+
| Param | Type | Description |
|
|
1870
|
+
| --- | --- | --- |
|
|
1871
|
+
| tz | <code>number</code> | integer, GMT offset in hours |
|
|
1872
|
+
| dst | <code>string</code> | 'none', 'eu', 'usa', or 'israel' |
|
|
1873
|
+
|
|
1874
|
+
<a name="Location.getUsaTzid"></a>
|
|
1875
|
+
|
|
1876
|
+
### Location.getUsaTzid(state, tz, dst) ⇒ <code>string</code>
|
|
1877
|
+
Converts timezone info from Zip-Codes.com to a standard Olson tzid.
|
|
1878
|
+
|
|
1879
|
+
**Kind**: static method of [<code>Location</code>](#Location)
|
|
1880
|
+
|
|
1881
|
+
| Param | Type | Description |
|
|
1882
|
+
| --- | --- | --- |
|
|
1883
|
+
| state | <code>string</code> | two-letter all-caps US state abbreviation like 'CA' |
|
|
1884
|
+
| tz | <code>number</code> | positive number, 5=America/New_York, 8=America/Los_Angeles |
|
|
1885
|
+
| dst | <code>string</code> | single char 'Y' or 'N' |
|
|
1886
|
+
|
|
1887
|
+
**Example**
|
|
1888
|
+
```js
|
|
1889
|
+
Location.getUsaTzid('AZ', 7, 'Y') // 'America/Denver'
|
|
1890
|
+
```
|
|
1891
|
+
<a name="Location.addLocation"></a>
|
|
1892
|
+
|
|
1893
|
+
### Location.addLocation(cityName, location) ⇒ <code>boolean</code>
|
|
1894
|
+
Adds a location name for `Location.lookup()` only if the name isn't
|
|
1895
|
+
already being used. Returns `false` if the name is already taken
|
|
1896
|
+
and `true` if successfully added.
|
|
1897
|
+
|
|
1898
|
+
**Kind**: static method of [<code>Location</code>](#Location)
|
|
1899
|
+
|
|
1900
|
+
| Param | Type |
|
|
1901
|
+
| --- | --- |
|
|
1902
|
+
| cityName | <code>string</code> |
|
|
1903
|
+
| location | [<code>Location</code>](#Location) |
|
|
1904
|
+
|
|
1905
|
+
<a name="Zmanim"></a>
|
|
1906
|
+
|
|
1907
|
+
## Zmanim
|
|
1908
|
+
Calculate halachic times (zmanim / זְמַנִּים) for a given day and location.
|
|
1909
|
+
Calculations are available for tzeit / tzais (nightfall),
|
|
1910
|
+
shkiah (sunset) and more.
|
|
1911
|
+
|
|
1912
|
+
Zmanim are estimated using an algorithm published by the US National Oceanic
|
|
1913
|
+
and Atmospheric Administration. The NOAA solar calculator is based on equations
|
|
1914
|
+
from _Astronomical Algorithms_ by Jean Meeus.
|
|
1915
|
+
|
|
1916
|
+
The sunrise and sunset results are theoretically accurate to within a minute for
|
|
1917
|
+
locations between +/- 72° latitude, and within 10 minutes outside of those latitudes.
|
|
1918
|
+
However, due to variations in atmospheric composition, temperature, pressure and
|
|
1919
|
+
conditions, observed values may vary from calculations.
|
|
1920
|
+
https://gml.noaa.gov/grad/solcalc/calcdetails.html
|
|
1921
|
+
|
|
1922
|
+
**Kind**: global class
|
|
1923
|
+
|
|
1924
|
+
* [Zmanim](#Zmanim)
|
|
1925
|
+
* [new Zmanim(gloc, date)](#new_Zmanim_new)
|
|
1926
|
+
* _instance_
|
|
1927
|
+
* [.timeAtAngle(angle, rising)](#Zmanim+timeAtAngle) ⇒ <code>Date</code>
|
|
1928
|
+
* [.sunrise()](#Zmanim+sunrise) ⇒ <code>Date</code>
|
|
1929
|
+
* [.seaLevelSunrise()](#Zmanim+seaLevelSunrise) ⇒ <code>Date</code>
|
|
1930
|
+
* [.sunset()](#Zmanim+sunset) ⇒ <code>Date</code>
|
|
1931
|
+
* [.seaLevelSunset()](#Zmanim+seaLevelSunset) ⇒ <code>Date</code>
|
|
1932
|
+
* [.dawn()](#Zmanim+dawn) ⇒ <code>Date</code>
|
|
1933
|
+
* [.dusk()](#Zmanim+dusk) ⇒ <code>Date</code>
|
|
1934
|
+
* [.gregEve()](#Zmanim+gregEve) ⇒ <code>Date</code>
|
|
1935
|
+
* [.chatzot()](#Zmanim+chatzot) ⇒ <code>Date</code>
|
|
1936
|
+
* [.chatzotNight()](#Zmanim+chatzotNight) ⇒ <code>Date</code>
|
|
1937
|
+
* [.alotHaShachar()](#Zmanim+alotHaShachar) ⇒ <code>Date</code>
|
|
1938
|
+
* [.misheyakir()](#Zmanim+misheyakir) ⇒ <code>Date</code>
|
|
1939
|
+
* [.misheyakirMachmir()](#Zmanim+misheyakirMachmir) ⇒ <code>Date</code>
|
|
1940
|
+
* [.sofZmanShma()](#Zmanim+sofZmanShma) ⇒ <code>Date</code>
|
|
1941
|
+
* [.sofZmanTfilla()](#Zmanim+sofZmanTfilla) ⇒ <code>Date</code>
|
|
1942
|
+
* [.sofZmanShmaMGA()](#Zmanim+sofZmanShmaMGA) ⇒ <code>Date</code>
|
|
1943
|
+
* [.sofZmanTfillaMGA()](#Zmanim+sofZmanTfillaMGA) ⇒ <code>Date</code>
|
|
1944
|
+
* [.minchaGedola()](#Zmanim+minchaGedola) ⇒ <code>Date</code>
|
|
1945
|
+
* [.minchaKetana()](#Zmanim+minchaKetana) ⇒ <code>Date</code>
|
|
1946
|
+
* [.plagHaMincha()](#Zmanim+plagHaMincha) ⇒ <code>Date</code>
|
|
1947
|
+
* [.tzeit([angle])](#Zmanim+tzeit) ⇒ <code>Date</code>
|
|
1948
|
+
* [.neitzHaChama()](#Zmanim+neitzHaChama) ⇒ <code>Date</code>
|
|
1949
|
+
* [.shkiah()](#Zmanim+shkiah) ⇒ <code>Date</code>
|
|
1950
|
+
* [.sunriseOffset(offset, roundMinute)](#Zmanim+sunriseOffset) ⇒ <code>Date</code>
|
|
1951
|
+
* [.sunsetOffset(offset, roundMinute)](#Zmanim+sunsetOffset) ⇒ <code>Date</code>
|
|
1952
|
+
* _static_
|
|
1953
|
+
* [.formatTime(dt, timeFormat)](#Zmanim.formatTime) ⇒ <code>string</code>
|
|
1954
|
+
* [.roundTime(dt)](#Zmanim.roundTime) ⇒ <code>Date</code>
|
|
1955
|
+
* [.timeZoneOffset(tzid, date)](#Zmanim.timeZoneOffset) ⇒ <code>string</code>
|
|
1956
|
+
* [.formatISOWithTimeZone(tzid, date)](#Zmanim.formatISOWithTimeZone) ⇒ <code>string</code>
|
|
1957
|
+
|
|
1958
|
+
<a name="new_Zmanim_new"></a>
|
|
1959
|
+
|
|
1960
|
+
### new Zmanim(gloc, date)
|
|
1961
|
+
Initialize a Zmanim instance.
|
|
1962
|
+
|
|
1963
|
+
|
|
1964
|
+
| Param | Type | Description |
|
|
1965
|
+
| --- | --- | --- |
|
|
1966
|
+
| gloc | [<code>GeoLocation</code>](#GeoLocation) | GeoLocation including latitude, longitude, and timezone |
|
|
1967
|
+
| date | <code>Date</code> \| [<code>HDate</code>](#HDate) | Regular or Hebrew Date. If `date` is a regular `Date`, hours, minutes, seconds and milliseconds are ignored. |
|
|
1968
|
+
|
|
1969
|
+
**Example**
|
|
1970
|
+
```js
|
|
1971
|
+
const {GeoLocation, Zmanim} = require('@hebcal/core');
|
|
1972
|
+
const latitude = 41.822232;
|
|
1973
|
+
const longitude = -71.448292;
|
|
1974
|
+
const tzid = 'America/New_York';
|
|
1975
|
+
const friday = new Date(2023, 8, 8);
|
|
1976
|
+
const gloc = new GeoLocation(null, latitude, longitude, 0, tzid);
|
|
1977
|
+
const zmanim = new Zmanim(gloc, friday);
|
|
1978
|
+
const candleLighting = zmanim.sunsetOffset(-18, true);
|
|
1979
|
+
const timeStr = Zmanim.formatISOWithTimeZone(tzid, candleLighting);
|
|
1980
|
+
```
|
|
1981
|
+
<a name="Zmanim+timeAtAngle"></a>
|
|
1982
|
+
|
|
1983
|
+
### zmanim.timeAtAngle(angle, rising) ⇒ <code>Date</code>
|
|
1984
|
+
Convenience function to get the time when sun is above or below the horizon
|
|
1985
|
+
for a certain angle (in degrees).
|
|
1986
|
+
|
|
1987
|
+
**Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
|
|
1988
|
+
|
|
1989
|
+
| Param | Type |
|
|
1990
|
+
| --- | --- |
|
|
1991
|
+
| angle | <code>number</code> |
|
|
1992
|
+
| rising | <code>boolean</code> |
|
|
1993
|
+
|
|
1994
|
+
<a name="Zmanim+sunrise"></a>
|
|
1995
|
+
|
|
1996
|
+
### zmanim.sunrise() ⇒ <code>Date</code>
|
|
1997
|
+
Upper edge of the Sun appears over the eastern horizon in the morning (0.833° above horizon)
|
|
1998
|
+
|
|
1999
|
+
**Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
|
|
2000
|
+
<a name="Zmanim+seaLevelSunrise"></a>
|
|
2001
|
+
|
|
2002
|
+
### zmanim.seaLevelSunrise() ⇒ <code>Date</code>
|
|
2003
|
+
Upper edge of the Sun appears over the eastern horizon in the morning (0.833° above horizon)
|
|
2004
|
+
|
|
2005
|
+
**Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
|
|
2006
|
+
<a name="Zmanim+sunset"></a>
|
|
2007
|
+
|
|
2008
|
+
### zmanim.sunset() ⇒ <code>Date</code>
|
|
2009
|
+
When the upper edge of the Sun disappears below the horizon (0.833° below horizon)
|
|
2010
|
+
|
|
2011
|
+
**Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
|
|
2012
|
+
<a name="Zmanim+seaLevelSunset"></a>
|
|
2013
|
+
|
|
2014
|
+
### zmanim.seaLevelSunset() ⇒ <code>Date</code>
|
|
2015
|
+
When the upper edge of the Sun disappears below the horizon (0.833° below horizon)
|
|
2016
|
+
|
|
2017
|
+
**Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
|
|
2018
|
+
<a name="Zmanim+dawn"></a>
|
|
2019
|
+
|
|
2020
|
+
### zmanim.dawn() ⇒ <code>Date</code>
|
|
2021
|
+
Civil dawn; Sun is 6° below the horizon in the morning
|
|
2022
|
+
|
|
2023
|
+
**Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
|
|
2024
|
+
<a name="Zmanim+dusk"></a>
|
|
2025
|
+
|
|
2026
|
+
### zmanim.dusk() ⇒ <code>Date</code>
|
|
2027
|
+
Civil dusk; Sun is 6° below the horizon in the evening
|
|
2028
|
+
|
|
2029
|
+
**Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
|
|
2030
|
+
<a name="Zmanim+gregEve"></a>
|
|
2031
|
+
|
|
2032
|
+
### zmanim.gregEve() ⇒ <code>Date</code>
|
|
2033
|
+
**Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
|
|
2034
|
+
<a name="Zmanim+chatzot"></a>
|
|
2035
|
+
|
|
2036
|
+
### zmanim.chatzot() ⇒ <code>Date</code>
|
|
2037
|
+
Midday – Chatzot; Sunrise plus 6 halachic hours
|
|
2038
|
+
|
|
2039
|
+
**Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
|
|
2040
|
+
<a name="Zmanim+chatzotNight"></a>
|
|
2041
|
+
|
|
2042
|
+
### zmanim.chatzotNight() ⇒ <code>Date</code>
|
|
2043
|
+
Midnight – Chatzot; Sunset plus 6 halachic hours
|
|
2044
|
+
|
|
2045
|
+
**Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
|
|
2046
|
+
<a name="Zmanim+alotHaShachar"></a>
|
|
2047
|
+
|
|
2048
|
+
### zmanim.alotHaShachar() ⇒ <code>Date</code>
|
|
2049
|
+
Dawn – Alot haShachar; Sun is 16.1° below the horizon in the morning
|
|
2050
|
+
|
|
2051
|
+
**Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
|
|
2052
|
+
<a name="Zmanim+misheyakir"></a>
|
|
2053
|
+
|
|
2054
|
+
### zmanim.misheyakir() ⇒ <code>Date</code>
|
|
2055
|
+
Earliest talis & tefillin – Misheyakir; Sun is 11.5° below the horizon in the morning
|
|
2056
|
+
|
|
2057
|
+
**Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
|
|
2058
|
+
<a name="Zmanim+misheyakirMachmir"></a>
|
|
2059
|
+
|
|
2060
|
+
### zmanim.misheyakirMachmir() ⇒ <code>Date</code>
|
|
2061
|
+
Earliest talis & tefillin – Misheyakir Machmir; Sun is 10.2° below the horizon in the morning
|
|
2062
|
+
|
|
2063
|
+
**Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
|
|
2064
|
+
<a name="Zmanim+sofZmanShma"></a>
|
|
2065
|
+
|
|
2066
|
+
### zmanim.sofZmanShma() ⇒ <code>Date</code>
|
|
2067
|
+
Latest Shema (Gra); Sunrise plus 3 halachic hours, according to the Gra
|
|
2068
|
+
|
|
2069
|
+
**Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
|
|
2070
|
+
<a name="Zmanim+sofZmanTfilla"></a>
|
|
2071
|
+
|
|
2072
|
+
### zmanim.sofZmanTfilla() ⇒ <code>Date</code>
|
|
2073
|
+
Latest Shacharit (Gra); Sunrise plus 4 halachic hours, according to the Gra
|
|
2074
|
+
|
|
2075
|
+
**Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
|
|
2076
|
+
<a name="Zmanim+sofZmanShmaMGA"></a>
|
|
2077
|
+
|
|
2078
|
+
### zmanim.sofZmanShmaMGA() ⇒ <code>Date</code>
|
|
2079
|
+
Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham
|
|
2080
|
+
|
|
2081
|
+
**Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
|
|
2082
|
+
<a name="Zmanim+sofZmanTfillaMGA"></a>
|
|
2083
|
+
|
|
2084
|
+
### zmanim.sofZmanTfillaMGA() ⇒ <code>Date</code>
|
|
2085
|
+
Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham
|
|
2086
|
+
|
|
2087
|
+
**Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
|
|
2088
|
+
<a name="Zmanim+minchaGedola"></a>
|
|
2089
|
+
|
|
2090
|
+
### zmanim.minchaGedola() ⇒ <code>Date</code>
|
|
2091
|
+
Earliest Mincha – Mincha Gedola; Sunrise plus 6.5 halachic hours
|
|
2092
|
+
|
|
2093
|
+
**Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
|
|
2094
|
+
<a name="Zmanim+minchaKetana"></a>
|
|
2095
|
+
|
|
2096
|
+
### zmanim.minchaKetana() ⇒ <code>Date</code>
|
|
2097
|
+
Preferable earliest time to recite Minchah – Mincha Ketana; Sunrise plus 9.5 halachic hours
|
|
2098
|
+
|
|
2099
|
+
**Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
|
|
2100
|
+
<a name="Zmanim+plagHaMincha"></a>
|
|
2101
|
+
|
|
2102
|
+
### zmanim.plagHaMincha() ⇒ <code>Date</code>
|
|
2103
|
+
Plag haMincha; Sunrise plus 10.75 halachic hours
|
|
2104
|
+
|
|
2105
|
+
**Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
|
|
2106
|
+
<a name="Zmanim+tzeit"></a>
|
|
2107
|
+
|
|
2108
|
+
### zmanim.tzeit([angle]) ⇒ <code>Date</code>
|
|
2109
|
+
**Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
|
|
2110
|
+
|
|
2111
|
+
| Param | Type | Default | Description |
|
|
2112
|
+
| --- | --- | --- | --- |
|
|
2113
|
+
| [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. |
|
|
2114
|
+
|
|
2115
|
+
<a name="Zmanim+neitzHaChama"></a>
|
|
2116
|
+
|
|
2117
|
+
### zmanim.neitzHaChama() ⇒ <code>Date</code>
|
|
2118
|
+
Alias for sunrise
|
|
2119
|
+
|
|
2120
|
+
**Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
|
|
2121
|
+
<a name="Zmanim+shkiah"></a>
|
|
2122
|
+
|
|
2123
|
+
### zmanim.shkiah() ⇒ <code>Date</code>
|
|
2124
|
+
Alias for sunset
|
|
2125
|
+
|
|
2126
|
+
**Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
|
|
2127
|
+
<a name="Zmanim+sunriseOffset"></a>
|
|
2128
|
+
|
|
2129
|
+
### zmanim.sunriseOffset(offset, roundMinute) ⇒ <code>Date</code>
|
|
2130
|
+
Returns sunrise + `offset` minutes (either positive or negative).
|
|
2131
|
+
|
|
2132
|
+
**Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
|
|
2133
|
+
|
|
2134
|
+
| Param | Type | Default | Description |
|
|
2135
|
+
| --- | --- | --- | --- |
|
|
2136
|
+
| offset | <code>number</code> | | minutes |
|
|
2137
|
+
| roundMinute | <code>boolean</code> | <code>true</code> | round time to nearest minute (default true) |
|
|
2138
|
+
|
|
2139
|
+
<a name="Zmanim+sunsetOffset"></a>
|
|
2140
|
+
|
|
2141
|
+
### zmanim.sunsetOffset(offset, roundMinute) ⇒ <code>Date</code>
|
|
2142
|
+
Returns sunset + `offset` minutes (either positive or negative).
|
|
2143
|
+
|
|
2144
|
+
**Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
|
|
2145
|
+
|
|
2146
|
+
| Param | Type | Default | Description |
|
|
2147
|
+
| --- | --- | --- | --- |
|
|
2148
|
+
| offset | <code>number</code> | | minutes |
|
|
2149
|
+
| roundMinute | <code>boolean</code> | <code>true</code> | round time to nearest minute (default true) |
|
|
2150
|
+
|
|
2151
|
+
<a name="Zmanim.formatTime"></a>
|
|
1579
2152
|
|
|
1580
|
-
|
|
2153
|
+
### Zmanim.formatTime(dt, timeFormat) ⇒ <code>string</code>
|
|
2154
|
+
Uses timeFormat to return a date like '20:34'
|
|
1581
2155
|
|
|
1582
|
-
|
|
1583
|
-
| --- | --- | --- |
|
|
1584
|
-
| tz | <code>number</code> | integer, GMT offset in hours |
|
|
1585
|
-
| dst | <code>string</code> | 'none', 'eu', 'usa', or 'israel' |
|
|
2156
|
+
**Kind**: static method of [<code>Zmanim</code>](#Zmanim)
|
|
1586
2157
|
|
|
1587
|
-
|
|
2158
|
+
| Param | Type |
|
|
2159
|
+
| --- | --- |
|
|
2160
|
+
| dt | <code>Date</code> |
|
|
2161
|
+
| timeFormat | <code>Intl.DateTimeFormat</code> |
|
|
1588
2162
|
|
|
1589
|
-
|
|
1590
|
-
Converts timezone info from Zip-Codes.com to a standard Olson tzid.
|
|
2163
|
+
<a name="Zmanim.roundTime"></a>
|
|
1591
2164
|
|
|
1592
|
-
|
|
2165
|
+
### Zmanim.roundTime(dt) ⇒ <code>Date</code>
|
|
2166
|
+
Discards seconds, rounding to nearest minute.
|
|
1593
2167
|
|
|
1594
|
-
|
|
1595
|
-
| --- | --- | --- |
|
|
1596
|
-
| state | <code>string</code> | two-letter all-caps US state abbreviation like 'CA' |
|
|
1597
|
-
| tz | <code>number</code> | positive number, 5=America/New_York, 8=America/Los_Angeles |
|
|
1598
|
-
| dst | <code>string</code> | single char 'Y' or 'N' |
|
|
2168
|
+
**Kind**: static method of [<code>Zmanim</code>](#Zmanim)
|
|
1599
2169
|
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
```
|
|
1604
|
-
<a name="Location.geonameCityDescr"></a>
|
|
2170
|
+
| Param | Type |
|
|
2171
|
+
| --- | --- |
|
|
2172
|
+
| dt | <code>Date</code> |
|
|
1605
2173
|
|
|
1606
|
-
|
|
1607
|
-
***Deprecated***
|
|
2174
|
+
<a name="Zmanim.timeZoneOffset"></a>
|
|
1608
2175
|
|
|
1609
|
-
|
|
2176
|
+
### Zmanim.timeZoneOffset(tzid, date) ⇒ <code>string</code>
|
|
2177
|
+
Get offset string (like "+05:00" or "-08:00") from tzid (like "Europe/Moscow")
|
|
1610
2178
|
|
|
1611
|
-
**Kind**: static method of [<code>
|
|
2179
|
+
**Kind**: static method of [<code>Zmanim</code>](#Zmanim)
|
|
1612
2180
|
|
|
1613
|
-
| Param | Type |
|
|
1614
|
-
| --- | --- |
|
|
1615
|
-
|
|
|
1616
|
-
|
|
|
1617
|
-
| countryName | <code>string</code> | full country name, e.g. 'Israel' or 'United States' |
|
|
2181
|
+
| Param | Type |
|
|
2182
|
+
| --- | --- |
|
|
2183
|
+
| tzid | <code>string</code> |
|
|
2184
|
+
| date | <code>Date</code> |
|
|
1618
2185
|
|
|
1619
|
-
<a name="
|
|
2186
|
+
<a name="Zmanim.formatISOWithTimeZone"></a>
|
|
1620
2187
|
|
|
1621
|
-
###
|
|
1622
|
-
|
|
1623
|
-
already being used. Returns `false` if the name is already taken
|
|
1624
|
-
and `true` if successfully added.
|
|
2188
|
+
### Zmanim.formatISOWithTimeZone(tzid, date) ⇒ <code>string</code>
|
|
2189
|
+
Returns a string like "2022-04-01T13:06:00-11:00"
|
|
1625
2190
|
|
|
1626
|
-
**Kind**: static method of [<code>
|
|
2191
|
+
**Kind**: static method of [<code>Zmanim</code>](#Zmanim)
|
|
1627
2192
|
|
|
1628
2193
|
| Param | Type |
|
|
1629
2194
|
| --- | --- |
|
|
1630
|
-
|
|
|
1631
|
-
|
|
|
2195
|
+
| tzid | <code>string</code> |
|
|
2196
|
+
| date | <code>Date</code> |
|
|
1632
2197
|
|
|
1633
2198
|
<a name="TimedEvent"></a>
|
|
1634
2199
|
|
|
@@ -2572,6 +3137,19 @@ Tachanun is not said at Shacharit on Shabbat, but is at Mincha, usually.
|
|
|
2572
3137
|
| hdate | [<code>HDate</code>](#HDate) |
|
|
2573
3138
|
| il | <code>boolean</code> |
|
|
2574
3139
|
|
|
3140
|
+
<a name="greg"></a>
|
|
3141
|
+
|
|
3142
|
+
## greg
|
|
3143
|
+
Gregorian date helper functions.
|
|
3144
|
+
|
|
3145
|
+
**Kind**: global variable
|
|
3146
|
+
<a name="greg.monthNames"></a>
|
|
3147
|
+
|
|
3148
|
+
### greg.monthNames : <code>Array.<string></code>
|
|
3149
|
+
Long names of the Gregorian months (1='January', 12='December')
|
|
3150
|
+
|
|
3151
|
+
**Kind**: static property of [<code>greg</code>](#greg)
|
|
3152
|
+
**Read only**: true
|
|
2575
3153
|
<a name="months"></a>
|
|
2576
3154
|
|
|
2577
3155
|
## months : <code>enum</code>
|
|
@@ -2635,173 +3213,247 @@ Holiday flags for Event
|
|
|
2635
3213
|
| YERUSHALMI_YOMI | <code>number</code> | <code>16777216</code> | Daily page of Jerusalem Talmud (Yerushalmi) |
|
|
2636
3214
|
| NACH_YOMI | <code>number</code> | <code>33554432</code> | Nach Yomi |
|
|
2637
3215
|
|
|
2638
|
-
<a name="
|
|
3216
|
+
<a name="parshiot"></a>
|
|
2639
3217
|
|
|
2640
|
-
##
|
|
2641
|
-
|
|
3218
|
+
## parshiot : <code>Array.<string></code>
|
|
3219
|
+
The 54 parshiyot of the Torah as transilterated strings
|
|
3220
|
+
parshiot[0] == 'Bereshit', parshiot[1] == 'Noach', parshiot[53] == "Ha'azinu".
|
|
2642
3221
|
|
|
2643
3222
|
**Kind**: global constant
|
|
3223
|
+
**Read only**: true
|
|
3224
|
+
<a name="gematriya"></a>
|
|
2644
3225
|
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
* [.isLeapYear(year)](#greg.isLeapYear) ⇒ <code>boolean</code>
|
|
2648
|
-
* [.daysInMonth(month, year)](#greg.daysInMonth) ⇒ <code>number</code>
|
|
2649
|
-
* [.isDate(obj)](#greg.isDate) ⇒ <code>boolean</code>
|
|
2650
|
-
* ~~[.dayOfYear(date)](#greg.dayOfYear) ⇒ <code>number</code>~~
|
|
2651
|
-
* [.greg2abs(date)](#greg.greg2abs) ⇒ <code>number</code>
|
|
2652
|
-
* [.abs2greg(theDate)](#greg.abs2greg) ⇒ <code>Date</code>
|
|
3226
|
+
## gematriya(number) ⇒ <code>string</code>
|
|
3227
|
+
Converts a numerical value to a string of Hebrew letters.
|
|
2653
3228
|
|
|
2654
|
-
|
|
3229
|
+
When specifying years of the Hebrew calendar in the present millennium,
|
|
3230
|
+
we omit the thousands (which is presently 5 [ה]).
|
|
2655
3231
|
|
|
2656
|
-
|
|
2657
|
-
Long names of the Gregorian months (1='January', 12='December')
|
|
3232
|
+
**Kind**: global function
|
|
2658
3233
|
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
<
|
|
3234
|
+
| Param | Type |
|
|
3235
|
+
| --- | --- |
|
|
3236
|
+
| number | <code>number</code> |
|
|
3237
|
+
|
|
3238
|
+
**Example**
|
|
3239
|
+
```js
|
|
3240
|
+
gematriya(5774) // 'תשע״ד' - cropped to 774
|
|
3241
|
+
gematriya(25) // 'כ״ה'
|
|
3242
|
+
gematriya(60) // 'ס׳'
|
|
3243
|
+
gematriya(3761) // 'ג׳תשס״א'
|
|
3244
|
+
gematriya(1123) // 'א׳קכ״ג'
|
|
3245
|
+
```
|
|
3246
|
+
<a name="gematriyaStrToNum"></a>
|
|
3247
|
+
|
|
3248
|
+
## gematriyaStrToNum(str) ⇒ <code>number</code>
|
|
3249
|
+
Converts a string of Hebrew letters to a numerical value.
|
|
3250
|
+
|
|
3251
|
+
Only considers the value of Hebrew letters `א` through `ת`.
|
|
3252
|
+
Ignores final Hebrew letters such as `ך` (kaf sofit) or `ם` (mem sofit)
|
|
3253
|
+
and vowels (nekudot).
|
|
3254
|
+
|
|
3255
|
+
**Kind**: global function
|
|
3256
|
+
|
|
3257
|
+
| Param | Type |
|
|
3258
|
+
| --- | --- |
|
|
3259
|
+
| str | <code>string</code> |
|
|
3260
|
+
|
|
3261
|
+
<a name="hebrew2abs"></a>
|
|
3262
|
+
|
|
3263
|
+
## hebrew2abs(year, month, day) ⇒ <code>number</code>
|
|
3264
|
+
Converts Hebrew date to R.D. (Rata Die) fixed days.
|
|
3265
|
+
R.D. 1 is the imaginary date Monday, January 1, 1 on the Gregorian
|
|
3266
|
+
Calendar.
|
|
3267
|
+
|
|
3268
|
+
**Kind**: global function
|
|
3269
|
+
|
|
3270
|
+
| Param | Type | Description |
|
|
3271
|
+
| --- | --- | --- |
|
|
3272
|
+
| year | <code>number</code> | Hebrew year |
|
|
3273
|
+
| month | <code>number</code> | Hebrew month |
|
|
3274
|
+
| day | <code>number</code> | Hebrew date (1-30) |
|
|
3275
|
+
|
|
3276
|
+
<a name="abs2hebrew"></a>
|
|
2662
3277
|
|
|
2663
|
-
|
|
2664
|
-
|
|
3278
|
+
## abs2hebrew(abs) ⇒ <code>SimpleHebrewDate</code>
|
|
3279
|
+
Converts absolute R.D. days to Hebrew date
|
|
2665
3280
|
|
|
2666
|
-
**Kind**:
|
|
3281
|
+
**Kind**: global function
|
|
2667
3282
|
|
|
2668
3283
|
| Param | Type | Description |
|
|
2669
3284
|
| --- | --- | --- |
|
|
2670
|
-
|
|
|
3285
|
+
| abs | <code>number</code> | absolute R.D. days |
|
|
2671
3286
|
|
|
2672
|
-
<a name="
|
|
3287
|
+
<a name="isLeapYear"></a>
|
|
2673
3288
|
|
|
2674
|
-
|
|
2675
|
-
|
|
3289
|
+
## isLeapYear(year) ⇒ <code>boolean</code>
|
|
3290
|
+
Returns true if Hebrew year is a leap year
|
|
2676
3291
|
|
|
2677
|
-
**Kind**:
|
|
3292
|
+
**Kind**: global function
|
|
2678
3293
|
|
|
2679
3294
|
| Param | Type | Description |
|
|
2680
3295
|
| --- | --- | --- |
|
|
2681
|
-
|
|
|
2682
|
-
| year | <code>number</code> | Gregorian year |
|
|
3296
|
+
| year | <code>number</code> | Hebrew year |
|
|
2683
3297
|
|
|
2684
|
-
<a name="
|
|
3298
|
+
<a name="monthsInYear"></a>
|
|
2685
3299
|
|
|
2686
|
-
|
|
2687
|
-
|
|
3300
|
+
## monthsInYear(year) ⇒ <code>number</code>
|
|
3301
|
+
Number of months in this Hebrew year (either 12 or 13 depending on leap year)
|
|
2688
3302
|
|
|
2689
|
-
**Kind**:
|
|
3303
|
+
**Kind**: global function
|
|
2690
3304
|
|
|
2691
|
-
| Param | Type |
|
|
2692
|
-
| --- | --- |
|
|
2693
|
-
|
|
|
3305
|
+
| Param | Type | Description |
|
|
3306
|
+
| --- | --- | --- |
|
|
3307
|
+
| year | <code>number</code> | Hebrew year |
|
|
3308
|
+
|
|
3309
|
+
<a name="daysInMonth"></a>
|
|
2694
3310
|
|
|
2695
|
-
<
|
|
3311
|
+
## daysInMonth(month, year) ⇒ <code>number</code>
|
|
3312
|
+
Number of days in Hebrew month in a given year (29 or 30)
|
|
3313
|
+
|
|
3314
|
+
**Kind**: global function
|
|
3315
|
+
|
|
3316
|
+
| Param | Type | Description |
|
|
3317
|
+
| --- | --- | --- |
|
|
3318
|
+
| month | <code>number</code> | Hebrew month (e.g. months.TISHREI) |
|
|
3319
|
+
| year | <code>number</code> | Hebrew year |
|
|
2696
3320
|
|
|
2697
|
-
|
|
2698
|
-
***Deprecated***
|
|
3321
|
+
<a name="getMonthName"></a>
|
|
2699
3322
|
|
|
2700
|
-
|
|
3323
|
+
## getMonthName(month, year)
|
|
3324
|
+
Returns a transliterated string name of Hebrew month in year,
|
|
3325
|
+
for example 'Elul' or 'Cheshvan'.
|
|
2701
3326
|
|
|
2702
|
-
**Kind**:
|
|
3327
|
+
**Kind**: global function
|
|
2703
3328
|
|
|
2704
3329
|
| Param | Type | Description |
|
|
2705
3330
|
| --- | --- | --- |
|
|
2706
|
-
|
|
|
3331
|
+
| month | <code>number</code> | Hebrew month (e.g. months.TISHREI) |
|
|
3332
|
+
| year | <code>number</code> | Hebrew year |
|
|
2707
3333
|
|
|
2708
|
-
<a name="
|
|
3334
|
+
<a name="elapsedDays"></a>
|
|
2709
3335
|
|
|
2710
|
-
|
|
2711
|
-
|
|
3336
|
+
## elapsedDays(year) ⇒ <code>number</code>
|
|
3337
|
+
Days from sunday prior to start of Hebrew calendar to mean
|
|
3338
|
+
conjunction of Tishrei in Hebrew YEAR
|
|
2712
3339
|
|
|
2713
|
-
**Kind**:
|
|
3340
|
+
**Kind**: global function
|
|
2714
3341
|
|
|
2715
3342
|
| Param | Type | Description |
|
|
2716
3343
|
| --- | --- | --- |
|
|
2717
|
-
|
|
|
3344
|
+
| year | <code>number</code> | Hebrew year |
|
|
2718
3345
|
|
|
2719
|
-
<a name="
|
|
3346
|
+
<a name="daysInYear"></a>
|
|
2720
3347
|
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
Clamen, Software--Practice and Experience, Volume 23, Number 4
|
|
2726
|
-
(April, 1993), pages 383-404 for an explanation.
|
|
3348
|
+
## daysInYear(year) ⇒ <code>number</code>
|
|
3349
|
+
Number of days in the hebrew YEAR.
|
|
3350
|
+
A common Hebrew calendar year can have a length of 353, 354 or 355 days
|
|
3351
|
+
A leap Hebrew calendar year can have a length of 383, 384 or 385 days
|
|
2727
3352
|
|
|
2728
|
-
**Kind**:
|
|
3353
|
+
**Kind**: global function
|
|
2729
3354
|
|
|
2730
3355
|
| Param | Type | Description |
|
|
2731
3356
|
| --- | --- | --- |
|
|
2732
|
-
|
|
|
3357
|
+
| year | <code>number</code> | Hebrew year |
|
|
2733
3358
|
|
|
2734
|
-
<a name="
|
|
3359
|
+
<a name="longCheshvan"></a>
|
|
2735
3360
|
|
|
2736
|
-
##
|
|
2737
|
-
|
|
2738
|
-
parshiot[0] == 'Bereshit', parshiot[1] == 'Noach', parshiot[53] == "Ha'azinu".
|
|
3361
|
+
## longCheshvan(year) ⇒ <code>boolean</code>
|
|
3362
|
+
true if Cheshvan is long in Hebrew year
|
|
2739
3363
|
|
|
2740
|
-
**Kind**: global
|
|
2741
|
-
**Read only**: true
|
|
2742
|
-
<a name="gematriya"></a>
|
|
3364
|
+
**Kind**: global function
|
|
2743
3365
|
|
|
2744
|
-
|
|
2745
|
-
|
|
3366
|
+
| Param | Type | Description |
|
|
3367
|
+
| --- | --- | --- |
|
|
3368
|
+
| year | <code>number</code> | Hebrew year |
|
|
2746
3369
|
|
|
2747
|
-
|
|
2748
|
-
|
|
3370
|
+
<a name="shortKislev"></a>
|
|
3371
|
+
|
|
3372
|
+
## shortKislev(year) ⇒ <code>boolean</code>
|
|
3373
|
+
true if Kislev is short in Hebrew year
|
|
2749
3374
|
|
|
2750
3375
|
**Kind**: global function
|
|
2751
3376
|
|
|
2752
|
-
| Param | Type |
|
|
2753
|
-
| --- | --- |
|
|
2754
|
-
|
|
|
3377
|
+
| Param | Type | Description |
|
|
3378
|
+
| --- | --- | --- |
|
|
3379
|
+
| year | <code>number</code> | Hebrew year |
|
|
3380
|
+
|
|
3381
|
+
<a name="getYahrzeit"></a>
|
|
3382
|
+
|
|
3383
|
+
## getYahrzeit(hyear, date) ⇒ <code>Date</code>
|
|
3384
|
+
Calculates yahrzeit.
|
|
3385
|
+
`hyear` must be after original `date` of death.
|
|
3386
|
+
Returns `undefined` when requested year preceeds or is same as original year.
|
|
3387
|
+
|
|
3388
|
+
Hebcal uses the algorithm defined in "Calendrical Calculations"
|
|
3389
|
+
by Edward M. Reingold and Nachum Dershowitz.
|
|
3390
|
+
|
|
3391
|
+
The customary anniversary date of a death is more complicated and depends
|
|
3392
|
+
also on the character of the year in which the first anniversary occurs.
|
|
3393
|
+
There are several cases:
|
|
3394
|
+
|
|
3395
|
+
* If the date of death is Marcheshvan 30, the anniversary in general depends
|
|
3396
|
+
on the first anniversary; if that first anniversary was not Marcheshvan 30,
|
|
3397
|
+
use the day before Kislev 1.
|
|
3398
|
+
* If the date of death is Kislev 30, the anniversary in general again depends
|
|
3399
|
+
on the first anniversary — if that was not Kislev 30, use the day before
|
|
3400
|
+
Tevet 1.
|
|
3401
|
+
* If the date of death is Adar II, the anniversary is the same day in the
|
|
3402
|
+
last month of the Hebrew year (Adar or Adar II).
|
|
3403
|
+
* If the date of death is Adar I 30, the anniversary in a Hebrew year that
|
|
3404
|
+
is not a leap year (in which Adar only has 29 days) is the last day in
|
|
3405
|
+
Shevat.
|
|
3406
|
+
* In all other cases, use the normal (that is, same month number) anniversary
|
|
3407
|
+
of the date of death. [Calendrical Calculations p. 113]
|
|
3408
|
+
|
|
3409
|
+
**Kind**: global function
|
|
3410
|
+
**Returns**: <code>Date</code> - anniversary occurring in `hyear`
|
|
3411
|
+
|
|
3412
|
+
| Param | Type | Description |
|
|
3413
|
+
| --- | --- | --- |
|
|
3414
|
+
| hyear | <code>number</code> | Hebrew year |
|
|
3415
|
+
| date | <code>Date</code> \| <code>SimpleHebrewDate</code> \| <code>number</code> | Gregorian or Hebrew date of death |
|
|
2755
3416
|
|
|
2756
3417
|
**Example**
|
|
2757
3418
|
```js
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
gematriya(3761) // 'ג׳תשס״א'
|
|
2762
|
-
gematriya(1123) // 'א׳קכ״ג'
|
|
3419
|
+
import {getYahrzeit} from '@hebcal/hdate';
|
|
3420
|
+
const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'
|
|
3421
|
+
const anniversary = getYahrzeit(5780, dt); // '2/25/2020' == '30 Sh\'vat 5780'
|
|
2763
3422
|
```
|
|
2764
|
-
<a name="
|
|
2765
|
-
|
|
2766
|
-
## gematriyaStrToNum(str) ⇒ <code>number</code>
|
|
2767
|
-
Converts a string of Hebrew letters to a numerical value.
|
|
3423
|
+
<a name="getBirthdayOrAnniversary"></a>
|
|
2768
3424
|
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
3425
|
+
## getBirthdayOrAnniversary(hyear, date) ⇒ <code>Date</code>
|
|
3426
|
+
Calculates a birthday or anniversary (non-yahrzeit).
|
|
3427
|
+
`hyear` must be after original `date` of anniversary.
|
|
3428
|
+
Returns `undefined` when requested year preceeds or is same as original year.
|
|
2772
3429
|
|
|
2773
|
-
|
|
3430
|
+
Hebcal uses the algorithm defined in "Calendrical Calculations"
|
|
3431
|
+
by Edward M. Reingold and Nachum Dershowitz.
|
|
2774
3432
|
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
3433
|
+
The birthday of someone born in Adar of an ordinary year or Adar II of
|
|
3434
|
+
a leap year is also always in the last month of the year, be that Adar
|
|
3435
|
+
or Adar II. The birthday in an ordinary year of someone born during the
|
|
3436
|
+
first 29 days of Adar I in a leap year is on the corresponding day of Adar;
|
|
3437
|
+
in a leap year, the birthday occurs in Adar I, as expected.
|
|
2778
3438
|
|
|
2779
|
-
|
|
3439
|
+
Someone born on the thirtieth day of Marcheshvan, Kislev, or Adar I
|
|
3440
|
+
has his birthday postponed until the first of the following month in
|
|
3441
|
+
years where that day does not occur. [Calendrical Calculations p. 111]
|
|
2780
3442
|
|
|
2781
|
-
|
|
2782
|
-
**
|
|
2783
|
-
**Properties**
|
|
3443
|
+
**Kind**: global function
|
|
3444
|
+
**Returns**: <code>Date</code> - anniversary occurring in `hyear`
|
|
2784
3445
|
|
|
2785
|
-
|
|
|
2786
|
-
| --- | --- |
|
|
2787
|
-
|
|
|
2788
|
-
|
|
|
2789
|
-
| goldenHour | <code>Date</code> |
|
|
2790
|
-
| goldenHourEnd | <code>Date</code> |
|
|
2791
|
-
| nauticalDawn | <code>Date</code> |
|
|
2792
|
-
| nauticalDusk | <code>Date</code> |
|
|
2793
|
-
| night | <code>Date</code> |
|
|
2794
|
-
| nightEnd | <code>Date</code> |
|
|
2795
|
-
| solarNoon | <code>Date</code> |
|
|
2796
|
-
| sunrise | <code>Date</code> |
|
|
2797
|
-
| sunriseEnd | <code>Date</code> |
|
|
2798
|
-
| sunset | <code>Date</code> |
|
|
2799
|
-
| sunsetStart | <code>Date</code> |
|
|
2800
|
-
| alotHaShachar | <code>Date</code> |
|
|
2801
|
-
| misheyakir | <code>Date</code> |
|
|
2802
|
-
| misheyakirMachmir | <code>Date</code> |
|
|
2803
|
-
| tzeit | <code>Date</code> |
|
|
3446
|
+
| Param | Type | Description |
|
|
3447
|
+
| --- | --- | --- |
|
|
3448
|
+
| hyear | <code>number</code> | Hebrew year |
|
|
3449
|
+
| date | <code>Date</code> \| <code>SimpleHebrewDate</code> \| <code>number</code> | Gregorian or Hebrew date of event |
|
|
2804
3450
|
|
|
3451
|
+
**Example**
|
|
3452
|
+
```js
|
|
3453
|
+
import {getBirthdayOrAnniversary} from '@hebcal/hdate';
|
|
3454
|
+
const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'
|
|
3455
|
+
const anniversary = getBirthdayOrAnniversary(5780, dt); // '3/26/2020' == '1 Nisan 5780'
|
|
3456
|
+
```
|
|
2805
3457
|
<a name="SedraResult"></a>
|
|
2806
3458
|
|
|
2807
3459
|
## SedraResult : <code>Object</code>
|