@hebcal/core 5.4.8 → 5.4.10

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 CHANGED
@@ -16,8 +16,8 @@ Schachter (age 15). This ECMAScript 2015 implementation was released
16
16
  in 2020 by Michael J. Radwin. `@hebcal/core` targets both
17
17
  browser-based JavaScript and server-side Node.js.
18
18
 
19
- Many users of this library will utilize the [HebrewCalendar](#HebrewCalendar)
20
- and [HDate](#HDate) interfaces.
19
+ Many users of this library will utilize the [HebrewCalendar](https://hebcal.github.io/api/core/classes/HebrewCalendar.html)
20
+ and [HDate](https://hebcal.github.io/api/hdate/classes/HDate.html) interfaces.
21
21
 
22
22
  ## Installation
23
23
  ```bash
@@ -44,3736 +44,4 @@ for (const ev of events) {
44
44
  console.log(date.toLocaleDateString(), ev.render('en'), hd.toString());
45
45
  }
46
46
  ```
47
-
48
- ## Classes
49
-
50
- <dl>
51
- <dt><a href="#Locale">Locale</a></dt>
52
- <dd><p>A locale in Hebcal is used for translations/transliterations of
53
- holidays. <code>@hebcal/hdate</code> supports four locales by default</p>
54
- <ul>
55
- <li><code>en</code> - default, Sephardic transliterations (e.g. &quot;Shabbat&quot;)</li>
56
- <li><code>ashkenazi</code> - Ashkenazi transliterations (e.g. &quot;Shabbos&quot;)</li>
57
- <li><code>he</code> - Hebrew (e.g. &quot;שַׁבָּת&quot;)</li>
58
- <li><code>he-x-NoNikud</code> - Hebrew without nikud (e.g. &quot;שבת&quot;)</li>
59
- </ul>
60
- </dd>
61
- <dt><a href="#HDate">HDate</a></dt>
62
- <dd><p>Represents a Hebrew date</p>
63
- </dd>
64
- <dt><a href="#Event">Event</a></dt>
65
- <dd><p>Represents an Event with a title, date, and flags</p>
66
- </dd>
67
- <dt><a href="#HebrewDateEvent">HebrewDateEvent</a></dt>
68
- <dd><p>Daily Hebrew date (&quot;11th of Sivan, 5780&quot;)</p>
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.</p>
73
- </dd>
74
- <dt><a href="#NOAACalculator">NOAACalculator</a></dt>
75
- <dd><p>Implementation of sunrise and sunset methods to calculate astronomical times based on the <a
76
- href="http://noaa.gov">NOAA</a> algorithm. This calculator uses the Java algorithm based on the implementation by <a
77
- href="http://noaa.gov">NOAA - National Oceanic and Atmospheric Administration</a>&#39;s <a href =
78
- "http://www.srrb.noaa.gov/highlights/sunrise/sunrise.html">Surface Radiation Research Branch</a>. NOAA&#39;s <a
79
- href="http://www.srrb.noaa.gov/highlights/sunrise/solareqns.PDF">implementation</a> is based on equations from <a
80
- href="http://www.willbell.com/math/mc1.htm">Astronomical Algorithms</a> by <a
81
- href="http://en.wikipedia.org/wiki/Jean_Meeus">Jean Meeus</a>. Added to the algorithm is an adjustment of the zenith
82
- to account for elevation. The algorithm can be found in the <a
83
- href="http://en.wikipedia.org/wiki/Sunrise_equation">Wikipedia Sunrise Equation</a> article.</p>
84
- </dd>
85
- <dt><a href="#Location">Location</a></dt>
86
- <dd><p>Class representing Location</p>
87
- </dd>
88
- <dt><a href="#Zmanim">Zmanim</a></dt>
89
- <dd><p>Calculate halachic times (zmanim / זְמַנִּים) for a given day and location.
90
- Calculations are available for tzeit / tzais (nightfall),
91
- shkiah (sunset) and more.</p>
92
- <p>Zmanim are estimated using an algorithm published by the US National Oceanic
93
- and Atmospheric Administration. The NOAA solar calculator is based on equations
94
- from <em>Astronomical Algorithms</em> by Jean Meeus.</p>
95
- <p>The sunrise and sunset results are theoretically accurate to within a minute for
96
- locations between +/- 72° latitude, and within 10 minutes outside of those latitudes.
97
- However, due to variations in atmospheric composition, temperature, pressure and
98
- conditions, observed values may vary from calculations.
99
- <a href="https://gml.noaa.gov/grad/solcalc/calcdetails.html">https://gml.noaa.gov/grad/solcalc/calcdetails.html</a></p>
100
- </dd>
101
- <dt><a href="#TimedEvent">TimedEvent</a></dt>
102
- <dd><p>An event that has an <code>eventTime</code> and <code>eventTimeStr</code></p>
103
- </dd>
104
- <dt><a href="#CandleLightingEvent">CandleLightingEvent</a></dt>
105
- <dd><p>Candle lighting before Shabbat or holiday</p>
106
- </dd>
107
- <dt><a href="#HavdalahEvent">HavdalahEvent</a></dt>
108
- <dd><p>Havdalah after Shabbat or holiday</p>
109
- </dd>
110
- <dt><a href="#Molad">Molad</a></dt>
111
- <dd><p>Represents a molad, the moment when the new moon is &quot;born&quot;</p>
112
- </dd>
113
- <dt><a href="#MoladEvent">MoladEvent</a></dt>
114
- <dd><p>Represents a Molad announcement on Shabbat Mevarchim</p>
115
- </dd>
116
- <dt><a href="#OmerEvent">OmerEvent</a></dt>
117
- <dd><p>Represents a day 1-49 of counting the Omer from Pesach to Shavuot</p>
118
- </dd>
119
- <dt><a href="#Sedra">Sedra</a></dt>
120
- <dd><p>Represents Parashah HaShavua for an entire Hebrew year</p>
121
- </dd>
122
- <dt><a href="#ParshaEvent">ParshaEvent</a></dt>
123
- <dd><p>Represents one of 54 weekly Torah portions, always on a Saturday</p>
124
- </dd>
125
- <dt><a href="#HolidayEvent">HolidayEvent</a></dt>
126
- <dd><p>Represents a built-in holiday like Pesach, Purim or Tu BiShvat</p>
127
- </dd>
128
- <dt><a href="#AsaraBTevetEvent">AsaraBTevetEvent</a></dt>
129
- <dd><p>Because Asara B&#39;Tevet often occurs twice in the same Gregorian year,
130
- we subclass HolidayEvent to override the <code>url()</code> method.</p>
131
- </dd>
132
- <dt><a href="#RoshChodeshEvent">RoshChodeshEvent</a></dt>
133
- <dd><p>Represents Rosh Chodesh, the beginning of a new month</p>
134
- </dd>
135
- <dt><a href="#MevarchimChodeshEvent">MevarchimChodeshEvent</a></dt>
136
- <dd><p>Represents Mevarchim haChodesh, the announcement of the new month</p>
137
- </dd>
138
- <dt><a href="#DailyLearning">DailyLearning</a></dt>
139
- <dd><p>Plug-ins for daily learning calendars such as Daf Yomi, Mishna Yomi, Nach Yomi, etc.</p>
140
- <p>Learning schedules are provided by the <code>@hebcal/learning</code> package.</p>
141
- </dd>
142
- <dt><a href="#HebrewCalendar">HebrewCalendar</a></dt>
143
- <dd><p>HebrewCalendar is the main interface to the <code>@hebcal/core</code> library.
144
- This namespace is used to calculate holidays, rosh chodesh, candle lighting &amp; havdalah times,
145
- Parashat HaShavua, Daf Yomi, days of the omer, and the molad.
146
- Event names can be rendered in several languges using the <code>locale</code> option.</p>
147
- </dd>
148
- </dl>
149
-
150
- ## Members
151
-
152
- <dl>
153
- <dt><a href="#greg">greg</a></dt>
154
- <dd><p>Gregorian date helper functions.</p>
155
- </dd>
156
- </dl>
157
-
158
- ## Constants
159
-
160
- <dl>
161
- <dt><a href="#parshiot">parshiot</a> : <code>Array.&lt;string&gt;</code></dt>
162
- <dd><p>The 54 parshiyot of the Torah as transilterated strings
163
- parshiot[0] == &#39;Bereshit&#39;, parshiot[1] == &#39;Noach&#39;, parshiot[52] == &quot;Ha&#39;azinu&quot;.</p>
164
- </dd>
165
- <dt><a href="#version">version</a></dt>
166
- <dd><p>DO NOT EDIT THIS AUTO-GENERATED FILE!</p>
167
- </dd>
168
- </dl>
169
-
170
- ## Functions
171
-
172
- <dl>
173
- <dt><a href="#hebrew2abs">hebrew2abs(year, month, day)</a> ⇒ <code>number</code></dt>
174
- <dd><p>Converts Hebrew date to R.D. (Rata Die) fixed days.
175
- R.D. 1 is the imaginary date Monday, January 1, 1 on the Gregorian
176
- Calendar.</p>
177
- </dd>
178
- <dt><a href="#abs2hebrew">abs2hebrew(abs)</a> ⇒ <code>SimpleHebrewDate</code></dt>
179
- <dd><p>Converts absolute R.D. days to Hebrew date</p>
180
- </dd>
181
- <dt><a href="#isLeapYear">isLeapYear(year)</a> ⇒ <code>boolean</code></dt>
182
- <dd><p>Returns true if Hebrew year is a leap year</p>
183
- </dd>
184
- <dt><a href="#monthsInYear">monthsInYear(year)</a> ⇒ <code>number</code></dt>
185
- <dd><p>Number of months in this Hebrew year (either 12 or 13 depending on leap year)</p>
186
- </dd>
187
- <dt><a href="#daysInMonth">daysInMonth(month, year)</a> ⇒ <code>number</code></dt>
188
- <dd><p>Number of days in Hebrew month in a given year (29 or 30)</p>
189
- </dd>
190
- <dt><a href="#getMonthName">getMonthName(month, year)</a></dt>
191
- <dd><p>Returns a transliterated string name of Hebrew month in year,
192
- for example &#39;Elul&#39; or &#39;Cheshvan&#39;.</p>
193
- </dd>
194
- <dt><a href="#elapsedDays">elapsedDays(year)</a> ⇒ <code>number</code></dt>
195
- <dd><p>Days from sunday prior to start of Hebrew calendar to mean
196
- conjunction of Tishrei in Hebrew YEAR</p>
197
- </dd>
198
- <dt><a href="#daysInYear">daysInYear(year)</a> ⇒ <code>number</code></dt>
199
- <dd><p>Number of days in the hebrew YEAR.
200
- A common Hebrew calendar year can have a length of 353, 354 or 355 days
201
- A leap Hebrew calendar year can have a length of 383, 384 or 385 days</p>
202
- </dd>
203
- <dt><a href="#longCheshvan">longCheshvan(year)</a> ⇒ <code>boolean</code></dt>
204
- <dd><p>true if Cheshvan is long in Hebrew year</p>
205
- </dd>
206
- <dt><a href="#shortKislev">shortKislev(year)</a> ⇒ <code>boolean</code></dt>
207
- <dd><p>true if Kislev is short in Hebrew year</p>
208
- </dd>
209
- <dt><a href="#monthFromName">monthFromName(monthName)</a> ⇒ <code>number</code></dt>
210
- <dd><p>Converts Hebrew month string name to numeric</p>
211
- </dd>
212
- <dt><a href="#gematriya">gematriya(num)</a> ⇒ <code>string</code></dt>
213
- <dd><p>Converts a numerical value to a string of Hebrew letters.</p>
214
- <p>When specifying years of the Hebrew calendar in the present millennium,
215
- we omit the thousands (which is presently 5 [ה]).</p>
216
- </dd>
217
- <dt><a href="#gematriyaStrToNum">gematriyaStrToNum(str)</a> ⇒ <code>number</code></dt>
218
- <dd><p>Converts a string of Hebrew letters to a numerical value.</p>
219
- <p>Only considers the value of Hebrew letters <code>א</code> through <code>ת</code>.
220
- Ignores final Hebrew letters such as <code>ך</code> (kaf sofit) or <code>ם</code> (mem sofit)
221
- and vowels (nekudot).</p>
222
- </dd>
223
- <dt><a href="#omerSefira">omerSefira(omerDay, lang)</a> ⇒</dt>
224
- <dd><p>Returns the sefira. For example, on day 8
225
- חֶֽסֶד שֶׁבִּגְבוּרָה
226
- Chesed shebiGevurah
227
- Lovingkindness within Might</p>
228
- </dd>
229
- <dt><a href="#omerTodayIs">omerTodayIs(omerDay, lang)</a> ⇒</dt>
230
- <dd><p>Returns a sentence with that evening&#39;s omer count</p>
231
- </dd>
232
- <dt><a href="#omerEmoji">omerEmoji(omerDay)</a> ⇒</dt>
233
- <dd><p>Returns an emoji number symbol with a circle, for example <code>㊲</code>
234
- from the “Enclosed CJK Letters and Months” block of the Unicode standard</p>
235
- </dd>
236
- <dt><a href="#molad">molad()</a></dt>
237
- <dd><p>Calculates the molad for a Hebrew month</p>
238
- </dd>
239
- <dt><a href="#getPseudoISO">getPseudoISO(tzid, date)</a> ⇒ <code>string</code></dt>
240
- <dd><p>Returns a string similar to <code>Date.toISOString()</code> but in the
241
- timezone <code>tzid</code>. Contrary to the typical meaning of <code>Z</code> at the end
242
- of the string, this is not actually a UTC date.</p>
243
- </dd>
244
- <dt><a href="#getTimezoneOffset">getTimezoneOffset(tzid, date)</a> ⇒ <code>number</code></dt>
245
- <dd><p>Returns number of minutes <code>tzid</code> is offset from UTC on date <code>date</code>.</p>
246
- </dd>
247
- <dt><a href="#pad4">pad4(number)</a> ⇒ <code>string</code></dt>
248
- <dd><p>Formats a number with leading zeros so the resulting string is 4 digits long.
249
- Similar to <code>string.padStart(4, &#39;0&#39;)</code> but will also format
250
- negative numbers similar to how the JavaScript date formats
251
- negative year numbers (e.g. <code>-37</code> is formatted as <code>-000037</code>).</p>
252
- </dd>
253
- <dt><a href="#pad2">pad2(number)</a> ⇒ <code>string</code></dt>
254
- <dd><p>Formats a number with leading zeros so the resulting string is 2 digits long.
255
- Similar to <code>string.padStart(2, &#39;0&#39;)</code>.</p>
256
- </dd>
257
- </dl>
258
-
259
- <a name="Locale"></a>
260
-
261
- ## Locale
262
- A locale in Hebcal is used for translations/transliterations of
263
- holidays. `@hebcal/hdate` supports four locales by default
264
- * `en` - default, Sephardic transliterations (e.g. "Shabbat")
265
- * `ashkenazi` - Ashkenazi transliterations (e.g. "Shabbos")
266
- * `he` - Hebrew (e.g. "שַׁבָּת")
267
- * `he-x-NoNikud` - Hebrew without nikud (e.g. "שבת")
268
-
269
- **Kind**: global class
270
-
271
- * [Locale](#Locale)
272
- * [.lookupTranslation(id, [locale])](#Locale.lookupTranslation) ⇒ <code>string</code>
273
- * [.gettext(id, [locale])](#Locale.gettext) ⇒ <code>string</code>
274
- * [.addLocale(locale, data)](#Locale.addLocale)
275
- * [.addTranslation(locale, id, translation)](#Locale.addTranslation)
276
- * [.addTranslations(locale, data)](#Locale.addTranslations)
277
- * [.useLocale(locale)](#Locale.useLocale)
278
- * [.getLocaleName()](#Locale.getLocaleName) ⇒ <code>string</code>
279
- * [.getLocaleNames()](#Locale.getLocaleNames) ⇒ <code>Array.&lt;string&gt;</code>
280
- * [.ordinal(n, [locale])](#Locale.ordinal) ⇒ <code>string</code>
281
- * [.hebrewStripNikkud(str)](#Locale.hebrewStripNikkud) ⇒ <code>string</code>
282
-
283
- <a name="Locale.lookupTranslation"></a>
284
-
285
- ### Locale.lookupTranslation(id, [locale]) ⇒ <code>string</code>
286
- Returns translation only if `locale` offers a non-empty translation for `id`.
287
- Otherwise, returns `undefined`.
288
-
289
- **Kind**: static method of [<code>Locale</code>](#Locale)
290
-
291
- | Param | Type | Description |
292
- | --- | --- | --- |
293
- | id | <code>string</code> | Message ID to translate |
294
- | [locale] | <code>string</code> | Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale. |
295
-
296
- <a name="Locale.gettext"></a>
297
-
298
- ### Locale.gettext(id, [locale]) ⇒ <code>string</code>
299
- By default, if no translation was found, returns `id`.
300
-
301
- **Kind**: static method of [<code>Locale</code>](#Locale)
302
-
303
- | Param | Type | Description |
304
- | --- | --- | --- |
305
- | id | <code>string</code> | Message ID to translate |
306
- | [locale] | <code>string</code> | Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale. |
307
-
308
- <a name="Locale.addLocale"></a>
309
-
310
- ### Locale.addLocale(locale, data)
311
- Register locale translations.
312
-
313
- **Kind**: static method of [<code>Locale</code>](#Locale)
314
-
315
- | Param | Type | Description |
316
- | --- | --- | --- |
317
- | locale | <code>string</code> | Locale name (i.e.: `'he'`, `'fr'`) |
318
- | data | <code>LocaleData</code> | parsed data from a `.po` file. |
319
-
320
- <a name="Locale.addTranslation"></a>
321
-
322
- ### Locale.addTranslation(locale, id, translation)
323
- Adds a translation to `locale`, replacing any previous translation.
324
-
325
- **Kind**: static method of [<code>Locale</code>](#Locale)
326
-
327
- | Param | Type | Description |
328
- | --- | --- | --- |
329
- | locale | <code>string</code> | Locale name (i.e: `'he'`, `'fr'`). |
330
- | id | <code>string</code> | Message ID to translate |
331
- | translation | <code>string</code> \| <code>Array.&lt;string&gt;</code> | Translation text |
332
-
333
- <a name="Locale.addTranslations"></a>
334
-
335
- ### Locale.addTranslations(locale, data)
336
- Adds multiple translations to `locale`, replacing any previous translations.
337
-
338
- **Kind**: static method of [<code>Locale</code>](#Locale)
339
-
340
- | Param | Type | Description |
341
- | --- | --- | --- |
342
- | locale | <code>string</code> | Locale name (i.e: `'he'`, `'fr'`). |
343
- | data | <code>LocaleData</code> | parsed data from a `.po` file. |
344
-
345
- <a name="Locale.useLocale"></a>
346
-
347
- ### Locale.useLocale(locale)
348
- Activates a locale. Throws an error if the locale has not been previously added.
349
- After setting the locale to be used, all strings marked for translations
350
- will be represented by the corresponding translation in the specified locale.
351
-
352
- **Kind**: static method of [<code>Locale</code>](#Locale)
353
-
354
- | Param | Type | Description |
355
- | --- | --- | --- |
356
- | locale | <code>string</code> | Locale name (i.e: `'he'`, `'fr'`) |
357
-
358
- <a name="Locale.getLocaleName"></a>
359
-
360
- ### Locale.getLocaleName() ⇒ <code>string</code>
361
- Returns the name of the active locale (i.e. 'he', 'ashkenazi', 'fr')
362
-
363
- **Kind**: static method of [<code>Locale</code>](#Locale)
364
- <a name="Locale.getLocaleNames"></a>
365
-
366
- ### Locale.getLocaleNames() ⇒ <code>Array.&lt;string&gt;</code>
367
- Returns the names of registered locales
368
-
369
- **Kind**: static method of [<code>Locale</code>](#Locale)
370
- <a name="Locale.ordinal"></a>
371
-
372
- ### Locale.ordinal(n, [locale]) ⇒ <code>string</code>
373
- **Kind**: static method of [<code>Locale</code>](#Locale)
374
-
375
- | Param | Type | Description |
376
- | --- | --- | --- |
377
- | n | <code>number</code> | |
378
- | [locale] | <code>string</code> | Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale. |
379
-
380
- <a name="Locale.hebrewStripNikkud"></a>
381
-
382
- ### Locale.hebrewStripNikkud(str) ⇒ <code>string</code>
383
- Removes nekudot from Hebrew string
384
-
385
- **Kind**: static method of [<code>Locale</code>](#Locale)
386
-
387
- | Param | Type |
388
- | --- | --- |
389
- | str | <code>string</code> |
390
-
391
- <a name="HDate"></a>
392
-
393
- ## HDate
394
- Represents a Hebrew date
395
-
396
- **Kind**: global class
397
-
398
- * [HDate](#HDate)
399
- * [new HDate([day], [month], [year])](#new_HDate_new)
400
- * _instance_
401
- * [.getFullYear()](#HDate+getFullYear) ⇒ <code>number</code>
402
- * [.isLeapYear()](#HDate+isLeapYear) ⇒ <code>boolean</code>
403
- * [.getMonth()](#HDate+getMonth) ⇒ <code>number</code>
404
- * [.getTishreiMonth()](#HDate+getTishreiMonth) ⇒ <code>number</code>
405
- * [.daysInMonth()](#HDate+daysInMonth) ⇒ <code>number</code>
406
- * [.getDate()](#HDate+getDate) ⇒ <code>number</code>
407
- * [.getDay()](#HDate+getDay) ⇒ <code>number</code>
408
- * [.greg()](#HDate+greg) ⇒ <code>Date</code>
409
- * [.abs()](#HDate+abs) ⇒ <code>number</code>
410
- * [.getMonthName()](#HDate+getMonthName) ⇒ <code>string</code>
411
- * [.render([locale], [showYear])](#HDate+render) ⇒ <code>string</code>
412
- * [.renderGematriya([suppressNikud])](#HDate+renderGematriya) ⇒ <code>string</code>
413
- * [.before(dow)](#HDate+before) ⇒ [<code>HDate</code>](#HDate)
414
- * [.onOrBefore(dow)](#HDate+onOrBefore) ⇒ [<code>HDate</code>](#HDate)
415
- * [.nearest(dow)](#HDate+nearest) ⇒ [<code>HDate</code>](#HDate)
416
- * [.onOrAfter(dow)](#HDate+onOrAfter) ⇒ [<code>HDate</code>](#HDate)
417
- * [.after(dow)](#HDate+after) ⇒ [<code>HDate</code>](#HDate)
418
- * [.next()](#HDate+next) ⇒ [<code>HDate</code>](#HDate)
419
- * [.prev()](#HDate+prev) ⇒ [<code>HDate</code>](#HDate)
420
- * [.add(amount, [units])](#HDate+add) ⇒ [<code>HDate</code>](#HDate)
421
- * [.subtract(amount, [units])](#HDate+subtract) ⇒ [<code>HDate</code>](#HDate)
422
- * [.deltaDays(other)](#HDate+deltaDays) ⇒ <code>number</code>
423
- * [.isSameDate(other)](#HDate+isSameDate) ⇒ <code>boolean</code>
424
- * [.toString()](#HDate+toString) ⇒ <code>string</code>
425
- * _static_
426
- * [.hebrew2abs(year, month, day)](#HDate.hebrew2abs) ⇒ <code>number</code>
427
- * [.isLeapYear(year)](#HDate.isLeapYear) ⇒ <code>boolean</code>
428
- * [.monthsInYear(year)](#HDate.monthsInYear) ⇒ <code>number</code>
429
- * [.daysInMonth(month, year)](#HDate.daysInMonth) ⇒ <code>number</code>
430
- * [.getMonthName(month, year)](#HDate.getMonthName) ⇒ <code>string</code>
431
- * [.monthNum(month)](#HDate.monthNum) ⇒ <code>number</code>
432
- * [.daysInYear(year)](#HDate.daysInYear) ⇒ <code>number</code>
433
- * [.longCheshvan(year)](#HDate.longCheshvan) ⇒ <code>boolean</code>
434
- * [.shortKislev(year)](#HDate.shortKislev) ⇒ <code>boolean</code>
435
- * [.monthFromName(monthName)](#HDate.monthFromName) ⇒ <code>number</code>
436
- * [.dayOnOrBefore(dayOfWeek, absdate)](#HDate.dayOnOrBefore) ⇒ <code>number</code>
437
- * [.isHDate(obj)](#HDate.isHDate) ⇒ <code>boolean</code>
438
- * [.fromGematriyaString(str, currentThousands)](#HDate.fromGematriyaString) ⇒ [<code>HDate</code>](#HDate)
439
-
440
- <a name="new_HDate_new"></a>
441
-
442
- ### new HDate([day], [month], [year])
443
- Create a Hebrew date. There are 3 basic forms for the `HDate()` constructor.
444
-
445
- 1. No parameters - represents the current Hebrew date at time of instantiation
446
- 2. One parameter
447
- * `Date` - represents the Hebrew date corresponding to the Gregorian date using
448
- local time. Hours, minutes, seconds and milliseconds are ignored.
449
- * `HDate` - clones a copy of the given Hebrew date
450
- * `number` - Converts absolute R.D. days to Hebrew date.
451
- R.D. 1 == the imaginary date January 1, 1 (Gregorian)
452
- 3. Three parameters: Hebrew day, Hebrew month, Hebrew year. Hebrew day should
453
- be a number between 1-30, Hebrew month can be a number or string, and
454
- Hebrew year is always a number.
455
-
456
-
457
- | Param | Type | Description |
458
- | --- | --- | --- |
459
- | [day] | <code>number</code> \| <code>Date</code> \| [<code>HDate</code>](#HDate) | Day of month (1-30) if a `number`. If a `Date` is specified, represents the Hebrew date corresponding to the Gregorian date using local time. If an `HDate` is specified, clones a copy of the given Hebrew date. |
460
- | [month] | <code>number</code> \| <code>string</code> | Hebrew month of year (1=NISAN, 7=TISHREI) |
461
- | [year] | <code>number</code> | Hebrew year |
462
-
463
- **Example**
464
- ```js
465
- import {HDate, months} from '@hebcal/hdate';
466
-
467
- const hd1 = new HDate();
468
- const hd2 = new HDate(new Date(2008, 10, 13));
469
- const hd3 = new HDate(15, 'Cheshvan', 5769);
470
- const hd4 = new HDate(15, months.CHESHVAN, 5769);
471
- const hd5 = new HDate(733359); // ==> 15 Cheshvan 5769
472
- const monthName = 'אייר';
473
- const hd6 = new HDate(5, monthName, 5773);
474
- ```
475
- <a name="HDate+getFullYear"></a>
476
-
477
- ### hDate.getFullYear() ⇒ <code>number</code>
478
- Gets the Hebrew year of this Hebrew date
479
-
480
- **Kind**: instance method of [<code>HDate</code>](#HDate)
481
- <a name="HDate+isLeapYear"></a>
482
-
483
- ### hDate.isLeapYear() ⇒ <code>boolean</code>
484
- Tests if this date occurs during a leap year
485
-
486
- **Kind**: instance method of [<code>HDate</code>](#HDate)
487
- <a name="HDate+getMonth"></a>
488
-
489
- ### hDate.getMonth() ⇒ <code>number</code>
490
- Gets the Hebrew month (1=NISAN, 7=TISHREI) of this Hebrew date
491
-
492
- **Kind**: instance method of [<code>HDate</code>](#HDate)
493
- <a name="HDate+getTishreiMonth"></a>
494
-
495
- ### hDate.getTishreiMonth() ⇒ <code>number</code>
496
- The Tishrei-based month of the date. 1 is Tishrei, 7 is Nisan, 13 is Elul in a leap year
497
-
498
- **Kind**: instance method of [<code>HDate</code>](#HDate)
499
- <a name="HDate+daysInMonth"></a>
500
-
501
- ### hDate.daysInMonth() ⇒ <code>number</code>
502
- Number of days in the month of this Hebrew date
503
-
504
- **Kind**: instance method of [<code>HDate</code>](#HDate)
505
- <a name="HDate+getDate"></a>
506
-
507
- ### hDate.getDate() ⇒ <code>number</code>
508
- Gets the day within the month (1-30)
509
-
510
- **Kind**: instance method of [<code>HDate</code>](#HDate)
511
- <a name="HDate+getDay"></a>
512
-
513
- ### hDate.getDay() ⇒ <code>number</code>
514
- Gets the day of the week. 0=Sunday, 6=Saturday
515
-
516
- **Kind**: instance method of [<code>HDate</code>](#HDate)
517
- <a name="HDate+greg"></a>
518
-
519
- ### hDate.greg() ⇒ <code>Date</code>
520
- Converts to Gregorian date
521
-
522
- **Kind**: instance method of [<code>HDate</code>](#HDate)
523
- <a name="HDate+abs"></a>
524
-
525
- ### hDate.abs() ⇒ <code>number</code>
526
- Returns R.D. (Rata Die) fixed days.
527
- R.D. 1 == Monday, January 1, 1 (Gregorian)
528
- Note also that R.D. = Julian Date − 1,721,424.5
529
- https://en.wikipedia.org/wiki/Rata_Die#Dershowitz_and_Reingold
530
-
531
- **Kind**: instance method of [<code>HDate</code>](#HDate)
532
- <a name="HDate+getMonthName"></a>
533
-
534
- ### hDate.getMonthName() ⇒ <code>string</code>
535
- Returns a transliterated Hebrew month name, e.g. `'Elul'` or `'Cheshvan'`.
536
-
537
- **Kind**: instance method of [<code>HDate</code>](#HDate)
538
- <a name="HDate+render"></a>
539
-
540
- ### hDate.render([locale], [showYear]) ⇒ <code>string</code>
541
- Renders this Hebrew date as a translated or transliterated string,
542
- including ordinal e.g. `'15th of Cheshvan, 5769'`.
543
-
544
- **Kind**: instance method of [<code>HDate</code>](#HDate)
545
-
546
- | Param | Type | Default | Description |
547
- | --- | --- | --- | --- |
548
- | [locale] | <code>string</code> | | Optional locale name (defaults to active locale). |
549
- | [showYear] | <code>boolean</code> | <code>true</code> | Display year (defaults to true). |
550
-
551
- **Example**
552
- ```js
553
- import {HDate, months} from '@hebcal/hdate';
554
-
555
- const hd = new HDate(15, months.CHESHVAN, 5769);
556
- console.log(hd.render('en')); // '15th of Cheshvan, 5769'
557
- console.log(hd.render('he')); // '15 חֶשְׁוָן, 5769'
558
- ```
559
- <a name="HDate+renderGematriya"></a>
560
-
561
- ### hDate.renderGematriya([suppressNikud]) ⇒ <code>string</code>
562
- Renders this Hebrew date in Hebrew gematriya, regardless of locale.
563
-
564
- **Kind**: instance method of [<code>HDate</code>](#HDate)
565
-
566
- | Param | Type | Default |
567
- | --- | --- | --- |
568
- | [suppressNikud] | <code>boolean</code> | <code>false</code> |
569
-
570
- **Example**
571
- ```js
572
- import {HDate, months} from '@hebcal/hdate';
573
- const hd = new HDate(15, months.CHESHVAN, 5769);
574
- console.log(hd.renderGematriya()); // 'ט״ו חֶשְׁוָן תשס״ט'
575
- ```
576
- <a name="HDate+before"></a>
577
-
578
- ### hDate.before(dow) ⇒ [<code>HDate</code>](#HDate)
579
- Returns an `HDate` representing the a dayNumber before the current date.
580
- Sunday=0, Saturday=6
581
-
582
- **Kind**: instance method of [<code>HDate</code>](#HDate)
583
-
584
- | Param | Type | Description |
585
- | --- | --- | --- |
586
- | dow | <code>number</code> | day of week |
587
-
588
- **Example**
589
- ```js
590
- new HDate(new Date('Wednesday February 19, 2014')).before(6).greg() // Sat Feb 15 2014
591
- ```
592
- <a name="HDate+onOrBefore"></a>
593
-
594
- ### hDate.onOrBefore(dow) ⇒ [<code>HDate</code>](#HDate)
595
- Returns an `HDate` representing the a dayNumber on or before the current date.
596
- Sunday=0, Saturday=6
597
-
598
- **Kind**: instance method of [<code>HDate</code>](#HDate)
599
-
600
- | Param | Type | Description |
601
- | --- | --- | --- |
602
- | dow | <code>number</code> | day of week |
603
-
604
- **Example**
605
- ```js
606
- new HDate(new Date('Wednesday February 19, 2014')).onOrBefore(6).greg() // Sat Feb 15 2014
607
- new HDate(new Date('Saturday February 22, 2014')).onOrBefore(6).greg() // Sat Feb 22 2014
608
- new HDate(new Date('Sunday February 23, 2014')).onOrBefore(6).greg() // Sat Feb 22 2014
609
- ```
610
- <a name="HDate+nearest"></a>
611
-
612
- ### hDate.nearest(dow) ⇒ [<code>HDate</code>](#HDate)
613
- Returns an `HDate` representing the nearest dayNumber to the current date
614
- Sunday=0, Saturday=6
615
-
616
- **Kind**: instance method of [<code>HDate</code>](#HDate)
617
-
618
- | Param | Type | Description |
619
- | --- | --- | --- |
620
- | dow | <code>number</code> | day of week |
621
-
622
- **Example**
623
- ```js
624
- new HDate(new Date('Wednesday February 19, 2014')).nearest(6).greg() // Sat Feb 22 2014
625
- new HDate(new Date('Tuesday February 18, 2014')).nearest(6).greg() // Sat Feb 15 2014
626
- ```
627
- <a name="HDate+onOrAfter"></a>
628
-
629
- ### hDate.onOrAfter(dow) ⇒ [<code>HDate</code>](#HDate)
630
- Returns an `HDate` representing the a dayNumber on or after the current date.
631
- Sunday=0, Saturday=6
632
-
633
- **Kind**: instance method of [<code>HDate</code>](#HDate)
634
-
635
- | Param | Type | Description |
636
- | --- | --- | --- |
637
- | dow | <code>number</code> | day of week |
638
-
639
- **Example**
640
- ```js
641
- new HDate(new Date('Wednesday February 19, 2014')).onOrAfter(6).greg() // Sat Feb 22 2014
642
- new HDate(new Date('Saturday February 22, 2014')).onOrAfter(6).greg() // Sat Feb 22 2014
643
- new HDate(new Date('Sunday February 23, 2014')).onOrAfter(6).greg() // Sat Mar 01 2014
644
- ```
645
- <a name="HDate+after"></a>
646
-
647
- ### hDate.after(dow) ⇒ [<code>HDate</code>](#HDate)
648
- Returns an `HDate` representing the a dayNumber after the current date.
649
- Sunday=0, Saturday=6
650
-
651
- **Kind**: instance method of [<code>HDate</code>](#HDate)
652
-
653
- | Param | Type | Description |
654
- | --- | --- | --- |
655
- | dow | <code>number</code> | day of week |
656
-
657
- **Example**
658
- ```js
659
- new HDate(new Date('Wednesday February 19, 2014')).after(6).greg() // Sat Feb 22 2014
660
- new HDate(new Date('Saturday February 22, 2014')).after(6).greg() // Sat Mar 01 2014
661
- new HDate(new Date('Sunday February 23, 2014')).after(6).greg() // Sat Mar 01 2014
662
- ```
663
- <a name="HDate+next"></a>
664
-
665
- ### hDate.next() ⇒ [<code>HDate</code>](#HDate)
666
- Returns the next Hebrew date
667
-
668
- **Kind**: instance method of [<code>HDate</code>](#HDate)
669
- <a name="HDate+prev"></a>
670
-
671
- ### hDate.prev() ⇒ [<code>HDate</code>](#HDate)
672
- Returns the previous Hebrew date
673
-
674
- **Kind**: instance method of [<code>HDate</code>](#HDate)
675
- <a name="HDate+add"></a>
676
-
677
- ### hDate.add(amount, [units]) ⇒ [<code>HDate</code>](#HDate)
678
- Returns a cloned `HDate` object with a specified amount of time added
679
-
680
- Units are case insensitive, and support plural and short forms.
681
- Note, short forms are case sensitive.
682
-
683
- | Unit | Shorthand | Description
684
- | --- | --- | --- |
685
- | `day` | `d` | days |
686
- | `week` | `w` | weeks |
687
- | `month` | `M` | months |
688
- | `year` | `y` | years |
689
-
690
- **Kind**: instance method of [<code>HDate</code>](#HDate)
691
-
692
- | Param | Type | Default |
693
- | --- | --- | --- |
694
- | amount | <code>number</code> | |
695
- | [units] | <code>string</code> | <code>&quot;d&quot;</code> |
696
-
697
- <a name="HDate+subtract"></a>
698
-
699
- ### hDate.subtract(amount, [units]) ⇒ [<code>HDate</code>](#HDate)
700
- Returns a cloned `HDate` object with a specified amount of time subracted
701
-
702
- Units are case insensitive, and support plural and short forms.
703
- Note, short forms are case sensitive.
704
-
705
- | Unit | Shorthand | Description
706
- | --- | --- | --- |
707
- | `day` | `d` | days |
708
- | `week` | `w` | weeks |
709
- | `month` | `M` | months |
710
- | `year` | `y` | years |
711
-
712
- **Kind**: instance method of [<code>HDate</code>](#HDate)
713
-
714
- | Param | Type | Default |
715
- | --- | --- | --- |
716
- | amount | <code>number</code> | |
717
- | [units] | <code>string</code> | <code>&quot;d&quot;</code> |
718
-
719
- **Example**
720
- ```js
721
- import {HDate, months} from '@hebcal/hdate';
722
-
723
- const hd1 = new HDate(15, months.CHESHVAN, 5769);
724
- const hd2 = hd1.add(1, 'weeks'); // 7 Kislev 5769
725
- const hd3 = hd1.add(-3, 'M'); // 30 Av 5768
726
- ```
727
- <a name="HDate+deltaDays"></a>
728
-
729
- ### hDate.deltaDays(other) ⇒ <code>number</code>
730
- Returns the difference in days between the two given HDates.
731
-
732
- The result is positive if `this` date is comes chronologically
733
- after the `other` date, and negative
734
- if the order of the two dates is reversed.
735
-
736
- The result is zero if the two dates are identical.
737
-
738
- **Kind**: instance method of [<code>HDate</code>](#HDate)
739
-
740
- | Param | Type | Description |
741
- | --- | --- | --- |
742
- | other | [<code>HDate</code>](#HDate) | Hebrew date to compare |
743
-
744
- **Example**
745
- ```js
746
- import {HDate, months} from '@hebcal/hdate';
747
-
748
- const hd1 = new HDate(25, months.KISLEV, 5770);
749
- const hd2 = new HDate(15, months.CHESHVAN, 5769);
750
- const days = hd1.deltaDays(hd2); // 394
751
- ```
752
- <a name="HDate+isSameDate"></a>
753
-
754
- ### hDate.isSameDate(other) ⇒ <code>boolean</code>
755
- Compares this date to another date, returning `true` if the dates match.
756
-
757
- **Kind**: instance method of [<code>HDate</code>](#HDate)
758
-
759
- | Param | Type | Description |
760
- | --- | --- | --- |
761
- | other | [<code>HDate</code>](#HDate) | Hebrew date to compare |
762
-
763
- <a name="HDate+toString"></a>
764
-
765
- ### hDate.toString() ⇒ <code>string</code>
766
- **Kind**: instance method of [<code>HDate</code>](#HDate)
767
- <a name="HDate.hebrew2abs"></a>
768
-
769
- ### HDate.hebrew2abs(year, month, day) ⇒ <code>number</code>
770
- Converts Hebrew date to R.D. (Rata Die) fixed days.
771
- R.D. 1 is the imaginary date Monday, January 1, 1 on the Gregorian
772
- Calendar.
773
-
774
- **Kind**: static method of [<code>HDate</code>](#HDate)
775
-
776
- | Param | Type | Description |
777
- | --- | --- | --- |
778
- | year | <code>number</code> | Hebrew year |
779
- | month | <code>number</code> | Hebrew month |
780
- | day | <code>number</code> | Hebrew date (1-30) |
781
-
782
- <a name="HDate.isLeapYear"></a>
783
-
784
- ### HDate.isLeapYear(year) ⇒ <code>boolean</code>
785
- Returns true if Hebrew year is a leap year
786
-
787
- **Kind**: static method of [<code>HDate</code>](#HDate)
788
-
789
- | Param | Type | Description |
790
- | --- | --- | --- |
791
- | year | <code>number</code> | Hebrew year |
792
-
793
- <a name="HDate.monthsInYear"></a>
794
-
795
- ### HDate.monthsInYear(year) ⇒ <code>number</code>
796
- Number of months in this Hebrew year (either 12 or 13 depending on leap year)
797
-
798
- **Kind**: static method of [<code>HDate</code>](#HDate)
799
-
800
- | Param | Type | Description |
801
- | --- | --- | --- |
802
- | year | <code>number</code> | Hebrew year |
803
-
804
- <a name="HDate.daysInMonth"></a>
805
-
806
- ### HDate.daysInMonth(month, year) ⇒ <code>number</code>
807
- Number of days in Hebrew month in a given year (29 or 30)
808
-
809
- **Kind**: static method of [<code>HDate</code>](#HDate)
810
-
811
- | Param | Type | Description |
812
- | --- | --- | --- |
813
- | month | <code>number</code> | Hebrew month (e.g. months.TISHREI) |
814
- | year | <code>number</code> | Hebrew year |
815
-
816
- <a name="HDate.getMonthName"></a>
817
-
818
- ### HDate.getMonthName(month, year) ⇒ <code>string</code>
819
- Returns a transliterated string name of Hebrew month in year,
820
- for example 'Elul' or 'Cheshvan'.
821
-
822
- **Kind**: static method of [<code>HDate</code>](#HDate)
823
-
824
- | Param | Type | Description |
825
- | --- | --- | --- |
826
- | month | <code>number</code> | Hebrew month (e.g. months.TISHREI) |
827
- | year | <code>number</code> | Hebrew year |
828
-
829
- <a name="HDate.monthNum"></a>
830
-
831
- ### HDate.monthNum(month) ⇒ <code>number</code>
832
- Returns the Hebrew month number (NISAN=1, TISHREI=7)
833
-
834
- **Kind**: static method of [<code>HDate</code>](#HDate)
835
-
836
- | Param | Type | Description |
837
- | --- | --- | --- |
838
- | month | <code>number</code> \| <code>string</code> | A number, or Hebrew month name string |
839
-
840
- <a name="HDate.daysInYear"></a>
841
-
842
- ### HDate.daysInYear(year) ⇒ <code>number</code>
843
- Number of days in the hebrew YEAR
844
-
845
- **Kind**: static method of [<code>HDate</code>](#HDate)
846
-
847
- | Param | Type | Description |
848
- | --- | --- | --- |
849
- | year | <code>number</code> | Hebrew year |
850
-
851
- <a name="HDate.longCheshvan"></a>
852
-
853
- ### HDate.longCheshvan(year) ⇒ <code>boolean</code>
854
- true if Cheshvan is long in Hebrew year
855
-
856
- **Kind**: static method of [<code>HDate</code>](#HDate)
857
-
858
- | Param | Type | Description |
859
- | --- | --- | --- |
860
- | year | <code>number</code> | Hebrew year |
861
-
862
- <a name="HDate.shortKislev"></a>
863
-
864
- ### HDate.shortKislev(year) ⇒ <code>boolean</code>
865
- true if Kislev is short in Hebrew year
866
-
867
- **Kind**: static method of [<code>HDate</code>](#HDate)
868
-
869
- | Param | Type | Description |
870
- | --- | --- | --- |
871
- | year | <code>number</code> | Hebrew year |
872
-
873
- <a name="HDate.monthFromName"></a>
874
-
875
- ### HDate.monthFromName(monthName) ⇒ <code>number</code>
876
- Converts Hebrew month string name to numeric
877
-
878
- **Kind**: static method of [<code>HDate</code>](#HDate)
879
-
880
- | Param | Type | Description |
881
- | --- | --- | --- |
882
- | monthName | <code>string</code> \| <code>number</code> | monthName |
883
-
884
- <a name="HDate.dayOnOrBefore"></a>
885
-
886
- ### HDate.dayOnOrBefore(dayOfWeek, absdate) ⇒ <code>number</code>
887
- Note: Applying this function to d+6 gives us the DAYNAME on or after an
888
- absolute day d. Similarly, applying it to d+3 gives the DAYNAME nearest to
889
- absolute date d, applying it to d-1 gives the DAYNAME previous to absolute
890
- date d, and applying it to d+7 gives the DAYNAME following absolute date d.
891
-
892
- **Kind**: static method of [<code>HDate</code>](#HDate)
893
-
894
- | Param | Type |
895
- | --- | --- |
896
- | dayOfWeek | <code>number</code> |
897
- | absdate | <code>number</code> |
898
-
899
- <a name="HDate.isHDate"></a>
900
-
901
- ### HDate.isHDate(obj) ⇒ <code>boolean</code>
902
- Tests if the object is an instance of `HDate`
903
-
904
- **Kind**: static method of [<code>HDate</code>](#HDate)
905
-
906
- | Param | Type |
907
- | --- | --- |
908
- | obj | <code>any</code> |
909
-
910
- <a name="HDate.fromGematriyaString"></a>
911
-
912
- ### HDate.fromGematriyaString(str, currentThousands) ⇒ [<code>HDate</code>](#HDate)
913
- Construct a new instance of `HDate` from a Gematriya-formatted string
914
-
915
- **Kind**: static method of [<code>HDate</code>](#HDate)
916
-
917
- | Param | Type | Default |
918
- | --- | --- | --- |
919
- | str | <code>string</code> | |
920
- | currentThousands | <code>number</code> | <code>5000</code> |
921
-
922
- **Example**
923
- ```js
924
- HDate.fromGematriyaString('כ״ז בְּתַמּוּז תשפ״ג') // 27 Tamuz 5783
925
- HDate.fromGematriyaString('כ׳ סיון תש״ד') // 20 Sivan 5704
926
- HDate.fromGematriyaString('ה׳ אִיָיר תש״ח') // 5 Iyyar 5708
927
- ```
928
- <a name="Event"></a>
929
-
930
- ## Event
931
- Represents an Event with a title, date, and flags
932
-
933
- **Kind**: global class
934
-
935
- * [Event](#Event)
936
- * [new Event(date, desc, [mask], [attrs])](#new_Event_new)
937
- * [.getDate()](#Event+getDate) ⇒ [<code>HDate</code>](#HDate)
938
- * [.getDesc()](#Event+getDesc) ⇒ <code>string</code>
939
- * [.getFlags()](#Event+getFlags) ⇒ <code>number</code>
940
- * [.render([locale])](#Event+render) ⇒ <code>string</code>
941
- * [.renderBrief([locale])](#Event+renderBrief) ⇒ <code>string</code>
942
- * [.getEmoji()](#Event+getEmoji) ⇒ <code>string</code> \| <code>null</code>
943
- * [.basename()](#Event+basename) ⇒ <code>string</code>
944
- * [.url()](#Event+url) ⇒ <code>string</code> \| <code>undefined</code>
945
- * [.observedInIsrael()](#Event+observedInIsrael) ⇒ <code>boolean</code>
946
- * [.observedInDiaspora()](#Event+observedInDiaspora) ⇒ <code>boolean</code>
947
- * [.observedIn(il)](#Event+observedIn) ⇒ <code>boolean</code>
948
- * [.clone()](#Event+clone) ⇒ [<code>Event</code>](#Event)
949
- * [.getCategories()](#Event+getCategories) ⇒ <code>Array.&lt;string&gt;</code>
950
-
951
- <a name="new_Event_new"></a>
952
-
953
- ### new Event(date, desc, [mask], [attrs])
954
- Constructs Event
955
-
956
-
957
- | Param | Type | Default | Description |
958
- | --- | --- | --- | --- |
959
- | date | [<code>HDate</code>](#HDate) | | Hebrew date event occurs |
960
- | desc | <code>string</code> | | Description (not translated) |
961
- | [mask] | <code>number</code> | <code>0</code> | optional bitmask of holiday flags (see [flags](#flags)) |
962
- | [attrs] | <code>Object</code> | <code>{}</code> | optional additional attributes (e.g. `eventTimeStr`, `cholHaMoedDay`) |
963
-
964
- <a name="Event+getDate"></a>
965
-
966
- ### event.getDate() ⇒ [<code>HDate</code>](#HDate)
967
- Hebrew date of this event
968
-
969
- **Kind**: instance method of [<code>Event</code>](#Event)
970
- <a name="Event+getDesc"></a>
971
-
972
- ### event.getDesc() ⇒ <code>string</code>
973
- Untranslated description of this event
974
-
975
- **Kind**: instance method of [<code>Event</code>](#Event)
976
- <a name="Event+getFlags"></a>
977
-
978
- ### event.getFlags() ⇒ <code>number</code>
979
- Bitmask of optional event flags. See [flags](#flags)
980
-
981
- **Kind**: instance method of [<code>Event</code>](#Event)
982
- <a name="Event+render"></a>
983
-
984
- ### event.render([locale]) ⇒ <code>string</code>
985
- Returns (translated) description of this event
986
-
987
- **Kind**: instance method of [<code>Event</code>](#Event)
988
-
989
- | Param | Type | Description |
990
- | --- | --- | --- |
991
- | [locale] | <code>string</code> | Optional locale name (defaults to active locale). |
992
-
993
- **Example**
994
- ```js
995
- const ev = new Event(new HDate(6, 'Sivan', 5749), 'Shavuot', flags.CHAG);
996
- ev.render('en'); // 'Shavuot'
997
- ev.render('he'); // 'שָׁבוּעוֹת'
998
- ev.render('ashkenazi'); // 'Shavuos'
999
- ```
1000
- <a name="Event+renderBrief"></a>
1001
-
1002
- ### event.renderBrief([locale]) ⇒ <code>string</code>
1003
- Returns a brief (translated) description of this event.
1004
- For most events, this is the same as render(). For some events, it procudes
1005
- a shorter text (e.g. without a time or added description).
1006
-
1007
- **Kind**: instance method of [<code>Event</code>](#Event)
1008
-
1009
- | Param | Type | Description |
1010
- | --- | --- | --- |
1011
- | [locale] | <code>string</code> | Optional locale name (defaults to active locale). |
1012
-
1013
- <a name="Event+getEmoji"></a>
1014
-
1015
- ### event.getEmoji() ⇒ <code>string</code> \| <code>null</code>
1016
- Optional holiday-specific Emoji or `null`.
1017
-
1018
- **Kind**: instance method of [<code>Event</code>](#Event)
1019
- <a name="Event+basename"></a>
1020
-
1021
- ### event.basename() ⇒ <code>string</code>
1022
- Returns a simplified (untranslated) description for this event. For example,
1023
- the [HolidayEvent](#HolidayEvent) class supports
1024
- "Erev Pesach" => "Pesach", and "Sukkot III (CH''M)" => "Sukkot".
1025
- For many holidays the basename and the event description are the same.
1026
-
1027
- **Kind**: instance method of [<code>Event</code>](#Event)
1028
- <a name="Event+url"></a>
1029
-
1030
- ### event.url() ⇒ <code>string</code> \| <code>undefined</code>
1031
- Returns a URL to hebcal.com or sefaria.org for more detail on the event.
1032
- Returns `undefined` for events with no detail page.
1033
-
1034
- **Kind**: instance method of [<code>Event</code>](#Event)
1035
- <a name="Event+observedInIsrael"></a>
1036
-
1037
- ### event.observedInIsrael() ⇒ <code>boolean</code>
1038
- Is this event observed in Israel?
1039
-
1040
- **Kind**: instance method of [<code>Event</code>](#Event)
1041
- **Example**
1042
- ```js
1043
- const ev1 = new Event(new HDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY);
1044
- ev1.observedInIsrael(); // false
1045
- const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);
1046
- ev2.observedInIsrael(); // true
1047
- ```
1048
- <a name="Event+observedInDiaspora"></a>
1049
-
1050
- ### event.observedInDiaspora() ⇒ <code>boolean</code>
1051
- Is this event observed in the Diaspora?
1052
-
1053
- **Kind**: instance method of [<code>Event</code>](#Event)
1054
- **Example**
1055
- ```js
1056
- const ev1 = new Event(new HDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY);
1057
- ev1.observedInDiaspora(); // true
1058
- const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);
1059
- ev2.observedInDiaspora(); // true
1060
- ```
1061
- <a name="Event+observedIn"></a>
1062
-
1063
- ### event.observedIn(il) ⇒ <code>boolean</code>
1064
- Is this event observed in Israel/Diaspora?
1065
-
1066
- **Kind**: instance method of [<code>Event</code>](#Event)
1067
-
1068
- | Param | Type |
1069
- | --- | --- |
1070
- | il | <code>boolean</code> |
1071
-
1072
- **Example**
1073
- ```js
1074
- const ev1 = new Event(new HDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY);
1075
- ev1.observedIn(false); // true
1076
- ev1.observedIn(true); // false
1077
- const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);
1078
- ev2.observedIn(false); // true
1079
- ev2.observedIn(true); // true
1080
- ```
1081
- <a name="Event+clone"></a>
1082
-
1083
- ### event.clone() ⇒ [<code>Event</code>](#Event)
1084
- Makes a clone of this Event object
1085
-
1086
- **Kind**: instance method of [<code>Event</code>](#Event)
1087
- <a name="Event+getCategories"></a>
1088
-
1089
- ### event.getCategories() ⇒ <code>Array.&lt;string&gt;</code>
1090
- Returns a list of event categories
1091
-
1092
- **Kind**: instance method of [<code>Event</code>](#Event)
1093
- <a name="HebrewDateEvent"></a>
1094
-
1095
- ## HebrewDateEvent
1096
- Daily Hebrew date ("11th of Sivan, 5780")
1097
-
1098
- **Kind**: global class
1099
-
1100
- * [HebrewDateEvent](#HebrewDateEvent)
1101
- * [new HebrewDateEvent(date)](#new_HebrewDateEvent_new)
1102
- * [.render([locale])](#HebrewDateEvent+render) ⇒ <code>string</code>
1103
- * [.renderBrief([locale])](#HebrewDateEvent+renderBrief) ⇒ <code>string</code>
1104
-
1105
- <a name="new_HebrewDateEvent_new"></a>
1106
-
1107
- ### new HebrewDateEvent(date)
1108
-
1109
- | Param | Type |
1110
- | --- | --- |
1111
- | date | [<code>HDate</code>](#HDate) |
1112
-
1113
- <a name="HebrewDateEvent+render"></a>
1114
-
1115
- ### hebrewDateEvent.render([locale]) ⇒ <code>string</code>
1116
- **Kind**: instance method of [<code>HebrewDateEvent</code>](#HebrewDateEvent)
1117
-
1118
- | Param | Type | Description |
1119
- | --- | --- | --- |
1120
- | [locale] | <code>string</code> | Optional locale name (defaults to active locale). |
1121
-
1122
- **Example**
1123
- ```js
1124
- import {HDate, HebrewDateEvent, months} from '@hebcal/core';
1125
-
1126
- const hd = new HDate(15, months.CHESHVAN, 5769);
1127
- const ev = new HebrewDateEvent(hd);
1128
- console.log(ev.render('en')); // '15th of Cheshvan, 5769'
1129
- console.log(ev.render('he')); // 'ט״ו חֶשְׁוָן תשס״ט'
1130
- ```
1131
- <a name="HebrewDateEvent+renderBrief"></a>
1132
-
1133
- ### hebrewDateEvent.renderBrief([locale]) ⇒ <code>string</code>
1134
- **Kind**: instance method of [<code>HebrewDateEvent</code>](#HebrewDateEvent)
1135
-
1136
- | Param | Type | Description |
1137
- | --- | --- | --- |
1138
- | [locale] | <code>string</code> | Optional locale name (defaults to active locale). |
1139
-
1140
- **Example**
1141
- ```js
1142
- import {HDate, HebrewDateEvent, months} from '@hebcal/core';
1143
-
1144
- const hd = new HDate(15, months.CHESHVAN, 5769);
1145
- const ev = new HebrewDateEvent(hd);
1146
- console.log(ev.renderBrief()); // '15th of Cheshvan'
1147
- console.log(ev.renderBrief('he')); // 'ט״ו חֶשְׁוָן'
1148
- ```
1149
- <a name="GeoLocation"></a>
1150
-
1151
- ## GeoLocation
1152
- A class that contains location information such as latitude and longitude required for astronomical calculations. The
1153
- elevation field may not be used by some calculation engines and would be ignored if set.
1154
-
1155
- **Kind**: global class
1156
- **Version**: 1.1
1157
- **Author**: &copy; Eliyahu Hershfeld 2004 - 2016
1158
-
1159
- * [GeoLocation](#GeoLocation)
1160
- * [new GeoLocation(name, latitude, longitude, elevation, timeZoneId)](#new_GeoLocation_new)
1161
- * [.getElevation()](#GeoLocation+getElevation) ⇒ <code>number</code>
1162
- * [.setElevation(elevation)](#GeoLocation+setElevation)
1163
- * [.getLatitude()](#GeoLocation+getLatitude) ⇒ <code>number</code>
1164
- * [.getLongitude()](#GeoLocation+getLongitude) ⇒ <code>number</code>
1165
- * [.getLocationName()](#GeoLocation+getLocationName) ⇒ <code>string</code> \| <code>null</code>
1166
- * [.setLocationName(name)](#GeoLocation+setLocationName)
1167
- * [.getTimeZone()](#GeoLocation+getTimeZone) ⇒ <code>string</code>
1168
- * [.setTimeZone(timeZoneId)](#GeoLocation+setTimeZone)
1169
-
1170
- <a name="new_GeoLocation_new"></a>
1171
-
1172
- ### new GeoLocation(name, latitude, longitude, elevation, timeZoneId)
1173
- GeoLocation constructor with parameters for all required fields.
1174
-
1175
-
1176
- | Param | Type | Description |
1177
- | --- | --- | --- |
1178
- | name | <code>string</code> | The location name for display use such as &quot;Lakewood, NJ&quot; |
1179
- | 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. |
1180
- | longitude | <code>number</code> | double the longitude in a double format such as -74.222130 for Lakewood, NJ. <b>Note: </b> For longitudes west of the <a href="http://en.wikipedia.org/wiki/Prime_Meridian">Prime Meridian </a> (Greenwich), a negative value should be used. |
1181
- | elevation | <code>number</code> | the elevation above sea level in Meters. Elevation is not used in most algorithms used for calculating sunrise and set. |
1182
- | timeZoneId | <code>string</code> | the <code>TimeZone</code> for the location. |
1183
-
1184
- <a name="GeoLocation+getElevation"></a>
1185
-
1186
- ### geoLocation.getElevation() ⇒ <code>number</code>
1187
- Method to get the elevation in Meters.
1188
-
1189
- **Kind**: instance method of [<code>GeoLocation</code>](#GeoLocation)
1190
- **Returns**: <code>number</code> - Returns the elevation in Meters.
1191
- <a name="GeoLocation+setElevation"></a>
1192
-
1193
- ### geoLocation.setElevation(elevation)
1194
- Method to set the elevation in Meters <b>above </b> sea level.
1195
-
1196
- **Kind**: instance method of [<code>GeoLocation</code>](#GeoLocation)
1197
-
1198
- | Param | Type | Description |
1199
- | --- | --- | --- |
1200
- | elevation | <code>number</code> | The elevation to set in Meters. An Error will be thrown if the value is a negative. |
1201
-
1202
- <a name="GeoLocation+getLatitude"></a>
1203
-
1204
- ### geoLocation.getLatitude() ⇒ <code>number</code>
1205
- **Kind**: instance method of [<code>GeoLocation</code>](#GeoLocation)
1206
- **Returns**: <code>number</code> - Returns the latitude.
1207
- <a name="GeoLocation+getLongitude"></a>
1208
-
1209
- ### geoLocation.getLongitude() ⇒ <code>number</code>
1210
- **Kind**: instance method of [<code>GeoLocation</code>](#GeoLocation)
1211
- **Returns**: <code>number</code> - Returns the longitude.
1212
- <a name="GeoLocation+getLocationName"></a>
1213
-
1214
- ### geoLocation.getLocationName() ⇒ <code>string</code> \| <code>null</code>
1215
- **Kind**: instance method of [<code>GeoLocation</code>](#GeoLocation)
1216
- **Returns**: <code>string</code> \| <code>null</code> - Returns the location name.
1217
- <a name="GeoLocation+setLocationName"></a>
1218
-
1219
- ### geoLocation.setLocationName(name)
1220
- **Kind**: instance method of [<code>GeoLocation</code>](#GeoLocation)
1221
-
1222
- | Param | Type | Description |
1223
- | --- | --- | --- |
1224
- | name | <code>string</code> \| <code>null</code> | The setter method for the display name. |
1225
-
1226
- <a name="GeoLocation+getTimeZone"></a>
1227
-
1228
- ### geoLocation.getTimeZone() ⇒ <code>string</code>
1229
- **Kind**: instance method of [<code>GeoLocation</code>](#GeoLocation)
1230
- **Returns**: <code>string</code> - Returns the timeZone.
1231
- <a name="GeoLocation+setTimeZone"></a>
1232
-
1233
- ### geoLocation.setTimeZone(timeZoneId)
1234
- Method to set the TimeZone.
1235
-
1236
- **Kind**: instance method of [<code>GeoLocation</code>](#GeoLocation)
1237
-
1238
- | Param | Type | Description |
1239
- | --- | --- | --- |
1240
- | timeZoneId | <code>string</code> | The timeZone to set. |
1241
-
1242
- <a name="NOAACalculator"></a>
1243
-
1244
- ## NOAACalculator
1245
- Implementation of sunrise and sunset methods to calculate astronomical times based on the <a
1246
- href="http://noaa.gov">NOAA</a> algorithm. This calculator uses the Java algorithm based on the implementation by <a
1247
- href="http://noaa.gov">NOAA - National Oceanic and Atmospheric Administration</a>'s <a href =
1248
- "http://www.srrb.noaa.gov/highlights/sunrise/sunrise.html">Surface Radiation Research Branch</a>. NOAA's <a
1249
- href="http://www.srrb.noaa.gov/highlights/sunrise/solareqns.PDF">implementation</a> is based on equations from <a
1250
- href="http://www.willbell.com/math/mc1.htm">Astronomical Algorithms</a> by <a
1251
- href="http://en.wikipedia.org/wiki/Jean_Meeus">Jean Meeus</a>. Added to the algorithm is an adjustment of the zenith
1252
- to account for elevation. The algorithm can be found in the <a
1253
- href="http://en.wikipedia.org/wiki/Sunrise_equation">Wikipedia Sunrise Equation</a> article.
1254
-
1255
- **Kind**: global class
1256
- **Author**: &copy; Eliyahu Hershfeld 2011 - 2019
1257
-
1258
- * [NOAACalculator](#NOAACalculator)
1259
- * [new NOAACalculator(geoLocation, date)](#new_NOAACalculator_new)
1260
- * _instance_
1261
- * [.getSunrise()](#NOAACalculator+getSunrise) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
1262
- * [.getSeaLevelSunrise()](#NOAACalculator+getSeaLevelSunrise) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
1263
- * [.getBeginCivilTwilight()](#NOAACalculator+getBeginCivilTwilight) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
1264
- * [.getBeginNauticalTwilight()](#NOAACalculator+getBeginNauticalTwilight) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
1265
- * [.getBeginAstronomicalTwilight()](#NOAACalculator+getBeginAstronomicalTwilight) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
1266
- * [.getSunset()](#NOAACalculator+getSunset) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
1267
- * [.getSeaLevelSunset()](#NOAACalculator+getSeaLevelSunset) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
1268
- * [.getEndCivilTwilight()](#NOAACalculator+getEndCivilTwilight) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
1269
- * [.getEndNauticalTwilight()](#NOAACalculator+getEndNauticalTwilight) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
1270
- * [.getEndAstronomicalTwilight()](#NOAACalculator+getEndAstronomicalTwilight) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
1271
- * [.getSunriseOffsetByDegrees(offsetZenith)](#NOAACalculator+getSunriseOffsetByDegrees) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
1272
- * [.getSunsetOffsetByDegrees(offsetZenith)](#NOAACalculator+getSunsetOffsetByDegrees) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
1273
- * [.getUTCSunrise0(zenith)](#NOAACalculator+getUTCSunrise0) ⇒ <code>number</code>
1274
- * [.getUTCSeaLevelSunrise(zenith)](#NOAACalculator+getUTCSeaLevelSunrise) ⇒ <code>number</code>
1275
- * [.getUTCSunset0(zenith)](#NOAACalculator+getUTCSunset0) ⇒ <code>number</code>
1276
- * [.getUTCSeaLevelSunset(zenith)](#NOAACalculator+getUTCSeaLevelSunset) ⇒ <code>number</code>
1277
- * [.getElevationAdjustment(elevation)](#NOAACalculator+getElevationAdjustment) ⇒ <code>number</code>
1278
- * [.adjustZenith(zenith, elevation)](#NOAACalculator+adjustZenith) ⇒ <code>number</code>
1279
- * [.getUTCSunrise(date, geoLocation, zenith, adjustForElevation)](#NOAACalculator+getUTCSunrise) ⇒
1280
- * [.getUTCSunset(date, geoLocation, zenith, adjustForElevation)](#NOAACalculator+getUTCSunset) ⇒
1281
- * [.getTemporalHour(startOfDay, endOfDay)](#NOAACalculator+getTemporalHour) ⇒ <code>number</code>
1282
- * [.getSunTransit(startOfDay, endOfDay)](#NOAACalculator+getSunTransit) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
1283
- * [.getDateFromTime(time, isSunrise)](#NOAACalculator+getDateFromTime) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
1284
- * _static_
1285
- * [.CIVIL_ZENITH](#NOAACalculator.CIVIL_ZENITH)
1286
- * [.NAUTICAL_ZENITH](#NOAACalculator.NAUTICAL_ZENITH)
1287
- * [.ASTRONOMICAL_ZENITH](#NOAACalculator.ASTRONOMICAL_ZENITH)
1288
- * [.getTimeOffset(time, offset)](#NOAACalculator.getTimeOffset) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
1289
- * [.getSolarElevation(date, lat, lon)](#NOAACalculator.getSolarElevation) ⇒ <code>number</code>
1290
- * [.getSolarAzimuth(date, latitude, lon)](#NOAACalculator.getSolarAzimuth) ⇒ <code>number</code>
1291
-
1292
- <a name="new_NOAACalculator_new"></a>
1293
-
1294
- ### new NOAACalculator(geoLocation, date)
1295
- A constructor that takes in <a href="http://en.wikipedia.org/wiki/Geolocation">geolocation</a> information as a
1296
- parameter.
1297
-
1298
-
1299
- | Param | Type | Description |
1300
- | --- | --- | --- |
1301
- | geoLocation | [<code>GeoLocation</code>](#GeoLocation) | The location information used for calculating astronomical sun times. |
1302
- | date | <code>Temporal.PlainDate</code> | |
1303
-
1304
- <a name="NOAACalculator+getSunrise"></a>
1305
-
1306
- ### noaaCalculator.getSunrise() ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
1307
- The getSunrise method Returns a `Date` representing the
1308
- [elevation adjusted](getElevationAdjustment) sunrise time. The zenith used
1309
- for the calculation uses [geometric zenith](GEOMETRIC_ZENITH) of 90&deg; plus
1310
- [getElevationAdjustment](getElevationAdjustment). This is adjusted
1311
- to add approximately 50/60 of a degree to account for 34 archminutes of refraction
1312
- and 16 archminutes for the sun's radius for a total of [90.83333&deg;](adjustZenith).
1313
-
1314
- **Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
1315
- **Returns**: <code>Temporal.ZonedDateTime</code> \| <code>null</code> - the `Date` representing the exact sunrise time. If the calculation can't be computed such as
1316
- in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
1317
- does not set, a null will be returned. See detailed explanation on top of the page.
1318
- **See**
1319
-
1320
- - adjustZenith
1321
- - getSeaLevelSunrise()
1322
- - getUTCSunrise
1323
-
1324
- <a name="NOAACalculator+getSeaLevelSunrise"></a>
1325
-
1326
- ### noaaCalculator.getSeaLevelSunrise() ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
1327
- A method that returns the sunrise without [elevation
1328
- adjustment](getElevationAdjustment). Non-sunrise and sunset calculations such as dawn and dusk, depend on the amount of visible light,
1329
- something that is not affected by elevation. This method returns sunrise calculated at sea level. This forms the
1330
- base for dawn calculations that are calculated as a dip below the horizon before sunrise.
1331
-
1332
- **Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
1333
- **Returns**: <code>Temporal.ZonedDateTime</code> \| <code>null</code> - the `Date` representing the exact sea-level sunrise time. If the calculation can't be computed
1334
- such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
1335
- where it does not set, a null will be returned. See detailed explanation on top of the page.
1336
- **See**
1337
-
1338
- - getSunrise
1339
- - getUTCSeaLevelSunrise
1340
- - getSeaLevelSunset()
1341
-
1342
- <a name="NOAACalculator+getBeginCivilTwilight"></a>
1343
-
1344
- ### noaaCalculator.getBeginCivilTwilight() ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
1345
- A method that returns the beginning of civil twilight (dawn) using a zenith of [96&deg;](CIVIL_ZENITH).
1346
-
1347
- **Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
1348
- **Returns**: <code>Temporal.ZonedDateTime</code> \| <code>null</code> - The `Date` of the beginning of civil twilight using a zenith of 96&deg;. If the calculation
1349
- can't be computed, null will be returned. See detailed explanation on top of the page.
1350
- **See**: CIVIL_ZENITH
1351
- <a name="NOAACalculator+getBeginNauticalTwilight"></a>
1352
-
1353
- ### noaaCalculator.getBeginNauticalTwilight() ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
1354
- A method that returns the beginning of nautical twilight using a zenith of [102&deg;](NAUTICAL_ZENITH).
1355
-
1356
- **Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
1357
- **Returns**: <code>Temporal.ZonedDateTime</code> \| <code>null</code> - The `Date` of the beginning of nautical twilight using a zenith of 102&deg;. If the
1358
- calculation can't be computed null will be returned. See detailed explanation on top of the page.
1359
- **See**: NAUTICAL_ZENITH
1360
- <a name="NOAACalculator+getBeginAstronomicalTwilight"></a>
1361
-
1362
- ### noaaCalculator.getBeginAstronomicalTwilight() ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
1363
- A method that returns the beginning of astronomical twilight using a zenith of [108&deg;](ASTRONOMICAL_ZENITH).
1364
-
1365
- **Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
1366
- **Returns**: <code>Temporal.ZonedDateTime</code> \| <code>null</code> - The `Date` of the beginning of astronomical twilight using a zenith of 108&deg;. If the
1367
- calculation can't be computed, null will be returned. See detailed explanation on top of the page.
1368
- **See**: ASTRONOMICAL_ZENITH
1369
- <a name="NOAACalculator+getSunset"></a>
1370
-
1371
- ### noaaCalculator.getSunset() ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
1372
- The getSunset method Returns a `Date` representing the
1373
- [elevation adjusted](getElevationAdjustment) sunset time. The zenith used for
1374
- the calculation uses [geometric zenith](GEOMETRIC_ZENITH) of 90&deg; plus
1375
- [getElevationAdjustment](getElevationAdjustment). This is adjusted
1376
- to add approximately 50/60 of a degree to account for 34 archminutes of refraction
1377
- and 16 archminutes for the sun's radius for a total of [90.83333&deg;](adjustZenith).
1378
- Note:
1379
- In certain cases the calculates sunset will occur before sunrise. This will typically happen when a timezone
1380
- other than the local timezone is used (calculating Los Angeles sunset using a GMT timezone for example). In this
1381
- case the sunset date will be incremented to the following date.
1382
-
1383
- **Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
1384
- **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
1385
- the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
1386
- does not set, a null will be returned. See detailed explanation on top of the page.
1387
- **See**
1388
-
1389
- - adjustZenith
1390
- - getSeaLevelSunset()
1391
- - getUTCSunset
1392
-
1393
- <a name="NOAACalculator+getSeaLevelSunset"></a>
1394
-
1395
- ### noaaCalculator.getSeaLevelSunset() ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
1396
- A method that returns the sunset without [elevation
1397
- adjustment](getElevationAdjustment). Non-sunrise and sunset calculations such as dawn and dusk, depend on the amount of visible light,
1398
- something that is not affected by elevation. This method returns sunset calculated at sea level. This forms the
1399
- base for dusk calculations that are calculated as a dip below the horizon after sunset.
1400
-
1401
- **Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
1402
- **Returns**: <code>Temporal.ZonedDateTime</code> \| <code>null</code> - The `Date` representing the exact sea-level sunset time. If the calculation can't be computed
1403
- such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
1404
- where it does not set, a null will be returned. See detailed explanation on top of the page.
1405
- **See**
1406
-
1407
- - getSunset
1408
- - getUTCSeaLevelSunset
1409
-
1410
- <a name="NOAACalculator+getEndCivilTwilight"></a>
1411
-
1412
- ### noaaCalculator.getEndCivilTwilight() ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
1413
- A method that returns the end of civil twilight using a zenith of [96&deg;](CIVIL_ZENITH).
1414
-
1415
- **Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
1416
- **Returns**: <code>Temporal.ZonedDateTime</code> \| <code>null</code> - The `Date` of the end of civil twilight using a zenith of [96&deg;](CIVIL_ZENITH). If
1417
- the calculation can't be computed, null will be returned. See detailed explanation on top of the page.
1418
- **See**: CIVIL_ZENITH
1419
- <a name="NOAACalculator+getEndNauticalTwilight"></a>
1420
-
1421
- ### noaaCalculator.getEndNauticalTwilight() ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
1422
- A method that returns the end of nautical twilight using a zenith of [102&deg;](NAUTICAL_ZENITH).
1423
-
1424
- **Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
1425
- **Returns**: <code>Temporal.ZonedDateTime</code> \| <code>null</code> - The `Date` of the end of nautical twilight using a zenith of [102&deg;](NAUTICAL_ZENITH)
1426
- . If the calculation can't be computed, null will be returned. See detailed explanation on top of the
1427
- page.
1428
- **See**: NAUTICAL_ZENITH
1429
- <a name="NOAACalculator+getEndAstronomicalTwilight"></a>
1430
-
1431
- ### noaaCalculator.getEndAstronomicalTwilight() ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
1432
- A method that returns the end of astronomical twilight using a zenith of [108&deg;](ASTRONOMICAL_ZENITH).
1433
-
1434
- **Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
1435
- **Returns**: <code>Temporal.ZonedDateTime</code> \| <code>null</code> - The `Date` of the end of astronomical twilight using a zenith of [108&deg;](ASTRONOMICAL_ZENITH). If the calculation can't be computed, null will be returned. See detailed explanation on top
1436
- of the page.
1437
- **See**: ASTRONOMICAL_ZENITH
1438
- <a name="NOAACalculator+getSunriseOffsetByDegrees"></a>
1439
-
1440
- ### noaaCalculator.getSunriseOffsetByDegrees(offsetZenith) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
1441
- A utility method that returns the time of an offset by degrees below or above the horizon of
1442
- [sunrise](getSunrise()). Note that the degree offset is from the vertical, so for a calculation of 14&deg;
1443
- before sunrise, an offset of 14 + [GEOMETRIC_ZENITH](GEOMETRIC_ZENITH) = 104 would have to be passed as a parameter.
1444
-
1445
- **Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
1446
- **Returns**: <code>Temporal.ZonedDateTime</code> \| <code>null</code> - The `Date` of the offset after (or before) [getSunrise](getSunrise). If the calculation
1447
- can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does
1448
- not rise, and one where it does not set, a null will be returned. See detailed explanation on top of the
1449
- page.
1450
-
1451
- | Param | Type | Description |
1452
- | --- | --- | --- |
1453
- | 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&deg; before sunrise, an offset of 14 + [GEOMETRIC_ZENITH](GEOMETRIC_ZENITH) = 104 would have to be passed as a parameter. |
1454
-
1455
- <a name="NOAACalculator+getSunsetOffsetByDegrees"></a>
1456
-
1457
- ### noaaCalculator.getSunsetOffsetByDegrees(offsetZenith) ⇒ <code>Temporal.ZonedDateTime</code> \| <code>null</code>
1458
- 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&deg; after sunset, an
1459
- offset of 14 + [GEOMETRIC_ZENITH](GEOMETRIC_ZENITH) = 104 would have to be passed as a parameter.
1460
-
1461
- **Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
1462
- **Returns**: <code>Temporal.ZonedDateTime</code> \| <code>null</code> - The `Date`of the offset after (or before) [getSunset](getSunset). If the calculation can't
1463
- be computed such as in the Arctic Circle where there is at least one day a year where the sun does not
1464
- rise, and one where it does not set, a null will be returned. See detailed explanation on top of the
1465
- page.
1466
-
1467
- | Param | Type | Description |
1468
- | --- | --- | --- |
1469
- | 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&deg; after sunset, an offset of 14 + [GEOMETRIC_ZENITH](GEOMETRIC_ZENITH) = 104 would have to be passed as a parameter. |
1470
-
1471
- <a name="NOAACalculator+getUTCSunrise0"></a>
1472
-
1473
- ### noaaCalculator.getUTCSunrise0(zenith) ⇒ <code>number</code>
1474
- A method that returns the sunrise in UTC time without correction for time zone offset from GMT and without using
1475
- daylight savings time.
1476
-
1477
- **Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
1478
- **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
1479
- Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
1480
- not set, `NaN` will be returned. See detailed explanation on top of the page.
1481
-
1482
- | Param | Type | Description |
1483
- | --- | --- | --- |
1484
- | zenith | <code>number</code> | the degrees below the horizon. For time after sunrise use negative numbers. |
1485
-
1486
- <a name="NOAACalculator+getUTCSeaLevelSunrise"></a>
1487
-
1488
- ### noaaCalculator.getUTCSeaLevelSunrise(zenith) ⇒ <code>number</code>
1489
- A method that returns the sunrise in UTC time without correction for time zone offset from GMT and without using
1490
- daylight savings time. Non-sunrise and sunset calculations such as dawn and dusk, depend on the amount of visible
1491
- light, something that is not affected by elevation. This method returns UTC sunrise calculated at sea level. This
1492
- forms the base for dawn calculations that are calculated as a dip below the horizon before sunrise.
1493
-
1494
- **Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
1495
- **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
1496
- Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
1497
- not set, `NaN` will be returned. See detailed explanation on top of the page.
1498
- **See**
1499
-
1500
- - getUTCSunrise
1501
- - getUTCSeaLevelSunset
1502
-
1503
-
1504
- | Param | Type | Description |
1505
- | --- | --- | --- |
1506
- | zenith | <code>number</code> | the degrees below the horizon. For time after sunrise use negative numbers. |
1507
-
1508
- <a name="NOAACalculator+getUTCSunset0"></a>
1509
-
1510
- ### noaaCalculator.getUTCSunset0(zenith) ⇒ <code>number</code>
1511
- A method that returns the sunset in UTC time without correction for time zone offset from GMT and without using
1512
- daylight savings time.
1513
-
1514
- **Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
1515
- **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
1516
- Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
1517
- not set, `NaN` will be returned. See detailed explanation on top of the page.
1518
- **See**: getUTCSeaLevelSunset
1519
-
1520
- | Param | Type | Description |
1521
- | --- | --- | --- |
1522
- | zenith | <code>number</code> | the degrees below the horizon. For time after sunset use negative numbers. |
1523
-
1524
- <a name="NOAACalculator+getUTCSeaLevelSunset"></a>
1525
-
1526
- ### noaaCalculator.getUTCSeaLevelSunset(zenith) ⇒ <code>number</code>
1527
- A method that returns the sunset in UTC time without correction for elevation, time zone offset from GMT and
1528
- without using daylight savings time. Non-sunrise and sunset calculations such as dawn and dusk, depend on the
1529
- amount of visible light, something that is not affected by elevation. This method returns UTC sunset calculated
1530
- at sea level. This forms the base for dusk calculations that are calculated as a dip below the horizon after
1531
- sunset.
1532
-
1533
- **Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
1534
- **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
1535
- Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
1536
- not set, `NaN` will be returned. See detailed explanation on top of the page.
1537
- **See**
1538
-
1539
- - getUTCSunset
1540
- - getUTCSeaLevelSunrise
1541
-
1542
-
1543
- | Param | Type | Description |
1544
- | --- | --- | --- |
1545
- | zenith | <code>number</code> | the degrees below the horizon. For time before sunset use negative numbers. |
1546
-
1547
- <a name="NOAACalculator+getElevationAdjustment"></a>
1548
-
1549
- ### noaaCalculator.getElevationAdjustment(elevation) ⇒ <code>number</code>
1550
- Method to return the adjustment to the zenith required to account for the elevation. Since a person at a higher
1551
- elevation can see farther below the horizon, the calculation for sunrise / sunset is calculated below the horizon
1552
- used at sea level. This is only used for sunrise and sunset and not times before or after it such as
1553
- [nautical twilight](getBeginNauticalTwilight()) since those
1554
- calculations are based on the level of available light at the given dip below the horizon, something that is not
1555
- affected by elevation, the adjustment should only made if the zenith == 90&deg; [adjusted](adjustZenith)
1556
- for refraction and solar radius. The algorithm used is
1557
-
1558
- <pre>
1559
- elevationAdjustment = Math.toDegrees(Math.acos(earthRadiusInMeters / (earthRadiusInMeters + elevationMeters)));
1560
- </pre>
1561
-
1562
- The source of this algorithm is <a href="http://www.calendarists.com">Calendrical Calculations</a> by Edward M.
1563
- Reingold and Nachum Dershowitz. An alternate algorithm that produces an almost identical (but not accurate)
1564
- result found in Ma'aglay Tzedek by Moishe Kosower and other sources is:
1565
-
1566
- <pre>
1567
- elevationAdjustment = 0.0347 * Math.sqrt(elevationMeters);
1568
- </pre>
1569
-
1570
- **Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
1571
- **Returns**: <code>number</code> - the adjusted zenith
1572
-
1573
- | Param | Type | Description |
1574
- | --- | --- | --- |
1575
- | elevation | <code>number</code> | elevation in Meters. |
1576
-
1577
- <a name="NOAACalculator+adjustZenith"></a>
1578
-
1579
- ### noaaCalculator.adjustZenith(zenith, elevation) ⇒ <code>number</code>
1580
- Adjusts the zenith of astronomical sunrise and sunset to account for solar refraction, solar radius and
1581
- elevation. The value for Sun's zenith and true rise/set Zenith (used in this class and subclasses) is the angle
1582
- that the center of the Sun makes to a line perpendicular to the Earth's surface. If the Sun were a point and the
1583
- Earth were without an atmosphere, true sunset and sunrise would correspond to a 90&deg; zenith. Because the Sun
1584
- is not a point, and because the atmosphere refracts light, this 90&deg; zenith does not, in fact, correspond to
1585
- true sunset or sunrise, instead the centre of the Sun's disk must lie just below the horizon for the upper edge
1586
- to be obscured. This means that a zenith of just above 90&deg; must be used. The Sun subtends an angle of 16
1587
- minutes of arc, and atmospheric refraction
1588
- accounts for 34 minutes or so, giving a total
1589
- of 50 arcminutes. The total value for ZENITH is 90+(5/6) or 90.8333333&deg; for true sunrise/sunset. Since a
1590
- person at an elevation can see blow the horizon of a person at sea level, this will also adjust the zenith to
1591
- account for elevation if available. Note that this will only adjust the value if the zenith is exactly 90 degrees.
1592
- For values below and above this no correction is done. As an example, astronomical twilight is when the sun is
1593
- 18&deg; below the horizon or [108&deg;
1594
- below the zenith](ASTRONOMICAL_ZENITH). This is traditionally calculated with none of the above mentioned adjustments. The same goes
1595
- for various <em>tzais</em> and <em>alos</em> times such as the
1596
- [16.1&deg;](ZmanimCalendar#ZENITH_16_POINT_1) dip used in
1597
- [ComplexZmanimCalendar#getAlos16Point1Degrees](ComplexZmanimCalendar#getAlos16Point1Degrees).
1598
-
1599
- **Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
1600
- **Returns**: <code>number</code> - The zenith adjusted to include the sun's radius, refracton
1601
- and [elevation](getElevationAdjustment) adjustment. This will only be adjusted for
1602
- sunrise and sunset (if the zenith == 90&deg;)
1603
- **See**: getElevationAdjustment
1604
-
1605
- | Param | Type | Description |
1606
- | --- | --- | --- |
1607
- | zenith | <code>number</code> | the azimuth below the vertical zenith of 90&deg;. For sunset typically the [zenith](adjustZenith) used for the calculation uses geometric zenith of 90&deg; and [adjusts](adjustZenith) this slightly to account for solar refraction and the sun's radius. Another example would be [getEndNauticalTwilight](getEndNauticalTwilight) that passes [NAUTICAL_ZENITH](NAUTICAL_ZENITH) to this method. |
1608
- | elevation | <code>number</code> | elevation in Meters. |
1609
-
1610
- <a name="NOAACalculator+getUTCSunrise"></a>
1611
-
1612
- ### noaaCalculator.getUTCSunrise(date, geoLocation, zenith, adjustForElevation) ⇒
1613
- A method that calculates UTC sunrise as well as any time based on an angle above or below sunrise.
1614
-
1615
- **Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
1616
- **Returns**: The UTC time of sunrise in 24 hour format. 5:45:00 AM will return 5.75.0. If an error was encountered in
1617
- the calculation (expected behavior for some locations such as near the poles,
1618
- `NaN` will be returned.
1619
-
1620
- | Param | Description |
1621
- | --- | --- |
1622
- | date | Used to calculate day of year. |
1623
- | geoLocation | The location information used for astronomical calculating sun times. |
1624
- | zenith | the azimuth below the vertical zenith of 90 degrees. for sunrise typically the [zenith](adjustZenith) used for the calculation uses geometric zenith of 90&deg; and [adjusts](adjustZenith) this slightly to account for solar refraction and the sun's radius. Another example would be [getBeginNauticalTwilight](getBeginNauticalTwilight) that passes [NAUTICAL_ZENITH](NAUTICAL_ZENITH) to this method. |
1625
- | adjustForElevation | Should the time be adjusted for elevation |
1626
-
1627
- <a name="NOAACalculator+getUTCSunset"></a>
1628
-
1629
- ### noaaCalculator.getUTCSunset(date, geoLocation, zenith, adjustForElevation) ⇒
1630
- A method that calculates UTC sunset as well as any time based on an angle above or below sunset.
1631
-
1632
- **Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
1633
- **Returns**: The UTC time of sunset in 24 hour format. 5:45:00 AM will return 5.75.0. If an error was encountered in
1634
- the calculation (expected behavior for some locations such as near the poles,
1635
- `NaN` will be returned.
1636
-
1637
- | Param | Description |
1638
- | --- | --- |
1639
- | date | Used to calculate day of year. |
1640
- | geoLocation | The location information used for astronomical calculating sun times. |
1641
- | zenith | the azimuth below the vertical zenith of 90&deg;. For sunset typically the [zenith](adjustZenith) used for the calculation uses geometric zenith of 90&deg; and [adjusts](adjustZenith) this slightly to account for solar refraction and the sun's radius. Another example would be [getEndNauticalTwilight](getEndNauticalTwilight) that passes [NAUTICAL_ZENITH](NAUTICAL_ZENITH) to this method. |
1642
- | adjustForElevation | Should the time be adjusted for elevation |
1643
-
1644
- <a name="NOAACalculator+getTemporalHour"></a>
1645
-
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
- `NaN` will be returned. See detailed explanation on top of the page.
1655
- **See**: getTemporalHour()
1656
-
1657
- | Param | Type | Description |
1658
- | --- | --- | --- |
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. |
1661
-
1662
- <a name="NOAACalculator+getSunTransit"></a>
1663
-
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).
1670
-
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.
1675
-
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. |
1680
-
1681
- <a name="NOAACalculator+getDateFromTime"></a>
1682
-
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.
1685
-
1686
- **Kind**: instance method of [<code>NOAACalculator</code>](#NOAACalculator)
1687
- **Returns**: <code>Temporal.ZonedDateTime</code> \| <code>null</code> - The Date.
1688
- **Access**: protected
1689
-
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 |
1694
-
1695
- <a name="NOAACalculator.CIVIL_ZENITH"></a>
1696
-
1697
- ### NOAACalculator.CIVIL\_ZENITH
1698
- Sun's zenith at civil twilight (96&deg;).
1699
-
1700
- **Kind**: static property of [<code>NOAACalculator</code>](#NOAACalculator)
1701
- <a name="NOAACalculator.NAUTICAL_ZENITH"></a>
1702
-
1703
- ### NOAACalculator.NAUTICAL\_ZENITH
1704
- Sun's zenith at nautical twilight (102&deg;).
1705
-
1706
- **Kind**: static property of [<code>NOAACalculator</code>](#NOAACalculator)
1707
- <a name="NOAACalculator.ASTRONOMICAL_ZENITH"></a>
1708
-
1709
- ### NOAACalculator.ASTRONOMICAL\_ZENITH
1710
- Sun's zenith at astronomical twilight (108&deg;).
1711
-
1712
- **Kind**: static property of [<code>NOAACalculator</code>](#NOAACalculator)
1713
- <a name="NOAACalculator.getTimeOffset"></a>
1714
-
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 |
1759
-
1760
- <a name="Location"></a>
1761
-
1762
- ## Location
1763
- Class representing Location
1764
-
1765
- **Kind**: global class
1766
-
1767
- * [Location](#Location)
1768
- * [new Location(latitude, longitude, il, tzid, [cityName], [countryCode], [geoid], [elevation])](#new_Location_new)
1769
- * _instance_
1770
- * [.getIsrael()](#Location+getIsrael) ⇒ <code>boolean</code>
1771
- * [.getName()](#Location+getName) ⇒ <code>string</code> \| <code>null</code>
1772
- * [.getShortName()](#Location+getShortName) ⇒ <code>string</code> \| <code>null</code>
1773
- * [.getCountryCode()](#Location+getCountryCode) ⇒ <code>string</code> \| <code>undefined</code>
1774
- * [.getTzid()](#Location+getTzid) ⇒ <code>string</code>
1775
- * [.getTimeFormatter()](#Location+getTimeFormatter) ⇒ <code>Intl.DateTimeFormat</code>
1776
- * [.getGeoId()](#Location+getGeoId) ⇒ <code>string</code> \| <code>number</code> \| <code>undefined</code>
1777
- * [.toString()](#Location+toString) ⇒ <code>string</code>
1778
- * _static_
1779
- * [.lookup(name)](#Location.lookup) ⇒ [<code>Location</code>](#Location) \| <code>undefined</code>
1780
- * [.legacyTzToTzid(tz, dst)](#Location.legacyTzToTzid) ⇒ <code>string</code> \| <code>undefined</code>
1781
- * [.getUsaTzid(state, tz, dst)](#Location.getUsaTzid) ⇒ <code>string</code>
1782
- * [.addLocation(cityName, location)](#Location.addLocation) ⇒ <code>boolean</code>
1783
-
1784
- <a name="new_Location_new"></a>
1785
-
1786
- ### new Location(latitude, longitude, il, tzid, [cityName], [countryCode], [geoid], [elevation])
1787
- Initialize a Location instance
1788
-
1789
-
1790
- | Param | Type | Description |
1791
- | --- | --- | --- |
1792
- | latitude | <code>number</code> | Latitude as a decimal, valid range -90 thru +90 (e.g. 41.85003) |
1793
- | longitude | <code>number</code> | Longitude as a decimal, valid range -180 thru +180 (e.g. -87.65005) |
1794
- | il | <code>boolean</code> | in Israel (true) or Diaspora (false) |
1795
- | tzid | <code>string</code> | Olson timezone ID, e.g. "America/Chicago" |
1796
- | [cityName] | <code>string</code> | optional descriptive city name |
1797
- | [countryCode] | <code>string</code> | ISO 3166 alpha-2 country code (e.g. "FR") |
1798
- | [geoid] | <code>string</code> \| <code>number</code> | optional string or numeric geographic ID |
1799
- | [elevation] | <code>number</code> | in meters (default `0`) |
1800
-
1801
- <a name="Location+getIsrael"></a>
1802
-
1803
- ### location.getIsrael() ⇒ <code>boolean</code>
1804
- **Kind**: instance method of [<code>Location</code>](#Location)
1805
- <a name="Location+getName"></a>
1806
-
1807
- ### location.getName() ⇒ <code>string</code> \| <code>null</code>
1808
- **Kind**: instance method of [<code>Location</code>](#Location)
1809
- <a name="Location+getShortName"></a>
1810
-
1811
- ### location.getShortName() ⇒ <code>string</code> \| <code>null</code>
1812
- Returns the location name, up to the first comma
1813
-
1814
- **Kind**: instance method of [<code>Location</code>](#Location)
1815
- <a name="Location+getCountryCode"></a>
1816
-
1817
- ### location.getCountryCode() ⇒ <code>string</code> \| <code>undefined</code>
1818
- **Kind**: instance method of [<code>Location</code>](#Location)
1819
- <a name="Location+getTzid"></a>
1820
-
1821
- ### location.getTzid() ⇒ <code>string</code>
1822
- **Kind**: instance method of [<code>Location</code>](#Location)
1823
- <a name="Location+getTimeFormatter"></a>
1824
-
1825
- ### location.getTimeFormatter() ⇒ <code>Intl.DateTimeFormat</code>
1826
- Gets a 24-hour time formatter (e.g. 07:41 or 20:03) for this location
1827
-
1828
- **Kind**: instance method of [<code>Location</code>](#Location)
1829
- <a name="Location+getGeoId"></a>
1830
-
1831
- ### location.getGeoId() ⇒ <code>string</code> \| <code>number</code> \| <code>undefined</code>
1832
- **Kind**: instance method of [<code>Location</code>](#Location)
1833
- <a name="Location+toString"></a>
1834
-
1835
- ### location.toString() ⇒ <code>string</code>
1836
- **Kind**: instance method of [<code>Location</code>](#Location)
1837
- <a name="Location.lookup"></a>
1838
-
1839
- ### Location.lookup(name) ⇒ [<code>Location</code>](#Location) \| <code>undefined</code>
1840
- Creates a location object from one of 60 "classic" Hebcal city names.
1841
- The following city names are supported:
1842
- 'Ashdod', 'Atlanta', 'Austin', 'Baghdad', 'Beer Sheva',
1843
- 'Berlin', 'Baltimore', 'Bogota', 'Boston', 'Budapest',
1844
- 'Buenos Aires', 'Buffalo', 'Chicago', 'Cincinnati', 'Cleveland',
1845
- 'Dallas', 'Denver', 'Detroit', 'Eilat', 'Gibraltar', 'Haifa',
1846
- 'Hawaii', 'Helsinki', 'Houston', 'Jerusalem', 'Johannesburg',
1847
- 'Kiev', 'La Paz', 'Livingston', 'Las Vegas', 'London', 'Los Angeles',
1848
- 'Marseilles', 'Miami', 'Minneapolis', 'Melbourne', 'Mexico City',
1849
- 'Montreal', 'Moscow', 'New York', 'Omaha', 'Ottawa', 'Panama City',
1850
- 'Paris', 'Pawtucket', 'Petach Tikvah', 'Philadelphia', 'Phoenix',
1851
- 'Pittsburgh', 'Providence', 'Portland', 'Saint Louis', 'Saint Petersburg',
1852
- 'San Diego', 'San Francisco', 'Sao Paulo', 'Seattle', 'Sydney',
1853
- 'Tel Aviv', 'Tiberias', 'Toronto', 'Vancouver', 'White Plains',
1854
- 'Washington DC', 'Worcester'
1855
-
1856
- **Kind**: static method of [<code>Location</code>](#Location)
1857
-
1858
- | Param | Type |
1859
- | --- | --- |
1860
- | name | <code>string</code> |
1861
-
1862
- <a name="Location.legacyTzToTzid"></a>
1863
-
1864
- ### Location.legacyTzToTzid(tz, dst) ⇒ <code>string</code> \| <code>undefined</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, useElevation)](#new_Zmanim_new)
1926
- * _instance_
1927
- * [.getUseElevation()](#Zmanim+getUseElevation) ⇒ <code>boolean</code>
1928
- * [.setUseElevation(useElevation)](#Zmanim+setUseElevation)
1929
- * [.timeAtAngle(angle, rising)](#Zmanim+timeAtAngle) ⇒ <code>Date</code>
1930
- * [.sunrise()](#Zmanim+sunrise) ⇒ <code>Date</code>
1931
- * [.seaLevelSunrise()](#Zmanim+seaLevelSunrise) ⇒ <code>Date</code>
1932
- * [.sunset()](#Zmanim+sunset) ⇒ <code>Date</code>
1933
- * [.seaLevelSunset()](#Zmanim+seaLevelSunset) ⇒ <code>Date</code>
1934
- * [.dawn()](#Zmanim+dawn) ⇒ <code>Date</code>
1935
- * [.dusk()](#Zmanim+dusk) ⇒ <code>Date</code>
1936
- * [.gregEve()](#Zmanim+gregEve) ⇒ <code>Date</code>
1937
- * [.chatzot()](#Zmanim+chatzot) ⇒ <code>Date</code>
1938
- * [.chatzotNight()](#Zmanim+chatzotNight) ⇒ <code>Date</code>
1939
- * [.alotHaShachar()](#Zmanim+alotHaShachar) ⇒ <code>Date</code>
1940
- * [.misheyakir()](#Zmanim+misheyakir) ⇒ <code>Date</code>
1941
- * [.misheyakirMachmir()](#Zmanim+misheyakirMachmir) ⇒ <code>Date</code>
1942
- * [.sofZmanShma()](#Zmanim+sofZmanShma) ⇒ <code>Date</code>
1943
- * [.sofZmanTfilla()](#Zmanim+sofZmanTfilla) ⇒ <code>Date</code>
1944
- * [.sofZmanShmaMGA()](#Zmanim+sofZmanShmaMGA) ⇒ <code>Date</code>
1945
- * [.sofZmanShmaMGA16Point1()](#Zmanim+sofZmanShmaMGA16Point1) ⇒ <code>Date</code>
1946
- * [.sofZmanShmaMGA19Point8()](#Zmanim+sofZmanShmaMGA19Point8) ⇒ <code>Date</code>
1947
- * [.sofZmanTfillaMGA()](#Zmanim+sofZmanTfillaMGA) ⇒ <code>Date</code>
1948
- * [.sofZmanTfillaMGA16Point1()](#Zmanim+sofZmanTfillaMGA16Point1) ⇒ <code>Date</code>
1949
- * [.sofZmanTfillaMGA19Point8()](#Zmanim+sofZmanTfillaMGA19Point8) ⇒ <code>Date</code>
1950
- * [.minchaGedola()](#Zmanim+minchaGedola) ⇒ <code>Date</code>
1951
- * [.minchaGedolaMGA()](#Zmanim+minchaGedolaMGA) ⇒ <code>Date</code>
1952
- * [.minchaKetana()](#Zmanim+minchaKetana) ⇒ <code>Date</code>
1953
- * [.minchaKetanaMGA()](#Zmanim+minchaKetanaMGA) ⇒ <code>Date</code>
1954
- * [.plagHaMincha()](#Zmanim+plagHaMincha) ⇒ <code>Date</code>
1955
- * [.tzeit([angle])](#Zmanim+tzeit) ⇒ <code>Date</code>
1956
- * [.neitzHaChama()](#Zmanim+neitzHaChama) ⇒ <code>Date</code>
1957
- * [.shkiah()](#Zmanim+shkiah) ⇒ <code>Date</code>
1958
- * [.beinHaShmashos()](#Zmanim+beinHaShmashos) ⇒ <code>Date</code>
1959
- * [.sunriseOffset(offset, roundMinute, forceSeaLevel)](#Zmanim+sunriseOffset) ⇒ <code>Date</code>
1960
- * [.sunsetOffset(offset, roundMinute, forceSeaLevel)](#Zmanim+sunsetOffset) ⇒ <code>Date</code>
1961
- * _static_
1962
- * [.formatTime(dt, timeFormat)](#Zmanim.formatTime) ⇒ <code>string</code>
1963
- * [.roundTime(dt)](#Zmanim.roundTime) ⇒ <code>Date</code>
1964
- * [.timeZoneOffset(tzid, date)](#Zmanim.timeZoneOffset) ⇒ <code>string</code>
1965
- * [.formatISOWithTimeZone(tzid, date)](#Zmanim.formatISOWithTimeZone) ⇒ <code>string</code>
1966
-
1967
- <a name="new_Zmanim_new"></a>
1968
-
1969
- ### new Zmanim(gloc, date, useElevation)
1970
- Initialize a Zmanim instance.
1971
-
1972
-
1973
- | Param | Type | Description |
1974
- | --- | --- | --- |
1975
- | gloc | [<code>GeoLocation</code>](#GeoLocation) | GeoLocation including latitude, longitude, and timezone |
1976
- | 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. |
1977
- | useElevation | <code>boolean</code> | use elevation for calculations (default `false`). If `true`, use elevation to affect the calculation of all sunrise/sunset based zmanim. Note: there are some zmanim such as degree-based zmanim that are driven by the amount of light in the sky and are not impacted by elevation. These zmanim intentionally do not support elevation adjustment. |
1978
-
1979
- **Example**
1980
- ```js
1981
- const {GeoLocation, Zmanim} = require('@hebcal/core');
1982
- const latitude = 41.822232;
1983
- const longitude = -71.448292;
1984
- const tzid = 'America/New_York';
1985
- const friday = new Date(2023, 8, 8);
1986
- const gloc = new GeoLocation(null, latitude, longitude, 0, tzid);
1987
- const zmanim = new Zmanim(gloc, friday, false);
1988
- const candleLighting = zmanim.sunsetOffset(-18, true);
1989
- const timeStr = Zmanim.formatISOWithTimeZone(tzid, candleLighting);
1990
- ```
1991
- <a name="Zmanim+getUseElevation"></a>
1992
-
1993
- ### zmanim.getUseElevation() ⇒ <code>boolean</code>
1994
- Returns `true` if elevation adjustment is enabled
1995
- for zmanim support elevation adjustment
1996
-
1997
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
1998
- <a name="Zmanim+setUseElevation"></a>
1999
-
2000
- ### zmanim.setUseElevation(useElevation)
2001
- Enables or disables elevation adjustment for zmanim support elevation adjustment
2002
-
2003
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2004
-
2005
- | Param | Type |
2006
- | --- | --- |
2007
- | useElevation | <code>boolean</code> |
2008
-
2009
- <a name="Zmanim+timeAtAngle"></a>
2010
-
2011
- ### zmanim.timeAtAngle(angle, rising) ⇒ <code>Date</code>
2012
- Convenience function to get the time when sun is above or below the horizon
2013
- for a certain angle (in degrees).
2014
- This function does not support elevation adjustment.
2015
-
2016
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2017
-
2018
- | Param | Type |
2019
- | --- | --- |
2020
- | angle | <code>number</code> |
2021
- | rising | <code>boolean</code> |
2022
-
2023
- <a name="Zmanim+sunrise"></a>
2024
-
2025
- ### zmanim.sunrise() ⇒ <code>Date</code>
2026
- Upper edge of the Sun appears over the eastern horizon in the morning (0.833° above horizon)
2027
- If elevation is enabled, this function will include elevation in the calculation.
2028
-
2029
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2030
- <a name="Zmanim+seaLevelSunrise"></a>
2031
-
2032
- ### zmanim.seaLevelSunrise() ⇒ <code>Date</code>
2033
- Upper edge of the Sun appears over the eastern horizon in the morning (0.833° above horizon).
2034
- This function does not support elevation adjustment.
2035
-
2036
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2037
- <a name="Zmanim+sunset"></a>
2038
-
2039
- ### zmanim.sunset() ⇒ <code>Date</code>
2040
- When the upper edge of the Sun disappears below the horizon (0.833° below horizon).
2041
- If elevation is enabled, this function will include elevation in the calculation.
2042
-
2043
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2044
- <a name="Zmanim+seaLevelSunset"></a>
2045
-
2046
- ### zmanim.seaLevelSunset() ⇒ <code>Date</code>
2047
- When the upper edge of the Sun disappears below the horizon (0.833° below horizon).
2048
- This function does not support elevation adjustment.
2049
-
2050
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2051
- <a name="Zmanim+dawn"></a>
2052
-
2053
- ### zmanim.dawn() ⇒ <code>Date</code>
2054
- Civil dawn; Sun is 6° below the horizon in the morning.
2055
- Because degree-based functions estimate the amount of light in the sky,
2056
- the result is not impacted by elevation.
2057
-
2058
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2059
- <a name="Zmanim+dusk"></a>
2060
-
2061
- ### zmanim.dusk() ⇒ <code>Date</code>
2062
- Civil dusk; Sun is 6° below the horizon in the evening.
2063
- Because degree-based functions estimate the amount of light in the sky,
2064
- the result is not impacted by elevation.
2065
-
2066
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2067
- <a name="Zmanim+gregEve"></a>
2068
-
2069
- ### zmanim.gregEve() ⇒ <code>Date</code>
2070
- Returns sunset for the previous day.
2071
- If elevation is enabled, this function will include elevation in the calculation.
2072
-
2073
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2074
- <a name="Zmanim+chatzot"></a>
2075
-
2076
- ### zmanim.chatzot() ⇒ <code>Date</code>
2077
- Midday – Chatzot; Sunrise plus 6 halachic hours
2078
-
2079
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2080
- <a name="Zmanim+chatzotNight"></a>
2081
-
2082
- ### zmanim.chatzotNight() ⇒ <code>Date</code>
2083
- Midnight – Chatzot; Sunset plus 6 halachic hours.
2084
- If elevation is enabled, this function will include elevation in the calculation.
2085
-
2086
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2087
- <a name="Zmanim+alotHaShachar"></a>
2088
-
2089
- ### zmanim.alotHaShachar() ⇒ <code>Date</code>
2090
- Dawn – Alot haShachar; Sun is 16.1° below the horizon in the morning.
2091
- Because degree-based functions estimate the amount of light in the sky,
2092
- the result is not impacted by elevation.
2093
-
2094
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2095
- <a name="Zmanim+misheyakir"></a>
2096
-
2097
- ### zmanim.misheyakir() ⇒ <code>Date</code>
2098
- Earliest talis & tefillin – Misheyakir; Sun is 11.5° below the horizon in the morning.
2099
- Because degree-based functions estimate the amount of light in the sky,
2100
- the result is not impacted by elevation.
2101
-
2102
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2103
- <a name="Zmanim+misheyakirMachmir"></a>
2104
-
2105
- ### zmanim.misheyakirMachmir() ⇒ <code>Date</code>
2106
- Earliest talis & tefillin – Misheyakir Machmir; Sun is 10.2° below the horizon in the morning.
2107
- Because degree-based functions estimate the amount of light in the sky,
2108
- the result is not impacted by elevation.
2109
-
2110
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2111
- <a name="Zmanim+sofZmanShma"></a>
2112
-
2113
- ### zmanim.sofZmanShma() ⇒ <code>Date</code>
2114
- Latest Shema (Gra); Sunrise plus 3 halachic hours, according to the Gra.
2115
- If elevation is enabled, this function will include elevation in the calculation.
2116
-
2117
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2118
- <a name="Zmanim+sofZmanTfilla"></a>
2119
-
2120
- ### zmanim.sofZmanTfilla() ⇒ <code>Date</code>
2121
- Latest Shacharit (Gra); Sunrise plus 4 halachic hours, according to the Gra.
2122
-
2123
- This method returns the latest *zman tfila* (time to recite shema in the morning)
2124
- that is 4 *shaos zmaniyos* (solar hours) after sunrise or sea level sunrise
2125
- (depending on the `useElevation` setting), according
2126
- to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).
2127
-
2128
- If elevation is enabled, this function will include elevation in the calculation.
2129
-
2130
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2131
- <a name="Zmanim+sofZmanShmaMGA"></a>
2132
-
2133
- ### zmanim.sofZmanShmaMGA() ⇒ <code>Date</code>
2134
- Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.
2135
- Based on the opinion of the MGA that the day is calculated from
2136
- dawn being fixed 72 minutes before sea-level sunrise, and nightfall is fixed
2137
- 72 minutes after sea-level sunset.
2138
-
2139
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2140
- <a name="Zmanim+sofZmanShmaMGA16Point1"></a>
2141
-
2142
- ### zmanim.sofZmanShmaMGA16Point1() ⇒ <code>Date</code>
2143
- Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.
2144
- Based on the opinion of the MGA that the day is calculated from
2145
- dawn to nightfall with both being 16.1° below the horizon.
2146
-
2147
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2148
- <a name="Zmanim+sofZmanShmaMGA19Point8"></a>
2149
-
2150
- ### zmanim.sofZmanShmaMGA19Point8() ⇒ <code>Date</code>
2151
- Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.
2152
- Based on the opinion of the MGA that the day is calculated from
2153
- dawn to nightfall with both being 19.8° below the horizon.
2154
-
2155
- This calculation is based on the position of the sun 90 minutes after sunset in Jerusalem
2156
- around the equinox / equilux which calculates to 19.8° below geometric zenith.
2157
- https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/
2158
-
2159
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2160
- <a name="Zmanim+sofZmanTfillaMGA"></a>
2161
-
2162
- ### zmanim.sofZmanTfillaMGA() ⇒ <code>Date</code>
2163
- Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham
2164
-
2165
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2166
- <a name="Zmanim+sofZmanTfillaMGA16Point1"></a>
2167
-
2168
- ### zmanim.sofZmanTfillaMGA16Point1() ⇒ <code>Date</code>
2169
- Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham.
2170
- Based on the opinion of the MGA that the day is calculated from
2171
- dawn to nightfall with both being 16.1° below the horizon.
2172
-
2173
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2174
- <a name="Zmanim+sofZmanTfillaMGA19Point8"></a>
2175
-
2176
- ### zmanim.sofZmanTfillaMGA19Point8() ⇒ <code>Date</code>
2177
- Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham.
2178
- Based on the opinion of the MGA that the day is calculated from
2179
- dawn to nightfall with both being 19.8° below the horizon.
2180
-
2181
- This calculation is based on the position of the sun 90 minutes after sunset in Jerusalem
2182
- around the equinox / equilux which calculates to 19.8° below geometric zenith.
2183
- https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/
2184
-
2185
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2186
- <a name="Zmanim+minchaGedola"></a>
2187
-
2188
- ### zmanim.minchaGedola() ⇒ <code>Date</code>
2189
- Earliest Mincha – Mincha Gedola (GRA); Sunrise plus 6.5 halachic hours.
2190
- If elevation is enabled, this function will include elevation in the calculation.
2191
-
2192
- This method returns the latest mincha gedola, the earliest time one can pray mincha
2193
- that is 6.5 shaos zmaniyos (solar hours) after sunrise or sea level sunrise
2194
- (depending on the `useElevation` setting), according
2195
- to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).
2196
-
2197
- The Ramba"m is of the opinion that it is better to delay *mincha* until
2198
- *mincha ketana* while the Ra"sh, Tur, GRA and others are of the
2199
- opinion that *mincha* can be prayed *lechatchila* starting at *mincha gedola*.
2200
-
2201
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2202
- <a name="Zmanim+minchaGedolaMGA"></a>
2203
-
2204
- ### zmanim.minchaGedolaMGA() ⇒ <code>Date</code>
2205
- Earliest Mincha – Mincha Gedola (MGA); Sunrise plus 6.5 halachic hours.
2206
- If elevation is enabled, this function will include elevation in the calculation.
2207
-
2208
- This method returns the time of *mincha gedola* according to the Magen Avraham
2209
- with the day starting 72 minutes before sunrise and ending 72 minutes after sunset.
2210
- This is the earliest time to pray *mincha*.
2211
-
2212
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2213
- <a name="Zmanim+minchaKetana"></a>
2214
-
2215
- ### zmanim.minchaKetana() ⇒ <code>Date</code>
2216
- Preferable earliest time to recite Minchah – Mincha Ketana; Sunrise plus 9.5 halachic hours.
2217
- If elevation is enabled, this function will include elevation in the calculation.
2218
-
2219
- This method returns *mincha ketana*, the preferred earliest time to pray *mincha* in the
2220
- opinion of the [Rambam](https://en.wikipedia.org/wiki/Maimonides) and others,
2221
- that is 9.5 *shaos zmaniyos* (solar hours) after sunrise or sea level sunrise
2222
- (depending on the `useElevation` setting), according
2223
- to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).
2224
-
2225
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2226
- <a name="Zmanim+minchaKetanaMGA"></a>
2227
-
2228
- ### zmanim.minchaKetanaMGA() ⇒ <code>Date</code>
2229
- This method returns the time of *mincha ketana* according to the Magen Avraham
2230
- with the day starting 72 minutes before sunrise and ending 72 minutes after sunset.
2231
- This is the preferred earliest time to pray *mincha* according to the opinion of
2232
- the [Rambam](https://en.wikipedia.org/wiki/Maimonides) and others.
2233
-
2234
- If elevation is enabled, this function will include elevation in the calculation.
2235
-
2236
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2237
- <a name="Zmanim+plagHaMincha"></a>
2238
-
2239
- ### zmanim.plagHaMincha() ⇒ <code>Date</code>
2240
- Plag haMincha; Sunrise plus 10.75 halachic hours.
2241
- If elevation is enabled, this function will include elevation in the calculation.
2242
-
2243
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2244
- <a name="Zmanim+tzeit"></a>
2245
-
2246
- ### zmanim.tzeit([angle]) ⇒ <code>Date</code>
2247
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2248
-
2249
- | Param | Type | Default | Description |
2250
- | --- | --- | --- | --- |
2251
- | [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. Because degree-based functions estimate the amount of light in the sky, the result is not impacted by elevation. |
2252
-
2253
- <a name="Zmanim+neitzHaChama"></a>
2254
-
2255
- ### zmanim.neitzHaChama() ⇒ <code>Date</code>
2256
- Alias for sunrise
2257
-
2258
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2259
- <a name="Zmanim+shkiah"></a>
2260
-
2261
- ### zmanim.shkiah() ⇒ <code>Date</code>
2262
- Alias for sunset
2263
-
2264
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2265
- <a name="Zmanim+beinHaShmashos"></a>
2266
-
2267
- ### zmanim.beinHaShmashos() ⇒ <code>Date</code>
2268
- Rabbeinu Tam holds that bein hashmashos is a specific time
2269
- between sunset and tzeis hakochavim.
2270
- One opinion on how to calculate this time is that
2271
- it is 13.5 minutes before tzies 7.083.
2272
- Because degree-based functions estimate the amount of light in the sky,
2273
- the result is not impacted by elevation.
2274
-
2275
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2276
- <a name="Zmanim+sunriseOffset"></a>
2277
-
2278
- ### zmanim.sunriseOffset(offset, roundMinute, forceSeaLevel) ⇒ <code>Date</code>
2279
- Returns sunrise + `offset` minutes (either positive or negative).
2280
- If elevation is enabled, this function will include elevation in the calculation
2281
- unless `forceSeaLevel` is `true`.
2282
-
2283
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2284
-
2285
- | Param | Type | Default | Description |
2286
- | --- | --- | --- | --- |
2287
- | offset | <code>number</code> | | minutes |
2288
- | roundMinute | <code>boolean</code> | <code>true</code> | round time to nearest minute (default true) |
2289
- | forceSeaLevel | <code>boolean</code> | <code>false</code> | use sea-level sunrise (default false) |
2290
-
2291
- <a name="Zmanim+sunsetOffset"></a>
2292
-
2293
- ### zmanim.sunsetOffset(offset, roundMinute, forceSeaLevel) ⇒ <code>Date</code>
2294
- Returns sunset + `offset` minutes (either positive or negative).
2295
- If elevation is enabled, this function will include elevation in the calculation
2296
- unless `forceSeaLevel` is `true`.
2297
-
2298
- **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2299
-
2300
- | Param | Type | Default | Description |
2301
- | --- | --- | --- | --- |
2302
- | offset | <code>number</code> | | minutes |
2303
- | roundMinute | <code>boolean</code> | <code>true</code> | round time to nearest minute (default true) |
2304
- | forceSeaLevel | <code>boolean</code> | <code>false</code> | use sea-level sunset (default false) |
2305
-
2306
- <a name="Zmanim.formatTime"></a>
2307
-
2308
- ### Zmanim.formatTime(dt, timeFormat) ⇒ <code>string</code>
2309
- Uses timeFormat to return a date like '20:34'
2310
-
2311
- **Kind**: static method of [<code>Zmanim</code>](#Zmanim)
2312
-
2313
- | Param | Type |
2314
- | --- | --- |
2315
- | dt | <code>Date</code> |
2316
- | timeFormat | <code>Intl.DateTimeFormat</code> |
2317
-
2318
- <a name="Zmanim.roundTime"></a>
2319
-
2320
- ### Zmanim.roundTime(dt) ⇒ <code>Date</code>
2321
- Discards seconds, rounding to nearest minute.
2322
-
2323
- **Kind**: static method of [<code>Zmanim</code>](#Zmanim)
2324
-
2325
- | Param | Type |
2326
- | --- | --- |
2327
- | dt | <code>Date</code> |
2328
-
2329
- <a name="Zmanim.timeZoneOffset"></a>
2330
-
2331
- ### Zmanim.timeZoneOffset(tzid, date) ⇒ <code>string</code>
2332
- Get offset string (like "+05:00" or "-08:00") from tzid (like "Europe/Moscow")
2333
-
2334
- **Kind**: static method of [<code>Zmanim</code>](#Zmanim)
2335
-
2336
- | Param | Type |
2337
- | --- | --- |
2338
- | tzid | <code>string</code> |
2339
- | date | <code>Date</code> |
2340
-
2341
- <a name="Zmanim.formatISOWithTimeZone"></a>
2342
-
2343
- ### Zmanim.formatISOWithTimeZone(tzid, date) ⇒ <code>string</code>
2344
- Returns a string like "2022-04-01T13:06:00-11:00"
2345
-
2346
- **Kind**: static method of [<code>Zmanim</code>](#Zmanim)
2347
-
2348
- | Param | Type |
2349
- | --- | --- |
2350
- | tzid | <code>string</code> |
2351
- | date | <code>Date</code> |
2352
-
2353
- <a name="TimedEvent"></a>
2354
-
2355
- ## TimedEvent
2356
- An event that has an `eventTime` and `eventTimeStr`
2357
-
2358
- **Kind**: global class
2359
-
2360
- * [TimedEvent](#TimedEvent)
2361
- * [new TimedEvent(desc)](#new_TimedEvent_new)
2362
- * [.render([locale])](#TimedEvent+render) ⇒ <code>string</code>
2363
- * [.renderBrief([locale])](#TimedEvent+renderBrief) ⇒ <code>string</code>
2364
- * [.getCategories()](#TimedEvent+getCategories) ⇒ <code>Array.&lt;string&gt;</code>
2365
-
2366
- <a name="new_TimedEvent_new"></a>
2367
-
2368
- ### new TimedEvent(desc)
2369
-
2370
- | Param | Type | Description |
2371
- | --- | --- | --- |
2372
- | desc | <code>string</code> | Description (not translated) |
2373
-
2374
- <a name="TimedEvent+render"></a>
2375
-
2376
- ### timedEvent.render([locale]) ⇒ <code>string</code>
2377
- **Kind**: instance method of [<code>TimedEvent</code>](#TimedEvent)
2378
-
2379
- | Param | Type | Description |
2380
- | --- | --- | --- |
2381
- | [locale] | <code>string</code> | Optional locale name (defaults to active locale). |
2382
-
2383
- <a name="TimedEvent+renderBrief"></a>
2384
-
2385
- ### timedEvent.renderBrief([locale]) ⇒ <code>string</code>
2386
- Returns translation of "Candle lighting" without the time.
2387
-
2388
- **Kind**: instance method of [<code>TimedEvent</code>](#TimedEvent)
2389
-
2390
- | Param | Type | Description |
2391
- | --- | --- | --- |
2392
- | [locale] | <code>string</code> | Optional locale name (defaults to active locale). |
2393
-
2394
- <a name="TimedEvent+getCategories"></a>
2395
-
2396
- ### timedEvent.getCategories() ⇒ <code>Array.&lt;string&gt;</code>
2397
- **Kind**: instance method of [<code>TimedEvent</code>](#TimedEvent)
2398
- <a name="CandleLightingEvent"></a>
2399
-
2400
- ## CandleLightingEvent
2401
- Candle lighting before Shabbat or holiday
2402
-
2403
- **Kind**: global class
2404
- <a name="CandleLightingEvent+getEmoji"></a>
2405
-
2406
- ### candleLightingEvent.getEmoji() ⇒ <code>string</code>
2407
- **Kind**: instance method of [<code>CandleLightingEvent</code>](#CandleLightingEvent)
2408
- <a name="HavdalahEvent"></a>
2409
-
2410
- ## HavdalahEvent
2411
- Havdalah after Shabbat or holiday
2412
-
2413
- **Kind**: global class
2414
-
2415
- * [HavdalahEvent](#HavdalahEvent)
2416
- * [.render([locale])](#HavdalahEvent+render) ⇒ <code>string</code>
2417
- * [.renderBrief([locale])](#HavdalahEvent+renderBrief) ⇒ <code>string</code>
2418
- * [.getEmoji()](#HavdalahEvent+getEmoji) ⇒ <code>string</code>
2419
-
2420
- <a name="HavdalahEvent+render"></a>
2421
-
2422
- ### havdalahEvent.render([locale]) ⇒ <code>string</code>
2423
- **Kind**: instance method of [<code>HavdalahEvent</code>](#HavdalahEvent)
2424
-
2425
- | Param | Type | Description |
2426
- | --- | --- | --- |
2427
- | [locale] | <code>string</code> | Optional locale name (defaults to active locale). |
2428
-
2429
- <a name="HavdalahEvent+renderBrief"></a>
2430
-
2431
- ### havdalahEvent.renderBrief([locale]) ⇒ <code>string</code>
2432
- Returns translation of "Havdalah" without the time.
2433
-
2434
- **Kind**: instance method of [<code>HavdalahEvent</code>](#HavdalahEvent)
2435
-
2436
- | Param | Type | Description |
2437
- | --- | --- | --- |
2438
- | [locale] | <code>string</code> | Optional locale name (defaults to active locale). |
2439
-
2440
- <a name="HavdalahEvent+getEmoji"></a>
2441
-
2442
- ### havdalahEvent.getEmoji() ⇒ <code>string</code>
2443
- **Kind**: instance method of [<code>HavdalahEvent</code>](#HavdalahEvent)
2444
- <a name="Molad"></a>
2445
-
2446
- ## Molad
2447
- Represents a molad, the moment when the new moon is "born"
2448
-
2449
- **Kind**: global class
2450
-
2451
- * [Molad](#Molad)
2452
- * [new Molad(year, month)](#new_Molad_new)
2453
- * [.getYear()](#Molad+getYear) ⇒ <code>number</code>
2454
- * [.getMonth()](#Molad+getMonth) ⇒ <code>number</code>
2455
- * [.getMonthName()](#Molad+getMonthName) ⇒ <code>string</code>
2456
- * [.getDow()](#Molad+getDow) ⇒ <code>number</code>
2457
- * [.getHour()](#Molad+getHour) ⇒ <code>number</code>
2458
- * [.getMinutes()](#Molad+getMinutes) ⇒ <code>number</code>
2459
- * [.getChalakim()](#Molad+getChalakim) ⇒ <code>number</code>
2460
- * [.render([locale], options)](#Molad+render) ⇒ <code>string</code>
2461
-
2462
- <a name="new_Molad_new"></a>
2463
-
2464
- ### new Molad(year, month)
2465
- Calculates the molad for a Hebrew month
2466
-
2467
-
2468
- | Param | Type |
2469
- | --- | --- |
2470
- | year | <code>number</code> |
2471
- | month | <code>number</code> |
2472
-
2473
- <a name="Molad+getYear"></a>
2474
-
2475
- ### molad.getYear() ⇒ <code>number</code>
2476
- **Kind**: instance method of [<code>Molad</code>](#Molad)
2477
- <a name="Molad+getMonth"></a>
2478
-
2479
- ### molad.getMonth() ⇒ <code>number</code>
2480
- **Kind**: instance method of [<code>Molad</code>](#Molad)
2481
- <a name="Molad+getMonthName"></a>
2482
-
2483
- ### molad.getMonthName() ⇒ <code>string</code>
2484
- **Kind**: instance method of [<code>Molad</code>](#Molad)
2485
- <a name="Molad+getDow"></a>
2486
-
2487
- ### molad.getDow() ⇒ <code>number</code>
2488
- **Kind**: instance method of [<code>Molad</code>](#Molad)
2489
- **Returns**: <code>number</code> - Day of Week (0=Sunday, 6=Saturday)
2490
- <a name="Molad+getHour"></a>
2491
-
2492
- ### molad.getHour() ⇒ <code>number</code>
2493
- **Kind**: instance method of [<code>Molad</code>](#Molad)
2494
- **Returns**: <code>number</code> - hour of day (0-23)
2495
- <a name="Molad+getMinutes"></a>
2496
-
2497
- ### molad.getMinutes() ⇒ <code>number</code>
2498
- **Kind**: instance method of [<code>Molad</code>](#Molad)
2499
- **Returns**: <code>number</code> - minutes past hour (0-59)
2500
- <a name="Molad+getChalakim"></a>
2501
-
2502
- ### molad.getChalakim() ⇒ <code>number</code>
2503
- **Kind**: instance method of [<code>Molad</code>](#Molad)
2504
- **Returns**: <code>number</code> - parts of a minute (0-17)
2505
- <a name="Molad+render"></a>
2506
-
2507
- ### molad.render([locale], options) ⇒ <code>string</code>
2508
- **Kind**: instance method of [<code>Molad</code>](#Molad)
2509
-
2510
- | Param | Type | Description |
2511
- | --- | --- | --- |
2512
- | [locale] | <code>string</code> | Optional locale name (defaults to active locale) |
2513
- | options | <code>CalOptions</code> | |
2514
-
2515
- <a name="MoladEvent"></a>
2516
-
2517
- ## MoladEvent
2518
- Represents a Molad announcement on Shabbat Mevarchim
2519
-
2520
- **Kind**: global class
2521
-
2522
- * [MoladEvent](#MoladEvent)
2523
- * [new MoladEvent(date, hyear, hmonth, options)](#new_MoladEvent_new)
2524
- * [.render([locale])](#MoladEvent+render) ⇒ <code>string</code>
2525
-
2526
- <a name="new_MoladEvent_new"></a>
2527
-
2528
- ### new MoladEvent(date, hyear, hmonth, options)
2529
-
2530
- | Param | Type | Description |
2531
- | --- | --- | --- |
2532
- | date | [<code>HDate</code>](#HDate) | Hebrew date event occurs |
2533
- | hyear | <code>number</code> | molad year |
2534
- | hmonth | <code>number</code> | molad month |
2535
- | options | <code>CalOptions</code> | |
2536
-
2537
- <a name="MoladEvent+render"></a>
2538
-
2539
- ### moladEvent.render([locale]) ⇒ <code>string</code>
2540
- **Kind**: instance method of [<code>MoladEvent</code>](#MoladEvent)
2541
-
2542
- | Param | Type | Description |
2543
- | --- | --- | --- |
2544
- | [locale] | <code>string</code> | Optional locale name (defaults to active locale). |
2545
-
2546
- <a name="OmerEvent"></a>
2547
-
2548
- ## OmerEvent
2549
- Represents a day 1-49 of counting the Omer from Pesach to Shavuot
2550
-
2551
- **Kind**: global class
2552
-
2553
- * [OmerEvent](#OmerEvent)
2554
- * [new OmerEvent(date, omerDay)](#new_OmerEvent_new)
2555
- * [.sefira(lang)](#OmerEvent+sefira) ⇒ <code>string</code>
2556
- * [.render([locale])](#OmerEvent+render) ⇒ <code>string</code>
2557
- * [.renderBrief([locale])](#OmerEvent+renderBrief) ⇒ <code>string</code>
2558
- * [.getEmoji()](#OmerEvent+getEmoji) ⇒ <code>string</code>
2559
- * [.getWeeks()](#OmerEvent+getWeeks) ⇒ <code>number</code>
2560
- * [.getDaysWithinWeeks()](#OmerEvent+getDaysWithinWeeks) ⇒ <code>number</code>
2561
- * [.getTodayIs(locale)](#OmerEvent+getTodayIs) ⇒ <code>string</code>
2562
- * [.url()](#OmerEvent+url) ⇒ <code>string</code>
2563
-
2564
- <a name="new_OmerEvent_new"></a>
2565
-
2566
- ### new OmerEvent(date, omerDay)
2567
-
2568
- | Param | Type |
2569
- | --- | --- |
2570
- | date | [<code>HDate</code>](#HDate) |
2571
- | omerDay | <code>number</code> |
2572
-
2573
- <a name="OmerEvent+sefira"></a>
2574
-
2575
- ### omerEvent.sefira(lang) ⇒ <code>string</code>
2576
- **Kind**: instance method of [<code>OmerEvent</code>](#OmerEvent)
2577
-
2578
- | Param | Type | Default |
2579
- | --- | --- | --- |
2580
- | lang | <code>string</code> | <code>&quot;en&quot;</code> |
2581
-
2582
- <a name="OmerEvent+render"></a>
2583
-
2584
- ### omerEvent.render([locale]) ⇒ <code>string</code>
2585
- **Kind**: instance method of [<code>OmerEvent</code>](#OmerEvent)
2586
- **Todo**
2587
-
2588
- - [ ] use gettext()
2589
-
2590
-
2591
- | Param | Type | Description |
2592
- | --- | --- | --- |
2593
- | [locale] | <code>string</code> | Optional locale name (defaults to active locale). |
2594
-
2595
- <a name="OmerEvent+renderBrief"></a>
2596
-
2597
- ### omerEvent.renderBrief([locale]) ⇒ <code>string</code>
2598
- Returns translation of "Omer day 22" without ordinal numbers.
2599
-
2600
- **Kind**: instance method of [<code>OmerEvent</code>](#OmerEvent)
2601
-
2602
- | Param | Type | Description |
2603
- | --- | --- | --- |
2604
- | [locale] | <code>string</code> | Optional locale name (defaults to active locale). |
2605
-
2606
- <a name="OmerEvent+getEmoji"></a>
2607
-
2608
- ### omerEvent.getEmoji() ⇒ <code>string</code>
2609
- **Kind**: instance method of [<code>OmerEvent</code>](#OmerEvent)
2610
- <a name="OmerEvent+getWeeks"></a>
2611
-
2612
- ### omerEvent.getWeeks() ⇒ <code>number</code>
2613
- **Kind**: instance method of [<code>OmerEvent</code>](#OmerEvent)
2614
- <a name="OmerEvent+getDaysWithinWeeks"></a>
2615
-
2616
- ### omerEvent.getDaysWithinWeeks() ⇒ <code>number</code>
2617
- **Kind**: instance method of [<code>OmerEvent</code>](#OmerEvent)
2618
- <a name="OmerEvent+getTodayIs"></a>
2619
-
2620
- ### omerEvent.getTodayIs(locale) ⇒ <code>string</code>
2621
- **Kind**: instance method of [<code>OmerEvent</code>](#OmerEvent)
2622
-
2623
- | Param | Type |
2624
- | --- | --- |
2625
- | locale | <code>string</code> |
2626
-
2627
- <a name="OmerEvent+url"></a>
2628
-
2629
- ### omerEvent.url() ⇒ <code>string</code>
2630
- **Kind**: instance method of [<code>OmerEvent</code>](#OmerEvent)
2631
- <a name="Sedra"></a>
2632
-
2633
- ## Sedra
2634
- Represents Parashah HaShavua for an entire Hebrew year
2635
-
2636
- **Kind**: global class
2637
-
2638
- * [Sedra](#Sedra)
2639
- * [new Sedra(hyear, il)](#new_Sedra_new)
2640
- * [.get(hd)](#Sedra+get) ⇒ <code>Array.&lt;string&gt;</code>
2641
- * [.getString(hd, [locale])](#Sedra+getString) ⇒ <code>string</code>
2642
- * [.isParsha(hd)](#Sedra+isParsha) ⇒ <code>boolean</code>
2643
- * [.find(parsha)](#Sedra+find) ⇒ [<code>HDate</code>](#HDate) \| <code>null</code>
2644
- * [.getSedraArray()](#Sedra+getSedraArray) ⇒ <code>Array.&lt;NumberOrString&gt;</code>
2645
- * [.getFirstSaturday()](#Sedra+getFirstSaturday) ⇒ <code>number</code>
2646
- * [.getYear()](#Sedra+getYear) ⇒ <code>number</code>
2647
- * [.lookup(hd)](#Sedra+lookup) ⇒ <code>SedraResult</code>
2648
-
2649
- <a name="new_Sedra_new"></a>
2650
-
2651
- ### new Sedra(hyear, il)
2652
- Caculates the Parashah HaShavua for an entire Hebrew year
2653
-
2654
-
2655
- | Param | Type | Description |
2656
- | --- | --- | --- |
2657
- | hyear | <code>number</code> | Hebrew year (e.g. 5749) |
2658
- | il | <code>boolean</code> | Use Israel sedra schedule (false for Diaspora) |
2659
-
2660
- <a name="Sedra+get"></a>
2661
-
2662
- ### sedra.get(hd) ⇒ <code>Array.&lt;string&gt;</code>
2663
- Returns the parsha (or parshiyot) read on Hebrew date
2664
-
2665
- **Kind**: instance method of [<code>Sedra</code>](#Sedra)
2666
-
2667
- | Param | Type | Description |
2668
- | --- | --- | --- |
2669
- | hd | [<code>HDate</code>](#HDate) \| <code>number</code> | Hebrew date or R.D. days |
2670
-
2671
- <a name="Sedra+getString"></a>
2672
-
2673
- ### sedra.getString(hd, [locale]) ⇒ <code>string</code>
2674
- Looks up parsha for the date, then returns a translated or transliterated string
2675
-
2676
- **Kind**: instance method of [<code>Sedra</code>](#Sedra)
2677
-
2678
- | Param | Type | Description |
2679
- | --- | --- | --- |
2680
- | hd | [<code>HDate</code>](#HDate) \| <code>number</code> | Hebrew date or R.D. days |
2681
- | [locale] | <code>string</code> | Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale |
2682
-
2683
- <a name="Sedra+isParsha"></a>
2684
-
2685
- ### sedra.isParsha(hd) ⇒ <code>boolean</code>
2686
- Checks to see if this day would be a regular parasha HaShavua
2687
- Torah reading or special holiday reading
2688
-
2689
- **Kind**: instance method of [<code>Sedra</code>](#Sedra)
2690
-
2691
- | Param | Type | Description |
2692
- | --- | --- | --- |
2693
- | hd | [<code>HDate</code>](#HDate) \| <code>number</code> | Hebrew date or R.D. days |
2694
-
2695
- <a name="Sedra+find"></a>
2696
-
2697
- ### sedra.find(parsha) ⇒ [<code>HDate</code>](#HDate) \| <code>null</code>
2698
- Returns the date that a parsha occurs
2699
- or `null` if the parsha doesn't occur this year
2700
-
2701
- **Kind**: instance method of [<code>Sedra</code>](#Sedra)
2702
-
2703
- | Param | Type |
2704
- | --- | --- |
2705
- | parsha | <code>number</code> \| <code>string</code> \| <code>Array.&lt;string&gt;</code> |
2706
-
2707
- <a name="Sedra+getSedraArray"></a>
2708
-
2709
- ### sedra.getSedraArray() ⇒ <code>Array.&lt;NumberOrString&gt;</code>
2710
- Returns the underlying annual sedra schedule.
2711
- Used by `@hebcal/triennial`
2712
-
2713
- **Kind**: instance method of [<code>Sedra</code>](#Sedra)
2714
- <a name="Sedra+getFirstSaturday"></a>
2715
-
2716
- ### sedra.getFirstSaturday() ⇒ <code>number</code>
2717
- R.D. date of the first Saturday on or after Rosh Hashana
2718
-
2719
- **Kind**: instance method of [<code>Sedra</code>](#Sedra)
2720
- <a name="Sedra+getYear"></a>
2721
-
2722
- ### sedra.getYear() ⇒ <code>number</code>
2723
- **Kind**: instance method of [<code>Sedra</code>](#Sedra)
2724
- <a name="Sedra+lookup"></a>
2725
-
2726
- ### sedra.lookup(hd) ⇒ <code>SedraResult</code>
2727
- Returns an object describing the parsha on the first Saturday on or after `hd`
2728
-
2729
- **Kind**: instance method of [<code>Sedra</code>](#Sedra)
2730
-
2731
- | Param | Type | Description |
2732
- | --- | --- | --- |
2733
- | hd | [<code>HDate</code>](#HDate) \| <code>number</code> | Hebrew date or R.D. days |
2734
-
2735
- <a name="ParshaEvent"></a>
2736
-
2737
- ## ParshaEvent
2738
- Represents one of 54 weekly Torah portions, always on a Saturday
2739
-
2740
- **Kind**: global class
2741
-
2742
- * [ParshaEvent](#ParshaEvent)
2743
- * [new ParshaEvent(date, parsha, [il], [num])](#new_ParshaEvent_new)
2744
- * [.render([locale])](#ParshaEvent+render) ⇒ <code>string</code>
2745
- * [.basename()](#ParshaEvent+basename) ⇒ <code>string</code>
2746
- * [.url()](#ParshaEvent+url) ⇒ <code>string</code> \| <code>undefined</code>
2747
- * [.urlDateSuffix()](#ParshaEvent+urlDateSuffix) ⇒ <code>string</code>
2748
-
2749
- <a name="new_ParshaEvent_new"></a>
2750
-
2751
- ### new ParshaEvent(date, parsha, [il], [num])
2752
-
2753
- | Param | Type | Default | Description |
2754
- | --- | --- | --- | --- |
2755
- | date | [<code>HDate</code>](#HDate) | | |
2756
- | parsha | <code>Array.&lt;string&gt;</code> | | untranslated name of single or double parsha, such as ['Bereshit'] or ['Achrei Mot', 'Kedoshim'] |
2757
- | [il] | <code>boolean</code> | <code>false</code> | |
2758
- | [num] | <code>number</code> \| <code>Array.&lt;number&gt;</code> | | |
2759
-
2760
- <a name="ParshaEvent+render"></a>
2761
-
2762
- ### parshaEvent.render([locale]) ⇒ <code>string</code>
2763
- **Kind**: instance method of [<code>ParshaEvent</code>](#ParshaEvent)
2764
-
2765
- | Param | Type | Description |
2766
- | --- | --- | --- |
2767
- | [locale] | <code>string</code> | Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale. |
2768
-
2769
- <a name="ParshaEvent+basename"></a>
2770
-
2771
- ### parshaEvent.basename() ⇒ <code>string</code>
2772
- **Kind**: instance method of [<code>ParshaEvent</code>](#ParshaEvent)
2773
- <a name="ParshaEvent+url"></a>
2774
-
2775
- ### parshaEvent.url() ⇒ <code>string</code> \| <code>undefined</code>
2776
- **Kind**: instance method of [<code>ParshaEvent</code>](#ParshaEvent)
2777
- <a name="ParshaEvent+urlDateSuffix"></a>
2778
-
2779
- ### parshaEvent.urlDateSuffix() ⇒ <code>string</code>
2780
- **Kind**: instance method of [<code>ParshaEvent</code>](#ParshaEvent)
2781
- <a name="HolidayEvent"></a>
2782
-
2783
- ## HolidayEvent
2784
- Represents a built-in holiday like Pesach, Purim or Tu BiShvat
2785
-
2786
- **Kind**: global class
2787
-
2788
- * [HolidayEvent](#HolidayEvent)
2789
- * [.basename()](#HolidayEvent+basename) ⇒ <code>string</code>
2790
- * [.url()](#HolidayEvent+url) ⇒ <code>string</code> \| <code>undefined</code>
2791
- * [.urlDateSuffix()](#HolidayEvent+urlDateSuffix) ⇒ <code>string</code>
2792
- * [.getEmoji()](#HolidayEvent+getEmoji) ⇒ <code>string</code>
2793
- * [.getCategories()](#HolidayEvent+getCategories) ⇒ <code>Array.&lt;string&gt;</code>
2794
- * [.render([locale])](#HolidayEvent+render) ⇒ <code>string</code>
2795
- * [.renderBrief([locale])](#HolidayEvent+renderBrief) ⇒ <code>string</code>
2796
- * [.clone()](#HolidayEvent+clone) ⇒ [<code>Event</code>](#Event)
2797
-
2798
- <a name="HolidayEvent+basename"></a>
2799
-
2800
- ### holidayEvent.basename() ⇒ <code>string</code>
2801
- **Kind**: instance method of [<code>HolidayEvent</code>](#HolidayEvent)
2802
- <a name="HolidayEvent+url"></a>
2803
-
2804
- ### holidayEvent.url() ⇒ <code>string</code> \| <code>undefined</code>
2805
- **Kind**: instance method of [<code>HolidayEvent</code>](#HolidayEvent)
2806
- <a name="HolidayEvent+urlDateSuffix"></a>
2807
-
2808
- ### holidayEvent.urlDateSuffix() ⇒ <code>string</code>
2809
- **Kind**: instance method of [<code>HolidayEvent</code>](#HolidayEvent)
2810
- <a name="HolidayEvent+getEmoji"></a>
2811
-
2812
- ### holidayEvent.getEmoji() ⇒ <code>string</code>
2813
- **Kind**: instance method of [<code>HolidayEvent</code>](#HolidayEvent)
2814
- <a name="HolidayEvent+getCategories"></a>
2815
-
2816
- ### holidayEvent.getCategories() ⇒ <code>Array.&lt;string&gt;</code>
2817
- **Kind**: instance method of [<code>HolidayEvent</code>](#HolidayEvent)
2818
- <a name="HolidayEvent+render"></a>
2819
-
2820
- ### holidayEvent.render([locale]) ⇒ <code>string</code>
2821
- Returns (translated) description of this event
2822
-
2823
- **Kind**: instance method of [<code>HolidayEvent</code>](#HolidayEvent)
2824
-
2825
- | Param | Type | Description |
2826
- | --- | --- | --- |
2827
- | [locale] | <code>string</code> | Optional locale name (defaults to active locale). |
2828
-
2829
- <a name="HolidayEvent+renderBrief"></a>
2830
-
2831
- ### holidayEvent.renderBrief([locale]) ⇒ <code>string</code>
2832
- Returns a brief (translated) description of this event.
2833
- For most events, this is the same as render(). For some events, it procudes
2834
- a shorter text (e.g. without a time or added description).
2835
-
2836
- **Kind**: instance method of [<code>HolidayEvent</code>](#HolidayEvent)
2837
-
2838
- | Param | Type | Description |
2839
- | --- | --- | --- |
2840
- | [locale] | <code>string</code> | Optional locale name (defaults to active locale). |
2841
-
2842
- <a name="HolidayEvent+clone"></a>
2843
-
2844
- ### holidayEvent.clone() ⇒ [<code>Event</code>](#Event)
2845
- Makes a clone of this Event object
2846
-
2847
- **Kind**: instance method of [<code>HolidayEvent</code>](#HolidayEvent)
2848
- <a name="AsaraBTevetEvent"></a>
2849
-
2850
- ## AsaraBTevetEvent
2851
- Because Asara B'Tevet often occurs twice in the same Gregorian year,
2852
- we subclass HolidayEvent to override the `url()` method.
2853
-
2854
- **Kind**: global class
2855
- <a name="AsaraBTevetEvent+urlDateSuffix"></a>
2856
-
2857
- ### asaraBTevetEvent.urlDateSuffix() ⇒ <code>string</code>
2858
- **Kind**: instance method of [<code>AsaraBTevetEvent</code>](#AsaraBTevetEvent)
2859
- <a name="RoshChodeshEvent"></a>
2860
-
2861
- ## RoshChodeshEvent
2862
- Represents Rosh Chodesh, the beginning of a new month
2863
-
2864
- **Kind**: global class
2865
-
2866
- * [RoshChodeshEvent](#RoshChodeshEvent)
2867
- * [new RoshChodeshEvent(date, monthName)](#new_RoshChodeshEvent_new)
2868
- * [.render([locale])](#RoshChodeshEvent+render) ⇒ <code>string</code>
2869
- * [.basename()](#RoshChodeshEvent+basename) ⇒ <code>string</code>
2870
- * [.getEmoji()](#RoshChodeshEvent+getEmoji) ⇒ <code>string</code>
2871
-
2872
- <a name="new_RoshChodeshEvent_new"></a>
2873
-
2874
- ### new RoshChodeshEvent(date, monthName)
2875
- Constructs Rosh Chodesh event
2876
-
2877
-
2878
- | Param | Type | Description |
2879
- | --- | --- | --- |
2880
- | date | [<code>HDate</code>](#HDate) | Hebrew date event occurs |
2881
- | monthName | <code>string</code> | Hebrew month name (not translated) |
2882
-
2883
- <a name="RoshChodeshEvent+render"></a>
2884
-
2885
- ### roshChodeshEvent.render([locale]) ⇒ <code>string</code>
2886
- Returns (translated) description of this event
2887
-
2888
- **Kind**: instance method of [<code>RoshChodeshEvent</code>](#RoshChodeshEvent)
2889
-
2890
- | Param | Type | Description |
2891
- | --- | --- | --- |
2892
- | [locale] | <code>string</code> | Optional locale name (defaults to active locale). |
2893
-
2894
- <a name="RoshChodeshEvent+basename"></a>
2895
-
2896
- ### roshChodeshEvent.basename() ⇒ <code>string</code>
2897
- **Kind**: instance method of [<code>RoshChodeshEvent</code>](#RoshChodeshEvent)
2898
- <a name="RoshChodeshEvent+getEmoji"></a>
2899
-
2900
- ### roshChodeshEvent.getEmoji() ⇒ <code>string</code>
2901
- **Kind**: instance method of [<code>RoshChodeshEvent</code>](#RoshChodeshEvent)
2902
- <a name="MevarchimChodeshEvent"></a>
2903
-
2904
- ## MevarchimChodeshEvent
2905
- Represents Mevarchim haChodesh, the announcement of the new month
2906
-
2907
- **Kind**: global class
2908
-
2909
- * [MevarchimChodeshEvent](#MevarchimChodeshEvent)
2910
- * [new MevarchimChodeshEvent(date, monthName, [memo])](#new_MevarchimChodeshEvent_new)
2911
- * [.basename()](#MevarchimChodeshEvent+basename) ⇒ <code>string</code>
2912
- * [.render([locale])](#MevarchimChodeshEvent+render) ⇒ <code>string</code>
2913
- * [.renderBrief([locale])](#MevarchimChodeshEvent+renderBrief) ⇒ <code>string</code>
2914
-
2915
- <a name="new_MevarchimChodeshEvent_new"></a>
2916
-
2917
- ### new MevarchimChodeshEvent(date, monthName, [memo])
2918
- Constructs Mevarchim haChodesh event
2919
-
2920
-
2921
- | Param | Type | Description |
2922
- | --- | --- | --- |
2923
- | date | [<code>HDate</code>](#HDate) | Hebrew date event occurs |
2924
- | monthName | <code>string</code> | Hebrew month name (not translated) |
2925
- | [memo] | <code>string</code> | |
2926
-
2927
- <a name="MevarchimChodeshEvent+basename"></a>
2928
-
2929
- ### mevarchimChodeshEvent.basename() ⇒ <code>string</code>
2930
- **Kind**: instance method of [<code>MevarchimChodeshEvent</code>](#MevarchimChodeshEvent)
2931
- <a name="MevarchimChodeshEvent+render"></a>
2932
-
2933
- ### mevarchimChodeshEvent.render([locale]) ⇒ <code>string</code>
2934
- Returns (translated) description of this event
2935
-
2936
- **Kind**: instance method of [<code>MevarchimChodeshEvent</code>](#MevarchimChodeshEvent)
2937
-
2938
- | Param | Type | Description |
2939
- | --- | --- | --- |
2940
- | [locale] | <code>string</code> | Optional locale name (defaults to active locale). |
2941
-
2942
- <a name="MevarchimChodeshEvent+renderBrief"></a>
2943
-
2944
- ### mevarchimChodeshEvent.renderBrief([locale]) ⇒ <code>string</code>
2945
- Returns (translated) description of this event
2946
-
2947
- **Kind**: instance method of [<code>MevarchimChodeshEvent</code>](#MevarchimChodeshEvent)
2948
-
2949
- | Param | Type | Description |
2950
- | --- | --- | --- |
2951
- | [locale] | <code>string</code> | Optional locale name (defaults to active locale). |
2952
-
2953
- <a name="DailyLearning"></a>
2954
-
2955
- ## DailyLearning
2956
- Plug-ins for daily learning calendars such as Daf Yomi, Mishna Yomi, Nach Yomi, etc.
2957
-
2958
- Learning schedules are provided by the `@hebcal/learning` package.
2959
-
2960
- **Kind**: global class
2961
-
2962
- * [DailyLearning](#DailyLearning)
2963
- * [.addCalendar(name, calendar)](#DailyLearning.addCalendar)
2964
- * [.lookup(name, hd, il)](#DailyLearning.lookup) ⇒ [<code>Event</code>](#Event) \| <code>null</code>
2965
-
2966
- <a name="DailyLearning.addCalendar"></a>
2967
-
2968
- ### DailyLearning.addCalendar(name, calendar)
2969
- Register a new learning calendar.
2970
-
2971
- **Kind**: static method of [<code>DailyLearning</code>](#DailyLearning)
2972
-
2973
- | Param | Type |
2974
- | --- | --- |
2975
- | name | <code>string</code> |
2976
- | calendar | <code>function</code> |
2977
-
2978
- <a name="DailyLearning.lookup"></a>
2979
-
2980
- ### DailyLearning.lookup(name, hd, il) ⇒ [<code>Event</code>](#Event) \| <code>null</code>
2981
- Returns an event from daily calendar for a given date. Returns `null` if there
2982
- is no learning from this calendar on this date.
2983
-
2984
- **Kind**: static method of [<code>DailyLearning</code>](#DailyLearning)
2985
-
2986
- | Param | Type |
2987
- | --- | --- |
2988
- | name | <code>string</code> |
2989
- | hd | [<code>HDate</code>](#HDate) |
2990
- | il | <code>boolean</code> |
2991
-
2992
- <a name="HebrewCalendar"></a>
2993
-
2994
- ## HebrewCalendar
2995
- HebrewCalendar is the main interface to the `@hebcal/core` library.
2996
- This namespace is used to calculate holidays, rosh chodesh, candle lighting & havdalah times,
2997
- Parashat HaShavua, Daf Yomi, days of the omer, and the molad.
2998
- Event names can be rendered in several languges using the `locale` option.
2999
-
3000
- **Kind**: global class
3001
-
3002
- * [HebrewCalendar](#HebrewCalendar)
3003
- * [.calendar([options])](#HebrewCalendar.calendar) ⇒ [<code>Array.&lt;Event&gt;</code>](#Event)
3004
- * [.getBirthdayOrAnniversary(hyear, gdate)](#HebrewCalendar.getBirthdayOrAnniversary) ⇒ [<code>HDate</code>](#HDate) \| <code>undefined</code>
3005
- * [.getYahrzeit(hyear, gdate)](#HebrewCalendar.getYahrzeit) ⇒ [<code>HDate</code>](#HDate) \| <code>undefined</code>
3006
- * [.getHolidaysForYear(year)](#HebrewCalendar.getHolidaysForYear) ⇒ <code>HolidayYearMap</code>
3007
- * [.getHolidaysForYearArray(year, il)](#HebrewCalendar.getHolidaysForYearArray) ⇒ [<code>Array.&lt;HolidayEvent&gt;</code>](#HolidayEvent)
3008
- * [.getHolidaysOnDate(date, [il])](#HebrewCalendar.getHolidaysOnDate) ⇒ [<code>Array.&lt;HolidayEvent&gt;</code>](#HolidayEvent) \| <code>undefined</code>
3009
- * [.eruvTavshilin(date, il)](#HebrewCalendar.eruvTavshilin) ⇒ <code>boolean</code>
3010
- * [.reformatTimeStr(timeStr, suffix, options)](#HebrewCalendar.reformatTimeStr) ⇒ <code>string</code>
3011
- * [.version()](#HebrewCalendar.version) ⇒ <code>string</code>
3012
- * [.getSedra(hyear, il)](#HebrewCalendar.getSedra) ⇒ [<code>Sedra</code>](#Sedra)
3013
- * [.hallel(hdate, il)](#HebrewCalendar.hallel) ⇒ <code>number</code>
3014
- * [.tachanun(hdate, il)](#HebrewCalendar.tachanun) ⇒ <code>TachanunResult</code>
3015
-
3016
- <a name="HebrewCalendar.calendar"></a>
3017
-
3018
- ### HebrewCalendar.calendar([options]) ⇒ [<code>Array.&lt;Event&gt;</code>](#Event)
3019
- Calculates holidays and other Hebrew calendar events based on [CalOptions](CalOptions).
3020
-
3021
- Each holiday is represented by an [Event](#Event) object which includes a date,
3022
- a description, flags and optional attributes.
3023
- If given no options, returns holidays for the Diaspora for the current Gregorian year.
3024
-
3025
- The date range returned by this function can be controlled by:
3026
- * `options.year` - Gregorian (e.g. 1993) or Hebrew year (e.g. 5749)
3027
- * `options.isHebrewYear` - to interpret `year` as Hebrew year
3028
- * `options.numYears` - generate calendar for multiple years (default 1)
3029
- * `options.month` - Gregorian or Hebrew month (to filter results to a single month)
3030
-
3031
- Alternatively, specify start and end days with `Date` or [HDate](#HDate) instances:
3032
- * `options.start` - use specific start date (requires `end` date)
3033
- * `options.end` - use specific end date (requires `start` date)
3034
-
3035
- Unless `options.noHolidays == true`, default holidays include:
3036
- * Major holidays - Rosh Hashana, Yom Kippur, Pesach, Sukkot, etc.
3037
- * Minor holidays - Purim, Chanukah, Tu BiShvat, Lag BaOmer, etc.
3038
- * Minor fasts - Ta'anit Esther, Tzom Gedaliah, etc. (unless `options.noMinorFast`)
3039
- * Special Shabbatot - Shabbat Shekalim, Zachor, etc. (unless `options.noSpecialShabbat`)
3040
- * Modern Holidays - Yom HaShoah, Yom HaAtzma'ut, etc. (unless `options.noModern`)
3041
- * Rosh Chodesh (unless `options.noRoshChodesh`)
3042
-
3043
- Holiday and Torah reading schedules differ between Israel and the Disapora.
3044
- Set `options.il=true` to use the Israeli schedule.
3045
-
3046
- Additional non-default event types can be specified:
3047
- * Parashat HaShavua - weekly Torah Reading on Saturdays (`options.sedrot`)
3048
- * Counting of the Omer (`options.omer`)
3049
- * Shabbat Mevarchim HaChodesh on Saturday before Rosh Chodesh (`options.shabbatMevarchim`)
3050
- * Molad announcement on Saturday before Rosh Chodesh (`options.molad`)
3051
- * Yom Kippur Katan (`options.yomKippurKatan`)
3052
-
3053
- Daily Study of texts are supported by the
3054
- [@hebcal/learning](https://github.com/hebcal/hebcal-learning) package,
3055
- for example:
3056
- * Babylonian Talmud Daf Yomi (`options.dailyLearning.dafYomi`)
3057
- * Jerusalem Talmud (Yerushalmi) Yomi (`options.dailyLearning.yerushalmi`)
3058
- * Mishna Yomi (`options.dailyLearning.mishnaYomi`)
3059
- * Nach Yomi (`options.dailyLearning.nachYomi`)
3060
-
3061
- Candle-lighting and Havdalah times are approximated using latitude and longitude
3062
- specified by the [Location](#Location) class. The `Location` class contains a small
3063
- database of cities with their associated geographic information and time-zone information.
3064
- If you ever have any doubts about Hebcal's times, consult your local halachic authority.
3065
- If you enter geographic coordinates above the arctic circle or antarctic circle,
3066
- the times are guaranteed to be wrong.
3067
-
3068
- To add candle-lighting options, set `options.candlelighting=true` and set
3069
- `options.location` to an instance of `Location`. By default, candle lighting
3070
- time is 18 minutes before sundown (40 minutes for Jerusalem,
3071
- 30 minutes for Haifa and Zikhron Ya'akov) and Havdalah is
3072
- calculated according to Tzeit Hakochavim - Nightfall (the point when 3 small stars
3073
- are observable in the night time sky with the naked eye). The default Havdalah
3074
- option (Tzeit Hakochavim) is calculated when the sun is 8.5° below the horizon.
3075
- These defaults can be changed using these options:
3076
- * `options.candleLightingMins` - minutes before sundown to light candles
3077
- * `options.havdalahMins` - minutes after sundown for Havdalah (typical values are 42, 50, or 72).
3078
- Havdalah times are suppressed when `options.havdalahMins=0`.
3079
- * `options.havdalahDeg` - degrees for solar depression for Havdalah.
3080
- Default is 8.5 degrees for 3 small stars. Use 7.083 degrees for 3 medium-sized stars.
3081
- Havdalah times are suppressed when `options.havdalahDeg=0`.
3082
-
3083
- If both `options.candlelighting=true` and `options.location` is specified,
3084
- Chanukah candle-lighting times and minor fast start/end times will also be generated.
3085
- Chanukah candle-lighting is at Bein HaShmashos (13.5 minutes before
3086
- the sun is 7.083° below the horizon in the evening)
3087
- on weekdays, at regular candle-lighting time on Fridays, and at regular Havdalah time on
3088
- Saturday night (see above).
3089
-
3090
- Minor fasts begin at Alot HaShachar (sun is 16.1° below the horizon in the morning) and
3091
- end when 3 medium-sized stars are observable in the night sky (sun is 7.083° below the horizon
3092
- in the evening).
3093
-
3094
- Two options also exist for generating an Event with the Hebrew date:
3095
- * `options.addHebrewDates` - print the Hebrew date for the entire date range
3096
- * `options.addHebrewDatesForEvents` - print the Hebrew date for dates with some events
3097
-
3098
- Lastly, translation and transliteration of event titles is controlled by
3099
- `options.locale` and the [Locale](#Locale) API.
3100
- `@hebcal/core` supports three locales by default:
3101
- * `en` - default, Sephardic transliterations (e.g. "Shabbat")
3102
- * `ashkenazi` - Ashkenazi transliterations (e.g. "Shabbos")
3103
- * `he` - Hebrew (e.g. "שַׁבָּת")
3104
-
3105
- Additional locales (such as `ru` or `fr`) are supported by the
3106
- [@hebcal/locales](https://github.com/hebcal/hebcal-locales) package
3107
-
3108
- **Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
3109
-
3110
- | Param | Type | Default |
3111
- | --- | --- | --- |
3112
- | [options] | <code>CalOptions</code> | <code>{}</code> |
3113
-
3114
- **Example**
3115
- ```js
3116
- import {HebrewCalendar, HDate, Location, Event} from '@hebcal/core';
3117
- const options: CalOptions = {
3118
- year: 1981,
3119
- isHebrewYear: false,
3120
- candlelighting: true,
3121
- location: Location.lookup('San Francisco'),
3122
- sedrot: true,
3123
- omer: true,
3124
- };
3125
- const events = HebrewCalendar.calendar(options);
3126
- for (const ev of events) {
3127
- const hd = ev.getDate();
3128
- const date = hd.greg();
3129
- console.log(date.toLocaleDateString(), ev.render('en'), hd.toString());
3130
- }
3131
- ```
3132
- <a name="HebrewCalendar.getBirthdayOrAnniversary"></a>
3133
-
3134
- ### HebrewCalendar.getBirthdayOrAnniversary(hyear, gdate) ⇒ [<code>HDate</code>](#HDate) \| <code>undefined</code>
3135
- Calculates a birthday or anniversary (non-yahrzeit).
3136
- `hyear` must be after original `gdate` of anniversary.
3137
- Returns `undefined` when requested year preceeds or is same as original year.
3138
-
3139
- Hebcal uses the algorithm defined in "Calendrical Calculations"
3140
- by Edward M. Reingold and Nachum Dershowitz.
3141
-
3142
- The birthday of someone born in Adar of an ordinary year or Adar II of
3143
- a leap year is also always in the last month of the year, be that Adar
3144
- or Adar II. The birthday in an ordinary year of someone born during the
3145
- first 29 days of Adar I in a leap year is on the corresponding day of Adar;
3146
- in a leap year, the birthday occurs in Adar I, as expected.
3147
-
3148
- Someone born on the thirtieth day of Marcheshvan, Kislev, or Adar I
3149
- has his birthday postponed until the first of the following month in
3150
- years where that day does not occur. [Calendrical Calculations p. 111]
3151
-
3152
- **Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
3153
- **Returns**: [<code>HDate</code>](#HDate) \| <code>undefined</code> - anniversary occurring in `hyear`
3154
-
3155
- | Param | Type | Description |
3156
- | --- | --- | --- |
3157
- | hyear | <code>number</code> | Hebrew year |
3158
- | gdate | <code>Date</code> \| [<code>HDate</code>](#HDate) | Gregorian or Hebrew date of event |
3159
-
3160
- **Example**
3161
- ```js
3162
- import {HebrewCalendar} from '@hebcal/core';
3163
- const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'
3164
- const hd = HebrewCalendar.getBirthdayOrAnniversary(5780, dt); // '1 Nisan 5780'
3165
- console.log(hd.greg().toLocaleDateString('en-US')); // '3/26/2020'
3166
- ```
3167
- <a name="HebrewCalendar.getYahrzeit"></a>
3168
-
3169
- ### HebrewCalendar.getYahrzeit(hyear, gdate) ⇒ [<code>HDate</code>](#HDate) \| <code>undefined</code>
3170
- Calculates yahrzeit.
3171
- `hyear` must be after original `gdate` of death.
3172
- Returns `undefined` when requested year preceeds or is same as original year.
3173
-
3174
- Hebcal uses the algorithm defined in "Calendrical Calculations"
3175
- by Edward M. Reingold and Nachum Dershowitz.
3176
-
3177
- The customary anniversary date of a death is more complicated and depends
3178
- also on the character of the year in which the first anniversary occurs.
3179
- There are several cases:
3180
-
3181
- * If the date of death is Marcheshvan 30, the anniversary in general depends
3182
- on the first anniversary; if that first anniversary was not Marcheshvan 30,
3183
- use the day before Kislev 1.
3184
- * If the date of death is Kislev 30, the anniversary in general again depends
3185
- on the first anniversary — if that was not Kislev 30, use the day before
3186
- Tevet 1.
3187
- * If the date of death is Adar II, the anniversary is the same day in the
3188
- last month of the Hebrew year (Adar or Adar II).
3189
- * If the date of death is Adar I 30, the anniversary in a Hebrew year that
3190
- is not a leap year (in which Adar only has 29 days) is the last day in
3191
- Shevat.
3192
- * In all other cases, use the normal (that is, same month number) anniversary
3193
- of the date of death. [Calendrical Calculations p. 113]
3194
-
3195
- **Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
3196
- **Returns**: [<code>HDate</code>](#HDate) \| <code>undefined</code> - anniversary occurring in hyear
3197
-
3198
- | Param | Type | Description |
3199
- | --- | --- | --- |
3200
- | hyear | <code>number</code> | Hebrew year |
3201
- | gdate | <code>Date</code> \| [<code>HDate</code>](#HDate) | Gregorian or Hebrew date of death |
3202
-
3203
- **Example**
3204
- ```js
3205
- import {HebrewCalendar} from '@hebcal/core';
3206
- const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'
3207
- const hd = HebrewCalendar.getYahrzeit(5780, dt); // '30 Sh\'vat 5780'
3208
- console.log(hd.greg().toLocaleDateString('en-US')); // '2/25/2020'
3209
- ```
3210
- <a name="HebrewCalendar.getHolidaysForYear"></a>
3211
-
3212
- ### HebrewCalendar.getHolidaysForYear(year) ⇒ <code>HolidayYearMap</code>
3213
- Lower-level holidays interface, which returns a `Map` of `Event`s indexed by
3214
- `HDate.toString()`. These events must filtered especially for `flags.IL_ONLY`
3215
- or `flags.CHUL_ONLY` depending on Israel vs. Diaspora holiday scheme.
3216
-
3217
- **Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
3218
-
3219
- | Param | Type | Description |
3220
- | --- | --- | --- |
3221
- | year | <code>number</code> | Hebrew year |
3222
-
3223
- <a name="HebrewCalendar.getHolidaysForYearArray"></a>
3224
-
3225
- ### HebrewCalendar.getHolidaysForYearArray(year, il) ⇒ [<code>Array.&lt;HolidayEvent&gt;</code>](#HolidayEvent)
3226
- Returns an array of holidays for the year
3227
-
3228
- **Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
3229
-
3230
- | Param | Type | Description |
3231
- | --- | --- | --- |
3232
- | year | <code>number</code> | Hebrew year |
3233
- | il | <code>boolean</code> | use the Israeli schedule for holidays |
3234
-
3235
- <a name="HebrewCalendar.getHolidaysOnDate"></a>
3236
-
3237
- ### HebrewCalendar.getHolidaysOnDate(date, [il]) ⇒ [<code>Array.&lt;HolidayEvent&gt;</code>](#HolidayEvent) \| <code>undefined</code>
3238
- Returns an array of Events on this date (or `undefined` if no events)
3239
-
3240
- **Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
3241
-
3242
- | Param | Type | Description |
3243
- | --- | --- | --- |
3244
- | date | [<code>HDate</code>](#HDate) \| <code>Date</code> \| <code>number</code> | Hebrew Date, Gregorian date, or absolute R.D. day number |
3245
- | [il] | <code>boolean</code> | use the Israeli schedule for holidays |
3246
-
3247
- <a name="HebrewCalendar.eruvTavshilin"></a>
3248
-
3249
- ### HebrewCalendar.eruvTavshilin(date, il) ⇒ <code>boolean</code>
3250
- Eruv Tavshilin
3251
-
3252
- **Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
3253
-
3254
- | Param | Type |
3255
- | --- | --- |
3256
- | date | <code>Date</code> \| [<code>HDate</code>](#HDate) |
3257
- | il | <code>boolean</code> |
3258
-
3259
- <a name="HebrewCalendar.reformatTimeStr"></a>
3260
-
3261
- ### HebrewCalendar.reformatTimeStr(timeStr, suffix, options) ⇒ <code>string</code>
3262
- Helper function to format a 23-hour (00:00-23:59) time in US format ("8:13pm") or
3263
- keep as "20:13" for any other locale/country. Uses [CalOptions](CalOptions) to determine
3264
- locale.
3265
- If `options.hour12` is `false`, locale is ignored and always returns 24-hour time.
3266
- If `options.hour12` is `true`, locale is ignored and always returns 12-hour time.
3267
-
3268
- **Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
3269
-
3270
- | Param | Type | Description |
3271
- | --- | --- | --- |
3272
- | timeStr | <code>string</code> | original time like "20:30" |
3273
- | suffix | <code>string</code> | "p" or "pm" or " P.M.". Add leading space if you want it |
3274
- | options | <code>CalOptions</code> | |
3275
-
3276
- <a name="HebrewCalendar.version"></a>
3277
-
3278
- ### HebrewCalendar.version() ⇒ <code>string</code>
3279
- **Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
3280
- <a name="HebrewCalendar.getSedra"></a>
3281
-
3282
- ### HebrewCalendar.getSedra(hyear, il) ⇒ [<code>Sedra</code>](#Sedra)
3283
- Convenience function to create an instance of `Sedra` or reuse a previously
3284
- created and cached instance.
3285
-
3286
- **Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
3287
-
3288
- | Param | Type |
3289
- | --- | --- |
3290
- | hyear | <code>number</code> |
3291
- | il | <code>boolean</code> |
3292
-
3293
- <a name="HebrewCalendar.hallel"></a>
3294
-
3295
- ### HebrewCalendar.hallel(hdate, il) ⇒ <code>number</code>
3296
- Return a number containing information on what Hallel is said on that day.
3297
-
3298
- Whole Hallel is said on Chanukah, the first Yom Tov of Pesach, Shavuot, Sukkot,
3299
- Yom Ha'atzmaut, and Yom Yerushalayim.
3300
-
3301
- Half Hallel is said on Rosh Chodesh (not Rosh Hashanah), and the last 6 days of Pesach.
3302
-
3303
- The number is one of the following values:
3304
-
3305
- 0 - No Hallel
3306
- 1 - Half Hallel
3307
- 2 - Whole Hallel
3308
-
3309
- **Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
3310
-
3311
- | Param | Type |
3312
- | --- | --- |
3313
- | hdate | [<code>HDate</code>](#HDate) |
3314
- | il | <code>boolean</code> |
3315
-
3316
- <a name="HebrewCalendar.tachanun"></a>
3317
-
3318
- ### HebrewCalendar.tachanun(hdate, il) ⇒ <code>TachanunResult</code>
3319
- Return details on what Tachanun (or Tzidchatcha on Shabbat) is said on `hdate`.
3320
-
3321
- Tachanun is not said on Rosh Chodesh, the month of Nisan, Lag Baomer,
3322
- Rosh Chodesh Sivan until Isru Chag, Tisha B'av, 15 Av, Erev Rosh Hashanah,
3323
- Rosh Hashanah, Erev Yom Kippur until after Simchat Torah, Chanukah,
3324
- Tu B'shvat, Purim and Shushan Purim, and Purim and Shushan Purim Katan.
3325
-
3326
- In some congregations Tachanun is not said until from Rosh Chodesh Sivan
3327
- until 14th Sivan, Sukkot until after Rosh Chodesh Cheshvan, Pesach Sheini,
3328
- Yom Ha'atzmaut, and Yom Yerushalayim.
3329
-
3330
- Tachanun is not said at Mincha on days before it is not said at Shacharit.
3331
-
3332
- Tachanun is not said at Shacharit on Shabbat, but is at Mincha, usually.
3333
-
3334
- **Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
3335
-
3336
- | Param | Type |
3337
- | --- | --- |
3338
- | hdate | [<code>HDate</code>](#HDate) |
3339
- | il | <code>boolean</code> |
3340
-
3341
- <a name="greg"></a>
3342
-
3343
- ## greg
3344
- Gregorian date helper functions.
3345
-
3346
- **Kind**: global variable
3347
- <a name="months"></a>
3348
-
3349
- ## months : <code>enum</code>
3350
- Hebrew months of the year (NISAN=1, TISHREI=7)
3351
-
3352
- **Kind**: global enum
3353
- **Read only**: true
3354
- **Properties**
3355
-
3356
- | Name | Type | Default | Description |
3357
- | --- | --- | --- | --- |
3358
- | NISAN | <code>number</code> | <code>1</code> | Nissan / ניסן |
3359
- | IYYAR | <code>number</code> | <code>2</code> | Iyyar / אייר |
3360
- | SIVAN | <code>number</code> | <code>3</code> | Sivan / סיון |
3361
- | TAMUZ | <code>number</code> | <code>4</code> | Tamuz (sometimes Tammuz) / תמוז |
3362
- | AV | <code>number</code> | <code>5</code> | Av / אב |
3363
- | ELUL | <code>number</code> | <code>6</code> | Elul / אלול |
3364
- | TISHREI | <code>number</code> | <code>7</code> | Tishrei / תִּשְׁרֵי |
3365
- | CHESHVAN | <code>number</code> | <code>8</code> | Cheshvan / חשון |
3366
- | KISLEV | <code>number</code> | <code>9</code> | Kislev / כסלו |
3367
- | TEVET | <code>number</code> | <code>10</code> | Tevet / טבת |
3368
- | SHVAT | <code>number</code> | <code>11</code> | Sh'vat / שבט |
3369
- | ADAR_I | <code>number</code> | <code>12</code> | Adar or Adar Rishon / אדר |
3370
- | ADAR_II | <code>number</code> | <code>13</code> | Adar Sheini (only on leap years) / אדר ב׳ |
3371
-
3372
- <a name="flags"></a>
3373
-
3374
- ## flags : <code>enum</code>
3375
- Holiday flags for Event
3376
-
3377
- **Kind**: global enum
3378
- **Read only**: true
3379
- **Properties**
3380
-
3381
- | Name | Type | Default | Description |
3382
- | --- | --- | --- | --- |
3383
- | CHAG | <code>number</code> | <code>1</code> | Chag, yontiff, yom tov |
3384
- | LIGHT_CANDLES | <code>number</code> | <code>2</code> | Light candles 18 minutes before sundown |
3385
- | YOM_TOV_ENDS | <code>number</code> | <code>4</code> | End of holiday (end of Yom Tov) |
3386
- | CHUL_ONLY | <code>number</code> | <code>8</code> | Observed only in the Diaspora (chutz l'aretz) |
3387
- | IL_ONLY | <code>number</code> | <code>16</code> | Observed only in Israel |
3388
- | LIGHT_CANDLES_TZEIS | <code>number</code> | <code>32</code> | Light candles in the evening at Tzeit time (3 small stars) |
3389
- | CHANUKAH_CANDLES | <code>number</code> | <code>64</code> | Candle-lighting for Chanukah |
3390
- | ROSH_CHODESH | <code>number</code> | <code>128</code> | Rosh Chodesh, beginning of a new Hebrew month |
3391
- | MINOR_FAST | <code>number</code> | <code>256</code> | Minor fasts like Tzom Tammuz, Ta'anit Esther, ... |
3392
- | SPECIAL_SHABBAT | <code>number</code> | <code>512</code> | Shabbat Shekalim, Zachor, ... |
3393
- | PARSHA_HASHAVUA | <code>number</code> | <code>1024</code> | Weekly sedrot on Saturdays |
3394
- | DAF_YOMI | <code>number</code> | <code>2048</code> | Daily page of Talmud (Bavli) |
3395
- | OMER_COUNT | <code>number</code> | <code>4096</code> | Days of the Omer |
3396
- | MODERN_HOLIDAY | <code>number</code> | <code>8192</code> | Yom HaShoah, Yom HaAtzma'ut, ... |
3397
- | MAJOR_FAST | <code>number</code> | <code>16384</code> | Yom Kippur and Tish'a B'Av |
3398
- | SHABBAT_MEVARCHIM | <code>number</code> | <code>32768</code> | On the Saturday before Rosh Chodesh |
3399
- | MOLAD | <code>number</code> | <code>65536</code> | Molad |
3400
- | USER_EVENT | <code>number</code> | <code>131072</code> | Yahrzeit or Hebrew Anniversary |
3401
- | HEBREW_DATE | <code>number</code> | <code>262144</code> | Daily Hebrew date ("11th of Sivan, 5780") |
3402
- | MINOR_HOLIDAY | <code>number</code> | <code>524288</code> | A holiday that's not major, modern, rosh chodesh, or a fast day |
3403
- | EREV | <code>number</code> | <code>1048576</code> | Evening before a major or minor holiday |
3404
- | CHOL_HAMOED | <code>number</code> | <code>2097152</code> | Chol haMoed, intermediate days of Pesach or Sukkot |
3405
- | MISHNA_YOMI | <code>number</code> | <code>4194304</code> | Mishna Yomi |
3406
- | YOM_KIPPUR_KATAN | <code>number</code> | <code>8388608</code> | Yom Kippur Katan, minor day of atonement on the day preceeding each Rosh Chodesh |
3407
- | YERUSHALMI_YOMI | <code>number</code> | <code>16777216</code> | Daily page of Jerusalem Talmud (Yerushalmi) |
3408
- | NACH_YOMI | <code>number</code> | <code>33554432</code> | Nach Yomi |
3409
- | DAILY_LEARNING | <code>number</code> | <code>67108864</code> | Daily Learning |
3410
-
3411
- <a name="holidayDesc"></a>
3412
-
3413
- ## holidayDesc : <code>enum</code>
3414
- Transliterated names of holidays, used by `Event.getDesc()`
3415
-
3416
- **Kind**: global enum
3417
- **Read only**: true
3418
- **Properties**
3419
-
3420
- | Name | Type | Default | Description |
3421
- | --- | --- | --- | --- |
3422
- | ASARA_BTEVET | <code>string</code> | <code>&quot;Asara B&#x27;Tevet&quot;</code> | Asara B'Tevet |
3423
- | BIRKAT_HACHAMAH | <code>string</code> | <code>&quot;Birkat Hachamah&quot;</code> | Birkat Hachamah |
3424
- | CHAG_HABANOT | <code>string</code> | <code>&quot;Chag HaBanot&quot;</code> | Chag HaBanot |
3425
- | CHANUKAH_8TH_DAY | <code>string</code> | <code>&quot;Chanukah: 8th Day&quot;</code> | Chanukah: 8th Day |
3426
- | EREV_TISHA_BAV | <code>string</code> | <code>&quot;Erev Tish&#x27;a B&#x27;Av&quot;</code> | Erev Tish'a B'Av |
3427
- | LEIL_SELICHOT | <code>string</code> | <code>&quot;Leil Selichot&quot;</code> | Leil Selichot |
3428
- | PURIM_KATAN | <code>string</code> | <code>&quot;Purim Katan&quot;</code> | Purim Katan |
3429
- | PURIM_MESHULASH | <code>string</code> | <code>&quot;Purim Meshulash&quot;</code> | Purim Meshulash |
3430
- | SHABBAT_CHAZON | <code>string</code> | <code>&quot;Shabbat Chazon&quot;</code> | Shabbat Chazon |
3431
- | SHABBAT_HACHODESH | <code>string</code> | <code>&quot;Shabbat HaChodesh&quot;</code> | Shabbat HaChodesh |
3432
- | SHABBAT_HAGADOL | <code>string</code> | <code>&quot;Shabbat HaGadol&quot;</code> | Shabbat HaGadol |
3433
- | SHABBAT_NACHAMU | <code>string</code> | <code>&quot;Shabbat Nachamu&quot;</code> | Shabbat Nachamu |
3434
- | SHABBAT_PARAH | <code>string</code> | <code>&quot;Shabbat Parah&quot;</code> | Shabbat Parah |
3435
- | SHABBAT_SHEKALIM | <code>string</code> | <code>&quot;Shabbat Shekalim&quot;</code> | Shabbat Shekalim |
3436
- | SHABBAT_SHIRAH | <code>string</code> | <code>&quot;Shabbat Shirah&quot;</code> | Shabbat Shirah |
3437
- | SHABBAT_SHUVA | <code>string</code> | <code>&quot;Shabbat Shuva&quot;</code> | Shabbat Shuva |
3438
- | SHABBAT_ZACHOR | <code>string</code> | <code>&quot;Shabbat Zachor&quot;</code> | Shabbat Zachor |
3439
- | SHUSHAN_PURIM_KATAN | <code>string</code> | <code>&quot;Shushan Purim Katan&quot;</code> | Shushan Purim Katan |
3440
- | TAANIT_BECHOROT | <code>string</code> | <code>&quot;Ta&#x27;anit Bechorot&quot;</code> | Ta'anit Bechorot |
3441
- | TAANIT_ESTHER | <code>string</code> | <code>&quot;Ta&#x27;anit Esther&quot;</code> | Ta'anit Esther |
3442
- | TISHA_BAV | <code>string</code> | <code>&quot;Tish&#x27;a B&#x27;Av&quot;</code> | Tish'a B'Av |
3443
- | TZOM_GEDALIAH | <code>string</code> | <code>&quot;Tzom Gedaliah&quot;</code> | Tzom Gedaliah |
3444
- | TZOM_TAMMUZ | <code>string</code> | <code>&quot;Tzom Tammuz&quot;</code> | Tzom Tammuz |
3445
- | YOM_HAATZMA_UT | <code>string</code> | <code>&quot;Yom HaAtzma&#x27;ut&quot;</code> | Yom HaAtzma'ut |
3446
- | YOM_HASHOAH | <code>string</code> | <code>&quot;Yom HaShoah&quot;</code> | Yom HaShoah |
3447
- | YOM_HAZIKARON | <code>string</code> | <code>&quot;Yom HaZikaron&quot;</code> | Yom HaZikaron |
3448
- | BEN_GURION_DAY | <code>string</code> | <code>&quot;BEN_GURION_DAY&quot;</code> | Ben-Gurion Day |
3449
- | CHANUKAH_1_CANDLE | <code>string</code> | <code>&quot;CHANUKAH_1_CANDLE&quot;</code> | Chanukah: 1 Candle |
3450
- | EREV_PESACH | <code>string</code> | <code>&quot;EREV_PESACH&quot;</code> | Erev Pesach |
3451
- | EREV_PURIM | <code>string</code> | <code>&quot;EREV_PURIM&quot;</code> | Erev Purim |
3452
- | EREV_ROSH_HASHANA | <code>string</code> | <code>&quot;EREV_ROSH_HASHANA&quot;</code> | Erev Rosh Hashana |
3453
- | EREV_SHAVUOT | <code>string</code> | <code>&quot;EREV_SHAVUOT&quot;</code> | Erev Shavuot |
3454
- | EREV_SUKKOT | <code>string</code> | <code>&quot;EREV_SUKKOT&quot;</code> | Erev Sukkot |
3455
- | EREV_YOM_KIPPUR | <code>string</code> | <code>&quot;EREV_YOM_KIPPUR&quot;</code> | Erev Yom Kippur |
3456
- | FAMILY_DAY | <code>string</code> | <code>&quot;FAMILY_DAY&quot;</code> | Family Day |
3457
- | HEBREW_LANGUAGE_DAY | <code>string</code> | <code>&quot;HEBREW_LANGUAGE_DAY&quot;</code> | Hebrew Language Day |
3458
- | HERZL_DAY | <code>string</code> | <code>&quot;HERZL_DAY&quot;</code> | Herzl Day |
3459
- | JABOTINSKY_DAY | <code>string</code> | <code>&quot;JABOTINSKY_DAY&quot;</code> | Jabotinsky Day |
3460
- | LAG_BAOMER | <code>string</code> | <code>&quot;LAG_BAOMER&quot;</code> | Lag BaOmer |
3461
- | PESACH_I | <code>string</code> | <code>&quot;PESACH_I&quot;</code> | Pesach I |
3462
- | PESACH_II | <code>string</code> | <code>&quot;PESACH_II&quot;</code> | Pesach II |
3463
- | PESACH_III_CHM | <code>string</code> | <code>&quot;PESACH_III_CHM&quot;</code> | Pesach III (CH''M) |
3464
- | PESACH_II_CHM | <code>string</code> | <code>&quot;PESACH_II_CHM&quot;</code> | Pesach II (CH''M) |
3465
- | PESACH_IV_CHM | <code>string</code> | <code>&quot;PESACH_IV_CHM&quot;</code> | Pesach IV (CH''M) |
3466
- | PESACH_SHENI | <code>string</code> | <code>&quot;PESACH_SHENI&quot;</code> | Pesach Sheni |
3467
- | PESACH_VII | <code>string</code> | <code>&quot;PESACH_VII&quot;</code> | Pesach VII |
3468
- | PESACH_VIII | <code>string</code> | <code>&quot;PESACH_VIII&quot;</code> | Pesach VIII |
3469
- | PESACH_VI_CHM | <code>string</code> | <code>&quot;PESACH_VI_CHM&quot;</code> | Pesach VI (CH''M) |
3470
- | PESACH_V_CHM | <code>string</code> | <code>&quot;PESACH_V_CHM&quot;</code> | Pesach V (CH''M) |
3471
- | PURIM | <code>string</code> | <code>&quot;PURIM&quot;</code> | Purim |
3472
- | ROSH_HASHANA_II | <code>string</code> | <code>&quot;ROSH_HASHANA_II&quot;</code> | Rosh Hashana II |
3473
- | ROSH_HASHANA_LABEHEMOT | <code>string</code> | <code>&quot;ROSH_HASHANA_LABEHEMOT&quot;</code> | Rosh Hashana LaBehemot |
3474
- | SHAVUOT | <code>string</code> | <code>&quot;SHAVUOT&quot;</code> | Shavuot |
3475
- | SHAVUOT_I | <code>string</code> | <code>&quot;SHAVUOT_I&quot;</code> | Shavuot I |
3476
- | SHAVUOT_II | <code>string</code> | <code>&quot;SHAVUOT_II&quot;</code> | Shavuot II |
3477
- | SHMINI_ATZERET | <code>string</code> | <code>&quot;SHMINI_ATZERET&quot;</code> | Shmini Atzeret |
3478
- | SHUSHAN_PURIM | <code>string</code> | <code>&quot;SHUSHAN_PURIM&quot;</code> | Shushan Purim |
3479
- | SIGD | <code>string</code> | <code>&quot;SIGD&quot;</code> | Sigd |
3480
- | SIMCHAT_TORAH | <code>string</code> | <code>&quot;SIMCHAT_TORAH&quot;</code> | Simchat Torah |
3481
- | SUKKOT_I | <code>string</code> | <code>&quot;SUKKOT_I&quot;</code> | Sukkot I |
3482
- | SUKKOT_II | <code>string</code> | <code>&quot;SUKKOT_II&quot;</code> | Sukkot II |
3483
- | SUKKOT_III_CHM | <code>string</code> | <code>&quot;SUKKOT_III_CHM&quot;</code> | Sukkot III (CH''M) |
3484
- | SUKKOT_II_CHM | <code>string</code> | <code>&quot;SUKKOT_II_CHM&quot;</code> | Sukkot II (CH''M) |
3485
- | SUKKOT_IV_CHM | <code>string</code> | <code>&quot;SUKKOT_IV_CHM&quot;</code> | Sukkot IV (CH''M) |
3486
- | SUKKOT_VII_HOSHANA_RABA | <code>string</code> | <code>&quot;SUKKOT_VII_HOSHANA_RABA&quot;</code> | Sukkot VII (Hoshana Raba) |
3487
- | SUKKOT_VI_CHM | <code>string</code> | <code>&quot;SUKKOT_VI_CHM&quot;</code> | Sukkot VI (CH''M) |
3488
- | SUKKOT_V_CHM | <code>string</code> | <code>&quot;SUKKOT_V_CHM&quot;</code> | Sukkot V (CH''M) |
3489
- | TU_BAV | <code>string</code> | <code>&quot;TU_BAV&quot;</code> | Tu B\'Av |
3490
- | TU_BISHVAT | <code>string</code> | <code>&quot;TU_BISHVAT&quot;</code> | Tu BiShvat |
3491
- | YITZHAK_RABIN_MEMORIAL_DAY | <code>string</code> | <code>&quot;YITZHAK_RABIN_MEMORIAL_DAY&quot;</code> | Yitzhak Rabin Memorial Day |
3492
- | YOM_HAALIYAH | <code>string</code> | <code>&quot;YOM_HAALIYAH&quot;</code> | Yom HaAliyah |
3493
- | YOM_HAALIYAH_SCHOOL_OBSERVANCE | <code>string</code> | <code>&quot;YOM_HAALIYAH_SCHOOL_OBSERVANCE&quot;</code> | Yom HaAliyah School Observance |
3494
- | YOM_KIPPUR | <code>string</code> | <code>&quot;YOM_KIPPUR&quot;</code> | Yom Kippur |
3495
- | YOM_YERUSHALAYIM | <code>string</code> | <code>&quot;YOM_YERUSHALAYIM&quot;</code> | Yom Yerushalayim |
3496
-
3497
- <a name="parshiot"></a>
3498
-
3499
- ## parshiot : <code>Array.&lt;string&gt;</code>
3500
- The 54 parshiyot of the Torah as transilterated strings
3501
- parshiot[0] == 'Bereshit', parshiot[1] == 'Noach', parshiot[52] == "Ha'azinu".
3502
-
3503
- **Kind**: global constant
3504
- **Read only**: true
3505
- <a name="version"></a>
3506
-
3507
- ## version
3508
- DO NOT EDIT THIS AUTO-GENERATED FILE!
3509
-
3510
- **Kind**: global constant
3511
- <a name="hebrew2abs"></a>
3512
-
3513
- ## hebrew2abs(year, month, day) ⇒ <code>number</code>
3514
- Converts Hebrew date to R.D. (Rata Die) fixed days.
3515
- R.D. 1 is the imaginary date Monday, January 1, 1 on the Gregorian
3516
- Calendar.
3517
-
3518
- **Kind**: global function
3519
-
3520
- | Param | Type | Description |
3521
- | --- | --- | --- |
3522
- | year | <code>number</code> | Hebrew year |
3523
- | month | <code>number</code> | Hebrew month |
3524
- | day | <code>number</code> | Hebrew date (1-30) |
3525
-
3526
- <a name="abs2hebrew"></a>
3527
-
3528
- ## abs2hebrew(abs) ⇒ <code>SimpleHebrewDate</code>
3529
- Converts absolute R.D. days to Hebrew date
3530
-
3531
- **Kind**: global function
3532
-
3533
- | Param | Type | Description |
3534
- | --- | --- | --- |
3535
- | abs | <code>number</code> | absolute R.D. days |
3536
-
3537
- <a name="isLeapYear"></a>
3538
-
3539
- ## isLeapYear(year) ⇒ <code>boolean</code>
3540
- Returns true if Hebrew year is a leap year
3541
-
3542
- **Kind**: global function
3543
-
3544
- | Param | Type | Description |
3545
- | --- | --- | --- |
3546
- | year | <code>number</code> | Hebrew year |
3547
-
3548
- <a name="monthsInYear"></a>
3549
-
3550
- ## monthsInYear(year) ⇒ <code>number</code>
3551
- Number of months in this Hebrew year (either 12 or 13 depending on leap year)
3552
-
3553
- **Kind**: global function
3554
-
3555
- | Param | Type | Description |
3556
- | --- | --- | --- |
3557
- | year | <code>number</code> | Hebrew year |
3558
-
3559
- <a name="daysInMonth"></a>
3560
-
3561
- ## daysInMonth(month, year) ⇒ <code>number</code>
3562
- Number of days in Hebrew month in a given year (29 or 30)
3563
-
3564
- **Kind**: global function
3565
-
3566
- | Param | Type | Description |
3567
- | --- | --- | --- |
3568
- | month | <code>number</code> | Hebrew month (e.g. months.TISHREI) |
3569
- | year | <code>number</code> | Hebrew year |
3570
-
3571
- <a name="getMonthName"></a>
3572
-
3573
- ## getMonthName(month, year)
3574
- Returns a transliterated string name of Hebrew month in year,
3575
- for example 'Elul' or 'Cheshvan'.
3576
-
3577
- **Kind**: global function
3578
-
3579
- | Param | Type | Description |
3580
- | --- | --- | --- |
3581
- | month | <code>number</code> | Hebrew month (e.g. months.TISHREI) |
3582
- | year | <code>number</code> | Hebrew year |
3583
-
3584
- <a name="elapsedDays"></a>
3585
-
3586
- ## elapsedDays(year) ⇒ <code>number</code>
3587
- Days from sunday prior to start of Hebrew calendar to mean
3588
- conjunction of Tishrei in Hebrew YEAR
3589
-
3590
- **Kind**: global function
3591
-
3592
- | Param | Type | Description |
3593
- | --- | --- | --- |
3594
- | year | <code>number</code> | Hebrew year |
3595
-
3596
- <a name="daysInYear"></a>
3597
-
3598
- ## daysInYear(year) ⇒ <code>number</code>
3599
- Number of days in the hebrew YEAR.
3600
- A common Hebrew calendar year can have a length of 353, 354 or 355 days
3601
- A leap Hebrew calendar year can have a length of 383, 384 or 385 days
3602
-
3603
- **Kind**: global function
3604
-
3605
- | Param | Type | Description |
3606
- | --- | --- | --- |
3607
- | year | <code>number</code> | Hebrew year |
3608
-
3609
- <a name="longCheshvan"></a>
3610
-
3611
- ## longCheshvan(year) ⇒ <code>boolean</code>
3612
- true if Cheshvan is long in Hebrew year
3613
-
3614
- **Kind**: global function
3615
-
3616
- | Param | Type | Description |
3617
- | --- | --- | --- |
3618
- | year | <code>number</code> | Hebrew year |
3619
-
3620
- <a name="shortKislev"></a>
3621
-
3622
- ## shortKislev(year) ⇒ <code>boolean</code>
3623
- true if Kislev is short in Hebrew year
3624
-
3625
- **Kind**: global function
3626
-
3627
- | Param | Type | Description |
3628
- | --- | --- | --- |
3629
- | year | <code>number</code> | Hebrew year |
3630
-
3631
- <a name="monthFromName"></a>
3632
-
3633
- ## monthFromName(monthName) ⇒ <code>number</code>
3634
- Converts Hebrew month string name to numeric
3635
-
3636
- **Kind**: global function
3637
-
3638
- | Param | Type | Description |
3639
- | --- | --- | --- |
3640
- | monthName | <code>string</code> | monthName |
3641
-
3642
- <a name="gematriya"></a>
3643
-
3644
- ## gematriya(num) ⇒ <code>string</code>
3645
- Converts a numerical value to a string of Hebrew letters.
3646
-
3647
- When specifying years of the Hebrew calendar in the present millennium,
3648
- we omit the thousands (which is presently 5 [ה]).
3649
-
3650
- **Kind**: global function
3651
-
3652
- | Param | Type |
3653
- | --- | --- |
3654
- | num | <code>number</code> |
3655
-
3656
- **Example**
3657
- ```js
3658
- gematriya(5774) // 'תשע״ד' - cropped to 774
3659
- gematriya(25) // 'כ״ה'
3660
- gematriya(60) // 'ס׳'
3661
- gematriya(3761) // 'ג׳תשס״א'
3662
- gematriya(1123) // 'א׳קכ״ג'
3663
- ```
3664
- <a name="gematriyaStrToNum"></a>
3665
-
3666
- ## gematriyaStrToNum(str) ⇒ <code>number</code>
3667
- Converts a string of Hebrew letters to a numerical value.
3668
-
3669
- Only considers the value of Hebrew letters `א` through `ת`.
3670
- Ignores final Hebrew letters such as `ך` (kaf sofit) or `ם` (mem sofit)
3671
- and vowels (nekudot).
3672
-
3673
- **Kind**: global function
3674
-
3675
- | Param | Type |
3676
- | --- | --- |
3677
- | str | <code>string</code> |
3678
-
3679
- <a name="omerSefira"></a>
3680
-
3681
- ## omerSefira(omerDay, lang) ⇒
3682
- Returns the sefira. For example, on day 8
3683
- חֶֽסֶד שֶׁבִּגְבוּרָה
3684
- Chesed shebiGevurah
3685
- Lovingkindness within Might
3686
-
3687
- **Kind**: global function
3688
- **Returns**: a string such as `Lovingkindness within Might` or `חֶֽסֶד שֶׁבִּגְבוּרָה`
3689
-
3690
- | Param | Description |
3691
- | --- | --- |
3692
- | omerDay | the day of the omer, 1-49 inclusive |
3693
- | lang | `en` (English), `he` (Hebrew with nikud), or `translit` (Hebrew in Sephardic transliteration) |
3694
-
3695
- <a name="omerTodayIs"></a>
3696
-
3697
- ## omerTodayIs(omerDay, lang) ⇒
3698
- Returns a sentence with that evening's omer count
3699
-
3700
- **Kind**: global function
3701
- **Returns**: a string such as `Today is 10 days, which is 1 week and 3 days of the Omer`
3702
- or `הַיוֹם עֲשָׂרָה יָמִים, שְׁהֵם שָׁבוּעַ אֶחָד וְשְׁלוֹשָׁה יָמִים לָעוֹמֶר`
3703
-
3704
- | Param | Description |
3705
- | --- | --- |
3706
- | omerDay | the day of the omer, 1-49 inclusive |
3707
- | lang | `en` (English), `he` (Hebrew with nikud) |
3708
-
3709
- <a name="omerEmoji"></a>
3710
-
3711
- ## omerEmoji(omerDay) ⇒
3712
- Returns an emoji number symbol with a circle, for example `㊲`
3713
- from the “Enclosed CJK Letters and Months” block of the Unicode standard
3714
-
3715
- **Kind**: global function
3716
- **Returns**: a single Unicode character from `①` through `㊾`
3717
-
3718
- | Param | Description |
3719
- | --- | --- |
3720
- | omerDay | the day of the omer, 1-49 inclusive |
3721
-
3722
- <a name="molad"></a>
3723
-
3724
- ## molad()
3725
- Calculates the molad for a Hebrew month
3726
-
3727
- **Kind**: global function
3728
- <a name="getPseudoISO"></a>
3729
-
3730
- ## getPseudoISO(tzid, date) ⇒ <code>string</code>
3731
- Returns a string similar to `Date.toISOString()` but in the
3732
- timezone `tzid`. Contrary to the typical meaning of `Z` at the end
3733
- of the string, this is not actually a UTC date.
3734
-
3735
- **Kind**: global function
3736
-
3737
- | Param | Type |
3738
- | --- | --- |
3739
- | tzid | <code>string</code> |
3740
- | date | <code>Date</code> |
3741
-
3742
- <a name="getTimezoneOffset"></a>
3743
-
3744
- ## getTimezoneOffset(tzid, date) ⇒ <code>number</code>
3745
- Returns number of minutes `tzid` is offset from UTC on date `date`.
3746
-
3747
- **Kind**: global function
3748
-
3749
- | Param | Type |
3750
- | --- | --- |
3751
- | tzid | <code>string</code> |
3752
- | date | <code>Date</code> |
3753
-
3754
- <a name="pad4"></a>
3755
-
3756
- ## pad4(number) ⇒ <code>string</code>
3757
- Formats a number with leading zeros so the resulting string is 4 digits long.
3758
- Similar to `string.padStart(4, '0')` but will also format
3759
- negative numbers similar to how the JavaScript date formats
3760
- negative year numbers (e.g. `-37` is formatted as `-000037`).
3761
-
3762
- **Kind**: global function
3763
-
3764
- | Param | Type |
3765
- | --- | --- |
3766
- | number | <code>number</code> |
3767
-
3768
- <a name="pad2"></a>
3769
-
3770
- ## pad2(number) ⇒ <code>string</code>
3771
- Formats a number with leading zeros so the resulting string is 2 digits long.
3772
- Similar to `string.padStart(2, '0')`.
3773
-
3774
- **Kind**: global function
3775
-
3776
- | Param | Type |
3777
- | --- | --- |
3778
- | number | <code>number</code> |
3779
-
47
+ ## [API Documentation](https://hebcal.github.io/api/core/index.html)