@hebcal/core 3.33.3 → 3.33.4
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 +415 -415
- package/dist/bundle.js +534 -489
- package/dist/bundle.min.js +2 -2
- package/dist/hdate-bundle.js +119 -24
- package/dist/hdate-bundle.min.js +2 -2
- package/dist/hdate.js +119 -24
- package/dist/hdate.mjs +118 -25
- package/dist/index.js +202 -148
- package/dist/index.mjs +202 -148
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -111,6 +111,12 @@ each day in order to finish the entire Mishnah in ~6 years.</p>
|
|
|
111
111
|
<dt><a href="#MishnaYomiEvent">MishnaYomiEvent</a></dt>
|
|
112
112
|
<dd><p>Event wrapper around a Mishna Yomi instance</p>
|
|
113
113
|
</dd>
|
|
114
|
+
<dt><a href="#HebrewCalendar">HebrewCalendar</a></dt>
|
|
115
|
+
<dd><p>HebrewCalendar is the main interface to the <code>@hebcal/core</code> library.
|
|
116
|
+
This namespace is used to calculate holidays, rosh chodesh, candle lighting & havdalah times,
|
|
117
|
+
Parashat HaShavua, Daf Yomi, days of the omer, and the molad.
|
|
118
|
+
Event names can be rendered in several languges using the <code>locale</code> option.</p>
|
|
119
|
+
</dd>
|
|
114
120
|
</dl>
|
|
115
121
|
|
|
116
122
|
## Objects
|
|
@@ -138,12 +144,6 @@ holidays. <code>@hebcal/core</code> supports four locales by default</p>
|
|
|
138
144
|
<dd><p>The 54 parshiyot of the Torah as transilterated strings
|
|
139
145
|
parshiot[0] == 'Bereshit', parshiot[1] == 'Noach', parshiot[53] == "Ha'Azinu".</p>
|
|
140
146
|
</dd>
|
|
141
|
-
<dt><a href="#HebrewCalendar">HebrewCalendar</a></dt>
|
|
142
|
-
<dd><p>HebrewCalendar is the main interface to the <code>@hebcal/core</code> library.
|
|
143
|
-
This namespace is used to calculate holidays, rosh chodesh, candle lighting & havdalah times,
|
|
144
|
-
Parashat HaShavua, Daf Yomi, days of the omer, and the molad.
|
|
145
|
-
Event names can be rendered in several languges using the <code>locale</code> option.</p>
|
|
146
|
-
</dd>
|
|
147
147
|
</dl>
|
|
148
148
|
|
|
149
149
|
## Functions
|
|
@@ -165,7 +165,7 @@ we omit the thousands (which is presently 5 [ה]).</p>
|
|
|
165
165
|
<dd><p>Result of Sedra.lookup</p>
|
|
166
166
|
</dd>
|
|
167
167
|
<dt><a href="#MishnaYomi">MishnaYomi</a> : <code>Object</code></dt>
|
|
168
|
-
<dd><p>
|
|
168
|
+
<dd><p>Describes a mishna to be read</p>
|
|
169
169
|
</dd>
|
|
170
170
|
</dl>
|
|
171
171
|
|
|
@@ -347,7 +347,7 @@ Renders this Hebrew date in Hebrew gematriya, regardless of locale.
|
|
|
347
347
|
```js
|
|
348
348
|
import {HDate, months} from '@hebcal/core';
|
|
349
349
|
const hd = new HDate(15, months.CHESHVAN, 5769);
|
|
350
|
-
console.log(
|
|
350
|
+
console.log(hd.renderGematriya()); // 'ט״ו חֶשְׁוָן תשס״ט'
|
|
351
351
|
```
|
|
352
352
|
<a name="HDate+before"></a>
|
|
353
353
|
|
|
@@ -2087,129 +2087,444 @@ Returns Mishna Yomi name (e.g. "Bava Metzia 10:5-6" or "Berakhot 9:5-Peah 1:1").
|
|
|
2087
2087
|
Returns a link to sefaria.org
|
|
2088
2088
|
|
|
2089
2089
|
**Kind**: instance method of [<code>MishnaYomiEvent</code>](#MishnaYomiEvent)
|
|
2090
|
-
<a name="
|
|
2091
|
-
|
|
2092
|
-
## greg : <code>object</code>
|
|
2093
|
-
Gregorian date helper functions.
|
|
2090
|
+
<a name="HebrewCalendar"></a>
|
|
2094
2091
|
|
|
2095
|
-
|
|
2092
|
+
## HebrewCalendar
|
|
2093
|
+
HebrewCalendar is the main interface to the `@hebcal/core` library.
|
|
2094
|
+
This namespace is used to calculate holidays, rosh chodesh, candle lighting & havdalah times,
|
|
2095
|
+
Parashat HaShavua, Daf Yomi, days of the omer, and the molad.
|
|
2096
|
+
Event names can be rendered in several languges using the `locale` option.
|
|
2096
2097
|
|
|
2097
|
-
|
|
2098
|
-
* [.monthNames](#greg.monthNames) : <code>Array.<string></code>
|
|
2099
|
-
* [.isLeapYear(year)](#greg.isLeapYear) ⇒ <code>boolean</code>
|
|
2100
|
-
* [.daysInMonth(month, year)](#greg.daysInMonth) ⇒ <code>number</code>
|
|
2101
|
-
* [.isDate(obj)](#greg.isDate) ⇒ <code>boolean</code>
|
|
2102
|
-
* [.dayOfYear(date)](#greg.dayOfYear) ⇒ <code>number</code>
|
|
2103
|
-
* [.greg2abs(date)](#greg.greg2abs) ⇒ <code>number</code>
|
|
2104
|
-
* [.abs2greg(theDate)](#greg.abs2greg) ⇒ <code>Date</code>
|
|
2098
|
+
**Kind**: global class
|
|
2105
2099
|
|
|
2106
|
-
|
|
2100
|
+
* [HebrewCalendar](#HebrewCalendar)
|
|
2101
|
+
* [.calendar([options])](#HebrewCalendar.calendar) ⇒ [<code>Array.<Event></code>](#Event)
|
|
2102
|
+
* [.getBirthdayOrAnniversary(hyear, gdate)](#HebrewCalendar.getBirthdayOrAnniversary) ⇒ [<code>HDate</code>](#HDate)
|
|
2103
|
+
* [.getYahrzeit(hyear, gdate)](#HebrewCalendar.getYahrzeit) ⇒ [<code>HDate</code>](#HDate)
|
|
2104
|
+
* [.getHolidaysForYear(year)](#HebrewCalendar.getHolidaysForYear) ⇒ <code>Map.<string, Array.<Event>></code>
|
|
2105
|
+
* [.getHolidaysForYearArray(year, il)](#HebrewCalendar.getHolidaysForYearArray) ⇒ [<code>Array.<Event></code>](#Event)
|
|
2106
|
+
* [.getHolidaysOnDate(date, [il])](#HebrewCalendar.getHolidaysOnDate) ⇒ [<code>Array.<Event></code>](#Event)
|
|
2107
|
+
* [.reformatTimeStr(timeStr, suffix, options)](#HebrewCalendar.reformatTimeStr) ⇒ <code>string</code>
|
|
2108
|
+
* [.version()](#HebrewCalendar.version) ⇒ <code>string</code>
|
|
2109
|
+
* [.getSedra(hyear, il)](#HebrewCalendar.getSedra) ⇒ [<code>Sedra</code>](#Sedra)
|
|
2110
|
+
* [.Options](#HebrewCalendar.Options) : <code>Object</code>
|
|
2107
2111
|
|
|
2108
|
-
|
|
2109
|
-
Long names of the Gregorian months (1='January', 12='December')
|
|
2112
|
+
<a name="HebrewCalendar.calendar"></a>
|
|
2110
2113
|
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
<a name="greg.isLeapYear"></a>
|
|
2114
|
+
### HebrewCalendar.calendar([options]) ⇒ [<code>Array.<Event></code>](#Event)
|
|
2115
|
+
Calculates holidays and other Hebrew calendar events based on [Options](#HebrewCalendar.Options).
|
|
2114
2116
|
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
+
Each holiday is represented by an [Event](#Event) object which includes a date,
|
|
2118
|
+
a description, flags and optional attributes.
|
|
2119
|
+
If given no options, returns holidays for the Diaspora for the current Gregorian year.
|
|
2117
2120
|
|
|
2118
|
-
|
|
2121
|
+
The date range returned by this function can be controlled by:
|
|
2122
|
+
* `options.year` - Gregorian (e.g. 1993) or Hebrew year (e.g. 5749)
|
|
2123
|
+
* `options.isHebrewYear` - to interpret `year` as Hebrew year
|
|
2124
|
+
* `options.numYears` - generate calendar for multiple years (default 1)
|
|
2125
|
+
* `options.month` - Gregorian or Hebrew month (to filter results to a single month)
|
|
2119
2126
|
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2127
|
+
Alternatively, specify start and end days with `Date` or [HDate](#HDate) instances:
|
|
2128
|
+
* `options.start` - use specific start date (requires `end` date)
|
|
2129
|
+
* `options.end` - use specific end date (requires `start` date)
|
|
2123
2130
|
|
|
2124
|
-
|
|
2131
|
+
Unless `options.noHolidays == true`, default holidays include:
|
|
2132
|
+
* Major holidays - Rosh Hashana, Yom Kippur, Pesach, Sukkot, etc.
|
|
2133
|
+
* Minor holidays - Purim, Chanukah, Tu BiShvat, Lag BaOmer, etc.
|
|
2134
|
+
* Minor fasts - Ta'anit Esther, Tzom Gedaliah, etc. (unless `options.noMinorFast`)
|
|
2135
|
+
* Special Shabbatot - Shabbat Shekalim, Zachor, etc. (unless `options.noSpecialShabbat`)
|
|
2136
|
+
* Modern Holidays - Yom HaShoah, Yom HaAtzma'ut, etc. (unless `options.noModern`)
|
|
2137
|
+
* Rosh Chodesh (unless `options.noRoshChodesh`)
|
|
2125
2138
|
|
|
2126
|
-
|
|
2127
|
-
|
|
2139
|
+
Holiday and Torah reading schedules differ between Israel and the Disapora.
|
|
2140
|
+
Set `options.il=true` to use the Israeli schedule.
|
|
2128
2141
|
|
|
2129
|
-
|
|
2142
|
+
Additional non-default event types can be specified:
|
|
2143
|
+
* Parashat HaShavua - weekly Torah Reading on Saturdays (`options.sedrot`)
|
|
2144
|
+
* Counting of the Omer (`options.omer`)
|
|
2145
|
+
* Daf Yomi (`options.dafyomi`)
|
|
2146
|
+
* Mishna Yomi (`options.mishnaYomi`)
|
|
2147
|
+
* Shabbat Mevarchim HaChodesh on Saturday before Rosh Chodesh (`options.shabbatMevarchim`)
|
|
2148
|
+
* Molad announcement on Saturday before Rosh Chodesh (`options.molad`)
|
|
2130
2149
|
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2150
|
+
Candle-lighting and Havdalah times are approximated using latitude and longitude
|
|
2151
|
+
specified by the [Location](#Location) class. The `Location` class contains a small
|
|
2152
|
+
database of cities with their associated geographic information and time-zone information.
|
|
2153
|
+
If you ever have any doubts about Hebcal's times, consult your local halachic authority.
|
|
2154
|
+
If you enter geographic coordinates above the arctic circle or antarctic circle,
|
|
2155
|
+
the times are guaranteed to be wrong.
|
|
2135
2156
|
|
|
2136
|
-
|
|
2157
|
+
To add candle-lighting options, set `options.candlelighting=true` and set
|
|
2158
|
+
`options.location` to an instance of `Location`. By default, candle lighting
|
|
2159
|
+
time is 18 minutes before sundown (40 minutes for Jerusalem) and Havdalah is
|
|
2160
|
+
calculated according to Tzeit Hakochavim - Nightfall (the point when 3 small stars
|
|
2161
|
+
are observable in the night time sky with the naked eye). The default Havdalah
|
|
2162
|
+
option (Tzeit Hakochavim) is calculated when the sun is 8.5° below the horizon.
|
|
2163
|
+
These defaults can be changed using these options:
|
|
2164
|
+
* `options.candleLightingMins` - minutes before sundown to light candles
|
|
2165
|
+
* `options.havdalahMins` - minutes after sundown for Havdalah (typical values are 42, 50, or 72).
|
|
2166
|
+
Havdalah times are supressed when `options.havdalahMins=0`.
|
|
2167
|
+
* `options.havdalahDeg` - degrees for solar depression for Havdalah.
|
|
2168
|
+
Default is 8.5 degrees for 3 small stars. Use 7.083 degress for 3 medium-sized stars.
|
|
2169
|
+
Havdalah times are supressed when `options.havdalahDeg=0`.
|
|
2137
2170
|
|
|
2138
|
-
|
|
2139
|
-
|
|
2171
|
+
If both `options.candlelighting=true` and `options.location` is specified,
|
|
2172
|
+
Chanukah candle-lighting times and minor fast start/end times will also be generated.
|
|
2173
|
+
Chanukah candle-lighting is at dusk (when the sun is 6.0° below the horizon in the evening)
|
|
2174
|
+
on weekdays, at regular candle-lighting time on Fridays, and at regular Havdalah time on
|
|
2175
|
+
Saturday night (see above).
|
|
2140
2176
|
|
|
2141
|
-
|
|
2177
|
+
Minor fasts begin at Alot HaShachar (sun is 16.1° below the horizon in the morning) and
|
|
2178
|
+
end when 3 medium-sized stars are observable in the night sky (sun is 7.083° below the horizon
|
|
2179
|
+
in the evening).
|
|
2142
2180
|
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2181
|
+
Two options also exist for generating an Event with the Hebrew date:
|
|
2182
|
+
* `options.addHebrewDates` - print the Hebrew date for the entire date range
|
|
2183
|
+
* `options.addHebrewDatesForEvents` - print the Hebrew date for dates with some events
|
|
2146
2184
|
|
|
2147
|
-
|
|
2185
|
+
Lastly, translation and transliteration of event titles is controlled by
|
|
2186
|
+
`options.locale` and the [Locale](#Locale) API.
|
|
2187
|
+
`@hebcal/core` supports three locales by default:
|
|
2188
|
+
* `en` - default, Sephardic transliterations (e.g. "Shabbat")
|
|
2189
|
+
* `ashkenazi` - Ashkenazi transliterations (e.g. "Shabbos")
|
|
2190
|
+
* `he` - Hebrew (e.g. "שַׁבָּת")
|
|
2148
2191
|
|
|
2149
|
-
|
|
2150
|
-
|
|
2192
|
+
Additional locales (such as `ru` or `fr`) are supported by the
|
|
2193
|
+
[@hebcal/locales](https://github.com/hebcal/hebcal-locales) package
|
|
2151
2194
|
|
|
2152
|
-
**Kind**: static method of [<code>
|
|
2195
|
+
**Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
|
|
2153
2196
|
|
|
2154
|
-
| Param | Type |
|
|
2197
|
+
| Param | Type | Default |
|
|
2155
2198
|
| --- | --- | --- |
|
|
2156
|
-
|
|
|
2157
|
-
|
|
2158
|
-
<a name="greg.greg2abs"></a>
|
|
2199
|
+
| [options] | [<code>Options</code>](#HebrewCalendar.Options) | <code>{}</code> |
|
|
2159
2200
|
|
|
2160
|
-
|
|
2161
|
-
|
|
2201
|
+
**Example**
|
|
2202
|
+
```js
|
|
2203
|
+
import {HebrewCalendar, HDate, Location, Event} from '@hebcal/core';
|
|
2204
|
+
const options = {
|
|
2205
|
+
year: 1981,
|
|
2206
|
+
isHebrewYear: false,
|
|
2207
|
+
candlelighting: true,
|
|
2208
|
+
location: Location.lookup('San Francisco'),
|
|
2209
|
+
sedrot: true,
|
|
2210
|
+
omer: true,
|
|
2211
|
+
};
|
|
2212
|
+
const events = HebrewCalendar.calendar(options);
|
|
2213
|
+
for (const ev of events) {
|
|
2214
|
+
const hd = ev.getDate();
|
|
2215
|
+
const date = hd.greg();
|
|
2216
|
+
console.log(date.toLocaleDateString(), ev.render(), hd.toString());
|
|
2217
|
+
}
|
|
2218
|
+
```
|
|
2219
|
+
<a name="HebrewCalendar.getBirthdayOrAnniversary"></a>
|
|
2162
2220
|
|
|
2163
|
-
|
|
2221
|
+
### HebrewCalendar.getBirthdayOrAnniversary(hyear, gdate) ⇒ [<code>HDate</code>](#HDate)
|
|
2222
|
+
Calculates a birthday or anniversary (non-yahrzeit).
|
|
2223
|
+
`hyear` must be after original `gdate` of anniversary.
|
|
2224
|
+
Returns `undefined` when requested year preceeds or is same as original year.
|
|
2164
2225
|
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
| date | <code>Date</code> | Gregorian date |
|
|
2226
|
+
Hebcal uses the algorithm defined in "Calendrical Calculations"
|
|
2227
|
+
by Edward M. Reingold and Nachum Dershowitz.
|
|
2168
2228
|
|
|
2169
|
-
|
|
2229
|
+
The birthday of someone born in Adar of an ordinary year or Adar II of
|
|
2230
|
+
a leap year is also always in the last month of the year, be that Adar
|
|
2231
|
+
or Adar II. The birthday in an ordinary year of someone born during the
|
|
2232
|
+
first 29 days of Adar I in a leap year is on the corresponding day of Adar;
|
|
2233
|
+
in a leap year, the birthday occurs in Adar I, as expected.
|
|
2170
2234
|
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
Three Historical Calendars'' by E. M. Reingold, N. Dershowitz, and S. M.
|
|
2175
|
-
Clamen, Software--Practice and Experience, Volume 23, Number 4
|
|
2176
|
-
(April, 1993), pages 383-404 for an explanation.
|
|
2235
|
+
Someone born on the thirtieth day of Marcheshvan, Kislev, or Adar I
|
|
2236
|
+
has his birthday postponed until the first of the following month in
|
|
2237
|
+
years where that day does not occur. [Calendrical Calculations p. 111]
|
|
2177
2238
|
|
|
2178
|
-
**Kind**: static method of [<code>
|
|
2239
|
+
**Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
|
|
2240
|
+
**Returns**: [<code>HDate</code>](#HDate) - anniversary occurring in `hyear`
|
|
2179
2241
|
|
|
2180
2242
|
| Param | Type | Description |
|
|
2181
2243
|
| --- | --- | --- |
|
|
2182
|
-
|
|
|
2244
|
+
| hyear | <code>number</code> | Hebrew year |
|
|
2245
|
+
| gdate | <code>Date</code> \| [<code>HDate</code>](#HDate) | Gregorian or Hebrew date of event |
|
|
2183
2246
|
|
|
2184
|
-
|
|
2247
|
+
**Example**
|
|
2248
|
+
```js
|
|
2249
|
+
import {HebrewCalendar} from '@hebcal/core';
|
|
2250
|
+
const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'
|
|
2251
|
+
const hd = HebrewCalendar.getBirthdayOrAnniversary(5780, dt); // '1 Nisan 5780'
|
|
2252
|
+
console.log(hd.greg().toLocaleDateString('en-US')); // '3/26/2020'
|
|
2253
|
+
```
|
|
2254
|
+
<a name="HebrewCalendar.getYahrzeit"></a>
|
|
2185
2255
|
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
* `ashkenazi` - Ashkenazi transliterations (e.g. "Shabbos")
|
|
2191
|
-
* `he` - Hebrew (e.g. "שַׁבָּת")
|
|
2192
|
-
* `he-x-NoNikud` - Hebrew without nikud (e.g. "שבת")
|
|
2256
|
+
### HebrewCalendar.getYahrzeit(hyear, gdate) ⇒ [<code>HDate</code>](#HDate)
|
|
2257
|
+
Calculates yahrzeit.
|
|
2258
|
+
`hyear` must be after original `gdate` of death.
|
|
2259
|
+
Returns `undefined` when requested year preceeds or is same as original year.
|
|
2193
2260
|
|
|
2194
|
-
|
|
2261
|
+
Hebcal uses the algorithm defined in "Calendrical Calculations"
|
|
2262
|
+
by Edward M. Reingold and Nachum Dershowitz.
|
|
2195
2263
|
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
* [.addLocale(locale, data)](#Locale.addLocale)
|
|
2200
|
-
* [.useLocale(locale)](#Locale.useLocale) ⇒ <code>LocaleData</code>
|
|
2201
|
-
* [.getLocaleName()](#Locale.getLocaleName) ⇒ <code>string</code>
|
|
2202
|
-
* [.getLocaleNames()](#Locale.getLocaleNames) ⇒ <code>Array.<string></code>
|
|
2203
|
-
* [.ordinal(n, [locale])](#Locale.ordinal) ⇒ <code>string</code>
|
|
2204
|
-
* [.hebrewStripNikkud(str)](#Locale.hebrewStripNikkud) ⇒ <code>string</code>
|
|
2264
|
+
The customary anniversary date of a death is more complicated and depends
|
|
2265
|
+
also on the character of the year in which the first anniversary occurs.
|
|
2266
|
+
There are several cases:
|
|
2205
2267
|
|
|
2206
|
-
|
|
2268
|
+
* If the date of death is Marcheshvan 30, the anniversary in general depends
|
|
2269
|
+
on the first anniversary; if that first anniversary was not Marcheshvan 30,
|
|
2270
|
+
use the day before Kislev 1.
|
|
2271
|
+
* If the date of death is Kislev 30, the anniversary in general again depends
|
|
2272
|
+
on the first anniversary — if that was not Kislev 30, use the day before
|
|
2273
|
+
Tevet 1.
|
|
2274
|
+
* If the date of death is Adar II, the anniversary is the same day in the
|
|
2275
|
+
last month of the Hebrew year (Adar or Adar II).
|
|
2276
|
+
* If the date of death is Adar I 30, the anniversary in a Hebrew year that
|
|
2277
|
+
is not a leap year (in which Adar only has 29 days) is the last day in
|
|
2278
|
+
Shevat.
|
|
2279
|
+
* In all other cases, use the normal (that is, same month number) anniversary
|
|
2280
|
+
of the date of death. [Calendrical Calculations p. 113]
|
|
2207
2281
|
|
|
2208
|
-
|
|
2209
|
-
Returns
|
|
2210
|
-
Otherwise, returns `undefined`.
|
|
2282
|
+
**Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
|
|
2283
|
+
**Returns**: [<code>HDate</code>](#HDate) - anniversary occurring in hyear
|
|
2211
2284
|
|
|
2212
|
-
|
|
2285
|
+
| Param | Type | Description |
|
|
2286
|
+
| --- | --- | --- |
|
|
2287
|
+
| hyear | <code>number</code> | Hebrew year |
|
|
2288
|
+
| gdate | <code>Date</code> \| [<code>HDate</code>](#HDate) | Gregorian or Hebrew date of death |
|
|
2289
|
+
|
|
2290
|
+
**Example**
|
|
2291
|
+
```js
|
|
2292
|
+
import {HebrewCalendar} from '@hebcal/core';
|
|
2293
|
+
const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'
|
|
2294
|
+
const hd = HebrewCalendar.getYahrzeit(5780, dt); // '30 Sh\'vat 5780'
|
|
2295
|
+
console.log(hd.greg().toLocaleDateString('en-US')); // '2/25/2020'
|
|
2296
|
+
```
|
|
2297
|
+
<a name="HebrewCalendar.getHolidaysForYear"></a>
|
|
2298
|
+
|
|
2299
|
+
### HebrewCalendar.getHolidaysForYear(year) ⇒ <code>Map.<string, Array.<Event>></code>
|
|
2300
|
+
Lower-level holidays interface, which returns a `Map` of `Event`s indexed by
|
|
2301
|
+
`HDate.toString()`. These events must filtered especially for `flags.IL_ONLY`
|
|
2302
|
+
or `flags.CHUL_ONLY` depending on Israel vs. Diaspora holiday scheme.
|
|
2303
|
+
|
|
2304
|
+
**Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
|
|
2305
|
+
|
|
2306
|
+
| Param | Type | Description |
|
|
2307
|
+
| --- | --- | --- |
|
|
2308
|
+
| year | <code>number</code> | Hebrew year |
|
|
2309
|
+
|
|
2310
|
+
<a name="HebrewCalendar.getHolidaysForYearArray"></a>
|
|
2311
|
+
|
|
2312
|
+
### HebrewCalendar.getHolidaysForYearArray(year, il) ⇒ [<code>Array.<Event></code>](#Event)
|
|
2313
|
+
Returns an array of holidays for the year
|
|
2314
|
+
|
|
2315
|
+
**Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
|
|
2316
|
+
|
|
2317
|
+
| Param | Type | Description |
|
|
2318
|
+
| --- | --- | --- |
|
|
2319
|
+
| year | <code>number</code> | Hebrew year |
|
|
2320
|
+
| il | <code>boolean</code> | use the Israeli schedule for holidays |
|
|
2321
|
+
|
|
2322
|
+
<a name="HebrewCalendar.getHolidaysOnDate"></a>
|
|
2323
|
+
|
|
2324
|
+
### HebrewCalendar.getHolidaysOnDate(date, [il]) ⇒ [<code>Array.<Event></code>](#Event)
|
|
2325
|
+
Returns an array of Events on this date (or undefined if no events)
|
|
2326
|
+
|
|
2327
|
+
**Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
|
|
2328
|
+
|
|
2329
|
+
| Param | Type | Description |
|
|
2330
|
+
| --- | --- | --- |
|
|
2331
|
+
| date | [<code>HDate</code>](#HDate) \| <code>Date</code> \| <code>number</code> | Hebrew Date, Gregorian date, or absolute R.D. day number |
|
|
2332
|
+
| [il] | <code>boolean</code> | use the Israeli schedule for holidays |
|
|
2333
|
+
|
|
2334
|
+
<a name="HebrewCalendar.reformatTimeStr"></a>
|
|
2335
|
+
|
|
2336
|
+
### HebrewCalendar.reformatTimeStr(timeStr, suffix, options) ⇒ <code>string</code>
|
|
2337
|
+
Helper function to format a 23-hour (00:00-23:59) time in US format ("8:13pm") or
|
|
2338
|
+
keep as "20:13" for any other locale/country. Uses `HebrewCalendar.Options` to determine
|
|
2339
|
+
locale.
|
|
2340
|
+
|
|
2341
|
+
**Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
|
|
2342
|
+
|
|
2343
|
+
| Param | Type | Description |
|
|
2344
|
+
| --- | --- | --- |
|
|
2345
|
+
| timeStr | <code>string</code> | original time like "20:30" |
|
|
2346
|
+
| suffix | <code>string</code> | "p" or "pm" or " P.M.". Add leading space if you want it |
|
|
2347
|
+
| options | [<code>Options</code>](#HebrewCalendar.Options) | |
|
|
2348
|
+
|
|
2349
|
+
<a name="HebrewCalendar.version"></a>
|
|
2350
|
+
|
|
2351
|
+
### HebrewCalendar.version() ⇒ <code>string</code>
|
|
2352
|
+
**Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
|
|
2353
|
+
<a name="HebrewCalendar.getSedra"></a>
|
|
2354
|
+
|
|
2355
|
+
### HebrewCalendar.getSedra(hyear, il) ⇒ [<code>Sedra</code>](#Sedra)
|
|
2356
|
+
Convenience function to create an instance of `Sedra` or reuse a previously
|
|
2357
|
+
created and cached instance.
|
|
2358
|
+
|
|
2359
|
+
**Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
|
|
2360
|
+
|
|
2361
|
+
| Param | Type |
|
|
2362
|
+
| --- | --- |
|
|
2363
|
+
| hyear | <code>number</code> |
|
|
2364
|
+
| il | <code>boolean</code> |
|
|
2365
|
+
|
|
2366
|
+
<a name="HebrewCalendar.Options"></a>
|
|
2367
|
+
|
|
2368
|
+
### HebrewCalendar.Options : <code>Object</code>
|
|
2369
|
+
Options to configure which events are returned
|
|
2370
|
+
|
|
2371
|
+
**Kind**: static typedef of [<code>HebrewCalendar</code>](#HebrewCalendar)
|
|
2372
|
+
**Properties**
|
|
2373
|
+
|
|
2374
|
+
| Name | Type | Description |
|
|
2375
|
+
| --- | --- | --- |
|
|
2376
|
+
| location | [<code>Location</code>](#Location) | latitude/longitude/tzid used for candle-lighting |
|
|
2377
|
+
| year | <code>number</code> | Gregorian or Hebrew year |
|
|
2378
|
+
| isHebrewYear | <code>boolean</code> | to interpret year as Hebrew year |
|
|
2379
|
+
| month | <code>number</code> | Gregorian or Hebrew month (to filter results to a single month) |
|
|
2380
|
+
| numYears | <code>number</code> | generate calendar for multiple years (default 1) |
|
|
2381
|
+
| start | <code>Date</code> \| [<code>HDate</code>](#HDate) \| <code>number</code> | use specific start date (requires end date) |
|
|
2382
|
+
| end | <code>Date</code> \| [<code>HDate</code>](#HDate) \| <code>number</code> | use specific end date (requires start date) |
|
|
2383
|
+
| candlelighting | <code>boolean</code> | calculate candle-lighting and havdalah times |
|
|
2384
|
+
| candleLightingMins | <code>number</code> | minutes before sundown to light candles (default 18) |
|
|
2385
|
+
| havdalahMins | <code>number</code> | minutes after sundown for Havdalah (typical values are 42, 50, or 72). If `undefined` (the default), calculate Havdalah according to Tzeit Hakochavim - Nightfall (the point when 3 small stars are observable in the night time sky with the naked eye). If `0`, Havdalah times are supressed. |
|
|
2386
|
+
| havdalahDeg | <code>number</code> | degrees for solar depression for Havdalah. Default is 8.5 degrees for 3 small stars. use 7.083 degress for 3 medium-sized stars. If `0`, Havdalah times are supressed. |
|
|
2387
|
+
| sedrot | <code>boolean</code> | calculate parashah hashavua on Saturdays |
|
|
2388
|
+
| il | <code>boolean</code> | Israeli holiday and sedra schedule |
|
|
2389
|
+
| noMinorFast | <code>boolean</code> | suppress minor fasts |
|
|
2390
|
+
| noModern | <code>boolean</code> | suppress modern holidays |
|
|
2391
|
+
| noRoshChodesh | <code>boolean</code> | suppress Rosh Chodesh |
|
|
2392
|
+
| shabbatMevarchim | <code>boolean</code> | add Shabbat Mevarchim |
|
|
2393
|
+
| noSpecialShabbat | <code>boolean</code> | suppress Special Shabbat |
|
|
2394
|
+
| noHolidays | <code>boolean</code> | suppress regular holidays |
|
|
2395
|
+
| dafyomi | <code>boolean</code> | include Daf Yomi |
|
|
2396
|
+
| mishnaYomi | <code>boolean</code> | include Mishna Yomi |
|
|
2397
|
+
| omer | <code>boolean</code> | include Days of the Omer |
|
|
2398
|
+
| molad | <code>boolean</code> | include event announcing the molad |
|
|
2399
|
+
| ashkenazi | <code>boolean</code> | use Ashkenazi transliterations for event titles (default Sephardi transliterations) |
|
|
2400
|
+
| locale | <code>string</code> | translate event titles according to a locale Default value is `en`, also built-in are `he` and `ashkenazi`. Additional locales (such as `ru` or `fr`) are provided by the [@hebcal/locales](https://github.com/hebcal/hebcal-locales) package |
|
|
2401
|
+
| addHebrewDates | <code>boolean</code> | print the Hebrew date for the entire date range |
|
|
2402
|
+
| addHebrewDatesForEvents | <code>boolean</code> | print the Hebrew date for dates with some events |
|
|
2403
|
+
| mask | <code>number</code> | use bitmask from `flags` to filter events |
|
|
2404
|
+
|
|
2405
|
+
<a name="greg"></a>
|
|
2406
|
+
|
|
2407
|
+
## greg : <code>object</code>
|
|
2408
|
+
Gregorian date helper functions.
|
|
2409
|
+
|
|
2410
|
+
**Kind**: global namespace
|
|
2411
|
+
|
|
2412
|
+
* [greg](#greg) : <code>object</code>
|
|
2413
|
+
* [.monthNames](#greg.monthNames) : <code>Array.<string></code>
|
|
2414
|
+
* [.isLeapYear(year)](#greg.isLeapYear) ⇒ <code>boolean</code>
|
|
2415
|
+
* [.daysInMonth(month, year)](#greg.daysInMonth) ⇒ <code>number</code>
|
|
2416
|
+
* [.isDate(obj)](#greg.isDate) ⇒ <code>boolean</code>
|
|
2417
|
+
* [.dayOfYear(date)](#greg.dayOfYear) ⇒ <code>number</code>
|
|
2418
|
+
* [.greg2abs(date)](#greg.greg2abs) ⇒ <code>number</code>
|
|
2419
|
+
* [.abs2greg(theDate)](#greg.abs2greg) ⇒ <code>Date</code>
|
|
2420
|
+
|
|
2421
|
+
<a name="greg.monthNames"></a>
|
|
2422
|
+
|
|
2423
|
+
### greg.monthNames : <code>Array.<string></code>
|
|
2424
|
+
Long names of the Gregorian months (1='January', 12='December')
|
|
2425
|
+
|
|
2426
|
+
**Kind**: static property of [<code>greg</code>](#greg)
|
|
2427
|
+
**Read only**: true
|
|
2428
|
+
<a name="greg.isLeapYear"></a>
|
|
2429
|
+
|
|
2430
|
+
### greg.isLeapYear(year) ⇒ <code>boolean</code>
|
|
2431
|
+
Returns true if the Gregorian year is a leap year
|
|
2432
|
+
|
|
2433
|
+
**Kind**: static method of [<code>greg</code>](#greg)
|
|
2434
|
+
|
|
2435
|
+
| Param | Type | Description |
|
|
2436
|
+
| --- | --- | --- |
|
|
2437
|
+
| year | <code>number</code> | Gregorian year |
|
|
2438
|
+
|
|
2439
|
+
<a name="greg.daysInMonth"></a>
|
|
2440
|
+
|
|
2441
|
+
### greg.daysInMonth(month, year) ⇒ <code>number</code>
|
|
2442
|
+
Number of days in the Gregorian month for given year
|
|
2443
|
+
|
|
2444
|
+
**Kind**: static method of [<code>greg</code>](#greg)
|
|
2445
|
+
|
|
2446
|
+
| Param | Type | Description |
|
|
2447
|
+
| --- | --- | --- |
|
|
2448
|
+
| month | <code>number</code> | Gregorian month (1=January, 12=December) |
|
|
2449
|
+
| year | <code>number</code> | Gregorian year |
|
|
2450
|
+
|
|
2451
|
+
<a name="greg.isDate"></a>
|
|
2452
|
+
|
|
2453
|
+
### greg.isDate(obj) ⇒ <code>boolean</code>
|
|
2454
|
+
Returns true if the object is a Javascript Date
|
|
2455
|
+
|
|
2456
|
+
**Kind**: static method of [<code>greg</code>](#greg)
|
|
2457
|
+
|
|
2458
|
+
| Param | Type |
|
|
2459
|
+
| --- | --- |
|
|
2460
|
+
| obj | <code>Object</code> |
|
|
2461
|
+
|
|
2462
|
+
<a name="greg.dayOfYear"></a>
|
|
2463
|
+
|
|
2464
|
+
### greg.dayOfYear(date) ⇒ <code>number</code>
|
|
2465
|
+
Returns number of days since January 1 of that year
|
|
2466
|
+
|
|
2467
|
+
**Kind**: static method of [<code>greg</code>](#greg)
|
|
2468
|
+
|
|
2469
|
+
| Param | Type | Description |
|
|
2470
|
+
| --- | --- | --- |
|
|
2471
|
+
| date | <code>Date</code> | Gregorian date |
|
|
2472
|
+
|
|
2473
|
+
<a name="greg.greg2abs"></a>
|
|
2474
|
+
|
|
2475
|
+
### greg.greg2abs(date) ⇒ <code>number</code>
|
|
2476
|
+
Converts Gregorian date to absolute R.D. (Rata Die) days
|
|
2477
|
+
|
|
2478
|
+
**Kind**: static method of [<code>greg</code>](#greg)
|
|
2479
|
+
|
|
2480
|
+
| Param | Type | Description |
|
|
2481
|
+
| --- | --- | --- |
|
|
2482
|
+
| date | <code>Date</code> | Gregorian date |
|
|
2483
|
+
|
|
2484
|
+
<a name="greg.abs2greg"></a>
|
|
2485
|
+
|
|
2486
|
+
### greg.abs2greg(theDate) ⇒ <code>Date</code>
|
|
2487
|
+
Converts from Rata Die (R.D. number) to Gregorian date.
|
|
2488
|
+
See the footnote on page 384 of ``Calendrical Calculations, Part II:
|
|
2489
|
+
Three Historical Calendars'' by E. M. Reingold, N. Dershowitz, and S. M.
|
|
2490
|
+
Clamen, Software--Practice and Experience, Volume 23, Number 4
|
|
2491
|
+
(April, 1993), pages 383-404 for an explanation.
|
|
2492
|
+
|
|
2493
|
+
**Kind**: static method of [<code>greg</code>](#greg)
|
|
2494
|
+
|
|
2495
|
+
| Param | Type | Description |
|
|
2496
|
+
| --- | --- | --- |
|
|
2497
|
+
| theDate | <code>number</code> | R.D. number of days |
|
|
2498
|
+
|
|
2499
|
+
<a name="Locale"></a>
|
|
2500
|
+
|
|
2501
|
+
## Locale : <code>object</code>
|
|
2502
|
+
A locale in Hebcal is used for translations/transliterations of
|
|
2503
|
+
holidays. `@hebcal/core` supports four locales by default
|
|
2504
|
+
* `en` - default, Sephardic transliterations (e.g. "Shabbat")
|
|
2505
|
+
* `ashkenazi` - Ashkenazi transliterations (e.g. "Shabbos")
|
|
2506
|
+
* `he` - Hebrew (e.g. "שַׁבָּת")
|
|
2507
|
+
* `he-x-NoNikud` - Hebrew without nikud (e.g. "שבת")
|
|
2508
|
+
|
|
2509
|
+
**Kind**: global namespace
|
|
2510
|
+
|
|
2511
|
+
* [Locale](#Locale) : <code>object</code>
|
|
2512
|
+
* [.lookupTranslation(id, [locale])](#Locale.lookupTranslation) ⇒ <code>string</code>
|
|
2513
|
+
* [.gettext(id, [locale])](#Locale.gettext) ⇒ <code>string</code>
|
|
2514
|
+
* [.addLocale(locale, data)](#Locale.addLocale)
|
|
2515
|
+
* [.useLocale(locale)](#Locale.useLocale) ⇒ <code>LocaleData</code>
|
|
2516
|
+
* [.getLocaleName()](#Locale.getLocaleName) ⇒ <code>string</code>
|
|
2517
|
+
* [.getLocaleNames()](#Locale.getLocaleNames) ⇒ <code>Array.<string></code>
|
|
2518
|
+
* [.ordinal(n, [locale])](#Locale.ordinal) ⇒ <code>string</code>
|
|
2519
|
+
* [.hebrewStripNikkud(str)](#Locale.hebrewStripNikkud) ⇒ <code>string</code>
|
|
2520
|
+
|
|
2521
|
+
<a name="Locale.lookupTranslation"></a>
|
|
2522
|
+
|
|
2523
|
+
### Locale.lookupTranslation(id, [locale]) ⇒ <code>string</code>
|
|
2524
|
+
Returns translation only if `locale` offers a non-empty translation for `id`.
|
|
2525
|
+
Otherwise, returns `undefined`.
|
|
2526
|
+
|
|
2527
|
+
**Kind**: static method of [<code>Locale</code>](#Locale)
|
|
2213
2528
|
|
|
2214
2529
|
| Param | Type | Description |
|
|
2215
2530
|
| --- | --- | --- |
|
|
@@ -2354,328 +2669,13 @@ parshiot[0] == 'Bereshit', parshiot[1] == 'Noach', parshiot[53] == "Ha'Azinu".
|
|
|
2354
2669
|
|
|
2355
2670
|
**Kind**: global constant
|
|
2356
2671
|
**Read only**: true
|
|
2357
|
-
<a name="
|
|
2672
|
+
<a name="gematriya"></a>
|
|
2358
2673
|
|
|
2359
|
-
##
|
|
2360
|
-
|
|
2361
|
-
This namespace is used to calculate holidays, rosh chodesh, candle lighting & havdalah times,
|
|
2362
|
-
Parashat HaShavua, Daf Yomi, days of the omer, and the molad.
|
|
2363
|
-
Event names can be rendered in several languges using the `locale` option.
|
|
2674
|
+
## gematriya(number) ⇒ <code>string</code>
|
|
2675
|
+
Converts a numerical value to a string of Hebrew letters.
|
|
2364
2676
|
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
* [HebrewCalendar](#HebrewCalendar)
|
|
2368
|
-
* [.calendar([options])](#HebrewCalendar.calendar) ⇒ [<code>Array.<Event></code>](#Event)
|
|
2369
|
-
* [.getBirthdayOrAnniversary(hyear, gdate)](#HebrewCalendar.getBirthdayOrAnniversary) ⇒ [<code>HDate</code>](#HDate)
|
|
2370
|
-
* [.getYahrzeit(hyear, gdate)](#HebrewCalendar.getYahrzeit) ⇒ [<code>HDate</code>](#HDate)
|
|
2371
|
-
* [.getHolidaysForYear(year)](#HebrewCalendar.getHolidaysForYear) ⇒ <code>Map.<string, Array.<Event>></code>
|
|
2372
|
-
* [.getHolidaysForYearArray(year, il)](#HebrewCalendar.getHolidaysForYearArray) ⇒ [<code>Array.<Event></code>](#Event)
|
|
2373
|
-
* [.getHolidaysOnDate(date, [il])](#HebrewCalendar.getHolidaysOnDate) ⇒ [<code>Array.<Event></code>](#Event)
|
|
2374
|
-
* [.reformatTimeStr(timeStr, suffix, options)](#HebrewCalendar.reformatTimeStr) ⇒ <code>string</code>
|
|
2375
|
-
* [.version()](#HebrewCalendar.version) ⇒ <code>string</code>
|
|
2376
|
-
* [.getSedra(hyear, il)](#HebrewCalendar.getSedra) ⇒ [<code>Sedra</code>](#Sedra)
|
|
2377
|
-
* [.Options](#HebrewCalendar.Options) : <code>Object</code>
|
|
2378
|
-
|
|
2379
|
-
<a name="HebrewCalendar.calendar"></a>
|
|
2380
|
-
|
|
2381
|
-
### HebrewCalendar.calendar([options]) ⇒ [<code>Array.<Event></code>](#Event)
|
|
2382
|
-
Calculates holidays and other Hebrew calendar events based on [Options](#HebrewCalendar.Options).
|
|
2383
|
-
|
|
2384
|
-
Each holiday is represented by an [Event](#Event) object which includes a date,
|
|
2385
|
-
a description, flags and optional attributes.
|
|
2386
|
-
If given no options, returns holidays for the Diaspora for the current Gregorian year.
|
|
2387
|
-
|
|
2388
|
-
The date range returned by this function can be controlled by:
|
|
2389
|
-
* `options.year` - Gregorian (e.g. 1993) or Hebrew year (e.g. 5749)
|
|
2390
|
-
* `options.isHebrewYear` - to interpret `year` as Hebrew year
|
|
2391
|
-
* `options.numYears` - generate calendar for multiple years (default 1)
|
|
2392
|
-
* `options.month` - Gregorian or Hebrew month (to filter results to a single month)
|
|
2393
|
-
|
|
2394
|
-
Alternatively, specify start and end days with `Date` or [HDate](#HDate) instances:
|
|
2395
|
-
* `options.start` - use specific start date (requires `end` date)
|
|
2396
|
-
* `options.end` - use specific end date (requires `start` date)
|
|
2397
|
-
|
|
2398
|
-
Unless `options.noHolidays == true`, default holidays include:
|
|
2399
|
-
* Major holidays - Rosh Hashana, Yom Kippur, Pesach, Sukkot, etc.
|
|
2400
|
-
* Minor holidays - Purim, Chanukah, Tu BiShvat, Lag BaOmer, etc.
|
|
2401
|
-
* Minor fasts - Ta'anit Esther, Tzom Gedaliah, etc. (unless `options.noMinorFast`)
|
|
2402
|
-
* Special Shabbatot - Shabbat Shekalim, Zachor, etc. (unless `options.noSpecialShabbat`)
|
|
2403
|
-
* Modern Holidays - Yom HaShoah, Yom HaAtzma'ut, etc. (unless `options.noModern`)
|
|
2404
|
-
* Rosh Chodesh (unless `options.noRoshChodesh`)
|
|
2405
|
-
|
|
2406
|
-
Holiday and Torah reading schedules differ between Israel and the Disapora.
|
|
2407
|
-
Set `options.il=true` to use the Israeli schedule.
|
|
2408
|
-
|
|
2409
|
-
Additional non-default event types can be specified:
|
|
2410
|
-
* Parashat HaShavua - weekly Torah Reading on Saturdays (`options.sedrot`)
|
|
2411
|
-
* Counting of the Omer (`options.omer`)
|
|
2412
|
-
* Daf Yomi (`options.dafyomi`)
|
|
2413
|
-
* Mishna Yomi (`options.mishnaYomi`)
|
|
2414
|
-
* Shabbat Mevarchim HaChodesh on Saturday before Rosh Chodesh (`options.shabbatMevarchim`)
|
|
2415
|
-
* Molad announcement on Saturday before Rosh Chodesh (`options.molad`)
|
|
2416
|
-
|
|
2417
|
-
Candle-lighting and Havdalah times are approximated using latitude and longitude
|
|
2418
|
-
specified by the [Location](#Location) class. The `Location` class contains a small
|
|
2419
|
-
database of cities with their associated geographic information and time-zone information.
|
|
2420
|
-
If you ever have any doubts about Hebcal's times, consult your local halachic authority.
|
|
2421
|
-
If you enter geographic coordinates above the arctic circle or antarctic circle,
|
|
2422
|
-
the times are guaranteed to be wrong.
|
|
2423
|
-
|
|
2424
|
-
To add candle-lighting options, set `options.candlelighting=true` and set
|
|
2425
|
-
`options.location` to an instance of `Location`. By default, candle lighting
|
|
2426
|
-
time is 18 minutes before sundown (40 minutes for Jerusalem) and Havdalah is
|
|
2427
|
-
calculated according to Tzeit Hakochavim - Nightfall (the point when 3 small stars
|
|
2428
|
-
are observable in the night time sky with the naked eye). The default Havdalah
|
|
2429
|
-
option (Tzeit Hakochavim) is calculated when the sun is 8.5° below the horizon.
|
|
2430
|
-
These defaults can be changed using these options:
|
|
2431
|
-
* `options.candleLightingMins` - minutes before sundown to light candles
|
|
2432
|
-
* `options.havdalahMins` - minutes after sundown for Havdalah (typical values are 42, 50, or 72).
|
|
2433
|
-
Havdalah times are supressed when `options.havdalahMins=0`.
|
|
2434
|
-
* `options.havdalahDeg` - degrees for solar depression for Havdalah.
|
|
2435
|
-
Default is 8.5 degrees for 3 small stars. Use 7.083 degress for 3 medium-sized stars.
|
|
2436
|
-
Havdalah times are supressed when `options.havdalahDeg=0`.
|
|
2437
|
-
|
|
2438
|
-
If both `options.candlelighting=true` and `options.location` is specified,
|
|
2439
|
-
Chanukah candle-lighting times and minor fast start/end times will also be generated.
|
|
2440
|
-
Chanukah candle-lighting is at dusk (when the sun is 6.0° below the horizon in the evening)
|
|
2441
|
-
on weekdays, at regular candle-lighting time on Fridays, and at regular Havdalah time on
|
|
2442
|
-
Saturday night (see above).
|
|
2443
|
-
|
|
2444
|
-
Minor fasts begin at Alot HaShachar (sun is 16.1° below the horizon in the morning) and
|
|
2445
|
-
end when 3 medium-sized stars are observable in the night sky (sun is 7.083° below the horizon
|
|
2446
|
-
in the evening).
|
|
2447
|
-
|
|
2448
|
-
Two options also exist for generating an Event with the Hebrew date:
|
|
2449
|
-
* `options.addHebrewDates` - print the Hebrew date for the entire date range
|
|
2450
|
-
* `options.addHebrewDatesForEvents` - print the Hebrew date for dates with some events
|
|
2451
|
-
|
|
2452
|
-
Lastly, translation and transliteration of event titles is controlled by
|
|
2453
|
-
`options.locale` and the [Locale](#Locale) API.
|
|
2454
|
-
`@hebcal/core` supports three locales by default:
|
|
2455
|
-
* `en` - default, Sephardic transliterations (e.g. "Shabbat")
|
|
2456
|
-
* `ashkenazi` - Ashkenazi transliterations (e.g. "Shabbos")
|
|
2457
|
-
* `he` - Hebrew (e.g. "שַׁבָּת")
|
|
2458
|
-
|
|
2459
|
-
Additional locales (such as `ru` or `fr`) are supported by the
|
|
2460
|
-
[@hebcal/locales](https://github.com/hebcal/hebcal-locales) package
|
|
2461
|
-
|
|
2462
|
-
**Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
|
|
2463
|
-
|
|
2464
|
-
| Param | Type | Default |
|
|
2465
|
-
| --- | --- | --- |
|
|
2466
|
-
| [options] | [<code>Options</code>](#HebrewCalendar.Options) | <code>{}</code> |
|
|
2467
|
-
|
|
2468
|
-
**Example**
|
|
2469
|
-
```js
|
|
2470
|
-
import {HebrewCalendar, HDate, Location, Event} from '@hebcal/core';
|
|
2471
|
-
const options = {
|
|
2472
|
-
year: 1981,
|
|
2473
|
-
isHebrewYear: false,
|
|
2474
|
-
candlelighting: true,
|
|
2475
|
-
location: Location.lookup('San Francisco'),
|
|
2476
|
-
sedrot: true,
|
|
2477
|
-
omer: true,
|
|
2478
|
-
};
|
|
2479
|
-
const events = HebrewCalendar.calendar(options);
|
|
2480
|
-
for (const ev of events) {
|
|
2481
|
-
const hd = ev.getDate();
|
|
2482
|
-
const date = hd.greg();
|
|
2483
|
-
console.log(date.toLocaleDateString(), ev.render(), hd.toString());
|
|
2484
|
-
}
|
|
2485
|
-
```
|
|
2486
|
-
<a name="HebrewCalendar.getBirthdayOrAnniversary"></a>
|
|
2487
|
-
|
|
2488
|
-
### HebrewCalendar.getBirthdayOrAnniversary(hyear, gdate) ⇒ [<code>HDate</code>](#HDate)
|
|
2489
|
-
Calculates a birthday or anniversary (non-yahrzeit).
|
|
2490
|
-
`hyear` must be after original `gdate` of anniversary.
|
|
2491
|
-
Returns `undefined` when requested year preceeds or is same as original year.
|
|
2492
|
-
|
|
2493
|
-
Hebcal uses the algorithm defined in "Calendrical Calculations"
|
|
2494
|
-
by Edward M. Reingold and Nachum Dershowitz.
|
|
2495
|
-
|
|
2496
|
-
The birthday of someone born in Adar of an ordinary year or Adar II of
|
|
2497
|
-
a leap year is also always in the last month of the year, be that Adar
|
|
2498
|
-
or Adar II. The birthday in an ordinary year of someone born during the
|
|
2499
|
-
first 29 days of Adar I in a leap year is on the corresponding day of Adar;
|
|
2500
|
-
in a leap year, the birthday occurs in Adar I, as expected.
|
|
2501
|
-
|
|
2502
|
-
Someone born on the thirtieth day of Marcheshvan, Kislev, or Adar I
|
|
2503
|
-
has his birthday postponed until the first of the following month in
|
|
2504
|
-
years where that day does not occur. [Calendrical Calculations p. 111]
|
|
2505
|
-
|
|
2506
|
-
**Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
|
|
2507
|
-
**Returns**: [<code>HDate</code>](#HDate) - anniversary occurring in `hyear`
|
|
2508
|
-
|
|
2509
|
-
| Param | Type | Description |
|
|
2510
|
-
| --- | --- | --- |
|
|
2511
|
-
| hyear | <code>number</code> | Hebrew year |
|
|
2512
|
-
| gdate | <code>Date</code> \| [<code>HDate</code>](#HDate) | Gregorian or Hebrew date of event |
|
|
2513
|
-
|
|
2514
|
-
**Example**
|
|
2515
|
-
```js
|
|
2516
|
-
import {HebrewCalendar} from '@hebcal/core';
|
|
2517
|
-
const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'
|
|
2518
|
-
const hd = HebrewCalendar.getBirthdayOrAnniversary(5780, dt); // '1 Nisan 5780'
|
|
2519
|
-
console.log(hd.greg().toLocaleDateString('en-US')); // '3/26/2020'
|
|
2520
|
-
```
|
|
2521
|
-
<a name="HebrewCalendar.getYahrzeit"></a>
|
|
2522
|
-
|
|
2523
|
-
### HebrewCalendar.getYahrzeit(hyear, gdate) ⇒ [<code>HDate</code>](#HDate)
|
|
2524
|
-
Calculates yahrzeit.
|
|
2525
|
-
`hyear` must be after original `gdate` of death.
|
|
2526
|
-
Returns `undefined` when requested year preceeds or is same as original year.
|
|
2527
|
-
|
|
2528
|
-
Hebcal uses the algorithm defined in "Calendrical Calculations"
|
|
2529
|
-
by Edward M. Reingold and Nachum Dershowitz.
|
|
2530
|
-
|
|
2531
|
-
The customary anniversary date of a death is more complicated and depends
|
|
2532
|
-
also on the character of the year in which the first anniversary occurs.
|
|
2533
|
-
There are several cases:
|
|
2534
|
-
|
|
2535
|
-
* If the date of death is Marcheshvan 30, the anniversary in general depends
|
|
2536
|
-
on the first anniversary; if that first anniversary was not Marcheshvan 30,
|
|
2537
|
-
use the day before Kislev 1.
|
|
2538
|
-
* If the date of death is Kislev 30, the anniversary in general again depends
|
|
2539
|
-
on the first anniversary — if that was not Kislev 30, use the day before
|
|
2540
|
-
Tevet 1.
|
|
2541
|
-
* If the date of death is Adar II, the anniversary is the same day in the
|
|
2542
|
-
last month of the Hebrew year (Adar or Adar II).
|
|
2543
|
-
* If the date of death is Adar I 30, the anniversary in a Hebrew year that
|
|
2544
|
-
is not a leap year (in which Adar only has 29 days) is the last day in
|
|
2545
|
-
Shevat.
|
|
2546
|
-
* In all other cases, use the normal (that is, same month number) anniversary
|
|
2547
|
-
of the date of death. [Calendrical Calculations p. 113]
|
|
2548
|
-
|
|
2549
|
-
**Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
|
|
2550
|
-
**Returns**: [<code>HDate</code>](#HDate) - anniversary occurring in hyear
|
|
2551
|
-
|
|
2552
|
-
| Param | Type | Description |
|
|
2553
|
-
| --- | --- | --- |
|
|
2554
|
-
| hyear | <code>number</code> | Hebrew year |
|
|
2555
|
-
| gdate | <code>Date</code> \| [<code>HDate</code>](#HDate) | Gregorian or Hebrew date of death |
|
|
2556
|
-
|
|
2557
|
-
**Example**
|
|
2558
|
-
```js
|
|
2559
|
-
import {HebrewCalendar} from '@hebcal/core';
|
|
2560
|
-
const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'
|
|
2561
|
-
const hd = HebrewCalendar.getYahrzeit(5780, dt); // '30 Sh\'vat 5780'
|
|
2562
|
-
console.log(hd.greg().toLocaleDateString('en-US')); // '2/25/2020'
|
|
2563
|
-
```
|
|
2564
|
-
<a name="HebrewCalendar.getHolidaysForYear"></a>
|
|
2565
|
-
|
|
2566
|
-
### HebrewCalendar.getHolidaysForYear(year) ⇒ <code>Map.<string, Array.<Event>></code>
|
|
2567
|
-
Lower-level holidays interface, which returns a `Map` of `Event`s indexed by
|
|
2568
|
-
`HDate.toString()`. These events must filtered especially for `flags.IL_ONLY`
|
|
2569
|
-
or `flags.CHUL_ONLY` depending on Israel vs. Diaspora holiday scheme.
|
|
2570
|
-
|
|
2571
|
-
**Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
|
|
2572
|
-
|
|
2573
|
-
| Param | Type | Description |
|
|
2574
|
-
| --- | --- | --- |
|
|
2575
|
-
| year | <code>number</code> | Hebrew year |
|
|
2576
|
-
|
|
2577
|
-
<a name="HebrewCalendar.getHolidaysForYearArray"></a>
|
|
2578
|
-
|
|
2579
|
-
### HebrewCalendar.getHolidaysForYearArray(year, il) ⇒ [<code>Array.<Event></code>](#Event)
|
|
2580
|
-
Returns an array of holidays for the year
|
|
2581
|
-
|
|
2582
|
-
**Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
|
|
2583
|
-
|
|
2584
|
-
| Param | Type | Description |
|
|
2585
|
-
| --- | --- | --- |
|
|
2586
|
-
| year | <code>number</code> | Hebrew year |
|
|
2587
|
-
| il | <code>boolean</code> | use the Israeli schedule for holidays |
|
|
2588
|
-
|
|
2589
|
-
<a name="HebrewCalendar.getHolidaysOnDate"></a>
|
|
2590
|
-
|
|
2591
|
-
### HebrewCalendar.getHolidaysOnDate(date, [il]) ⇒ [<code>Array.<Event></code>](#Event)
|
|
2592
|
-
Returns an array of Events on this date (or undefined if no events)
|
|
2593
|
-
|
|
2594
|
-
**Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
|
|
2595
|
-
|
|
2596
|
-
| Param | Type | Description |
|
|
2597
|
-
| --- | --- | --- |
|
|
2598
|
-
| date | [<code>HDate</code>](#HDate) \| <code>Date</code> \| <code>number</code> | Hebrew Date, Gregorian date, or absolute R.D. day number |
|
|
2599
|
-
| [il] | <code>boolean</code> | use the Israeli schedule for holidays |
|
|
2600
|
-
|
|
2601
|
-
<a name="HebrewCalendar.reformatTimeStr"></a>
|
|
2602
|
-
|
|
2603
|
-
### HebrewCalendar.reformatTimeStr(timeStr, suffix, options) ⇒ <code>string</code>
|
|
2604
|
-
Helper function to format a 23-hour (00:00-23:59) time in US format ("8:13pm") or
|
|
2605
|
-
keep as "20:13" for any other locale/country. Uses `HebrewCalendar.Options` to determine
|
|
2606
|
-
locale.
|
|
2607
|
-
|
|
2608
|
-
**Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
|
|
2609
|
-
|
|
2610
|
-
| Param | Type | Description |
|
|
2611
|
-
| --- | --- | --- |
|
|
2612
|
-
| timeStr | <code>string</code> | original time like "20:30" |
|
|
2613
|
-
| suffix | <code>string</code> | "p" or "pm" or " P.M.". Add leading space if you want it |
|
|
2614
|
-
| options | [<code>Options</code>](#HebrewCalendar.Options) | |
|
|
2615
|
-
|
|
2616
|
-
<a name="HebrewCalendar.version"></a>
|
|
2617
|
-
|
|
2618
|
-
### HebrewCalendar.version() ⇒ <code>string</code>
|
|
2619
|
-
**Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
|
|
2620
|
-
<a name="HebrewCalendar.getSedra"></a>
|
|
2621
|
-
|
|
2622
|
-
### HebrewCalendar.getSedra(hyear, il) ⇒ [<code>Sedra</code>](#Sedra)
|
|
2623
|
-
Convenience function to create an instance of `Sedra` or reuse a previously
|
|
2624
|
-
created and cached instance.
|
|
2625
|
-
|
|
2626
|
-
**Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
|
|
2627
|
-
|
|
2628
|
-
| Param | Type |
|
|
2629
|
-
| --- | --- |
|
|
2630
|
-
| hyear | <code>number</code> |
|
|
2631
|
-
| il | <code>boolean</code> |
|
|
2632
|
-
|
|
2633
|
-
<a name="HebrewCalendar.Options"></a>
|
|
2634
|
-
|
|
2635
|
-
### HebrewCalendar.Options : <code>Object</code>
|
|
2636
|
-
Options to configure which events are returned
|
|
2637
|
-
|
|
2638
|
-
**Kind**: static typedef of [<code>HebrewCalendar</code>](#HebrewCalendar)
|
|
2639
|
-
**Properties**
|
|
2640
|
-
|
|
2641
|
-
| Name | Type | Description |
|
|
2642
|
-
| --- | --- | --- |
|
|
2643
|
-
| location | [<code>Location</code>](#Location) | latitude/longitude/tzid used for candle-lighting |
|
|
2644
|
-
| year | <code>number</code> | Gregorian or Hebrew year |
|
|
2645
|
-
| isHebrewYear | <code>boolean</code> | to interpret year as Hebrew year |
|
|
2646
|
-
| month | <code>number</code> | Gregorian or Hebrew month (to filter results to a single month) |
|
|
2647
|
-
| numYears | <code>number</code> | generate calendar for multiple years (default 1) |
|
|
2648
|
-
| start | <code>Date</code> \| [<code>HDate</code>](#HDate) \| <code>number</code> | use specific start date (requires end date) |
|
|
2649
|
-
| end | <code>Date</code> \| [<code>HDate</code>](#HDate) \| <code>number</code> | use specific end date (requires start date) |
|
|
2650
|
-
| candlelighting | <code>boolean</code> | calculate candle-lighting and havdalah times |
|
|
2651
|
-
| candleLightingMins | <code>number</code> | minutes before sundown to light candles (default 18) |
|
|
2652
|
-
| havdalahMins | <code>number</code> | minutes after sundown for Havdalah (typical values are 42, 50, or 72). If `undefined` (the default), calculate Havdalah according to Tzeit Hakochavim - Nightfall (the point when 3 small stars are observable in the night time sky with the naked eye). If `0`, Havdalah times are supressed. |
|
|
2653
|
-
| havdalahDeg | <code>number</code> | degrees for solar depression for Havdalah. Default is 8.5 degrees for 3 small stars. use 7.083 degress for 3 medium-sized stars. If `0`, Havdalah times are supressed. |
|
|
2654
|
-
| sedrot | <code>boolean</code> | calculate parashah hashavua on Saturdays |
|
|
2655
|
-
| il | <code>boolean</code> | Israeli holiday and sedra schedule |
|
|
2656
|
-
| noMinorFast | <code>boolean</code> | suppress minor fasts |
|
|
2657
|
-
| noModern | <code>boolean</code> | suppress modern holidays |
|
|
2658
|
-
| noRoshChodesh | <code>boolean</code> | suppress Rosh Chodesh |
|
|
2659
|
-
| shabbatMevarchim | <code>boolean</code> | add Shabbat Mevarchim |
|
|
2660
|
-
| noSpecialShabbat | <code>boolean</code> | suppress Special Shabbat |
|
|
2661
|
-
| noHolidays | <code>boolean</code> | suppress regular holidays |
|
|
2662
|
-
| dafyomi | <code>boolean</code> | include Daf Yomi |
|
|
2663
|
-
| mishnaYomi | <code>boolean</code> | include Mishna Yomi |
|
|
2664
|
-
| omer | <code>boolean</code> | include Days of the Omer |
|
|
2665
|
-
| molad | <code>boolean</code> | include event announcing the molad |
|
|
2666
|
-
| ashkenazi | <code>boolean</code> | use Ashkenazi transliterations for event titles (default Sephardi transliterations) |
|
|
2667
|
-
| locale | <code>string</code> | translate event titles according to a locale Default value is `en`, also built-in are `he` and `ashkenazi`. Additional locales (such as `ru` or `fr`) are provided by the [@hebcal/locales](https://github.com/hebcal/hebcal-locales) package |
|
|
2668
|
-
| addHebrewDates | <code>boolean</code> | print the Hebrew date for the entire date range |
|
|
2669
|
-
| addHebrewDatesForEvents | <code>boolean</code> | print the Hebrew date for dates with some events |
|
|
2670
|
-
| mask | <code>number</code> | use bitmask from `flags` to filter events |
|
|
2671
|
-
|
|
2672
|
-
<a name="gematriya"></a>
|
|
2673
|
-
|
|
2674
|
-
## gematriya(number) ⇒ <code>string</code>
|
|
2675
|
-
Converts a numerical value to a string of Hebrew letters.
|
|
2676
|
-
|
|
2677
|
-
When specifying years of the Hebrew calendar in the present millennium,
|
|
2678
|
-
we omit the thousands (which is presently 5 [ה]).
|
|
2677
|
+
When specifying years of the Hebrew calendar in the present millennium,
|
|
2678
|
+
we omit the thousands (which is presently 5 [ה]).
|
|
2679
2679
|
|
|
2680
2680
|
**Kind**: global function
|
|
2681
2681
|
|
|
@@ -2733,7 +2733,7 @@ Result of Sedra.lookup
|
|
|
2733
2733
|
<a name="MishnaYomi"></a>
|
|
2734
2734
|
|
|
2735
2735
|
## MishnaYomi : <code>Object</code>
|
|
2736
|
-
|
|
2736
|
+
Describes a mishna to be read
|
|
2737
2737
|
|
|
2738
2738
|
**Kind**: global typedef
|
|
2739
2739
|
**Properties**
|