@hebcal/core 3.33.4 → 3.33.5
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 +250 -261
- package/dist/bundle.js +323 -255
- package/dist/bundle.min.js +2 -2
- package/dist/hdate-bundle.js +312 -244
- package/dist/hdate-bundle.min.js +2 -2
- package/dist/hdate.js +76 -61
- package/dist/hdate.mjs +76 -61
- package/dist/index.js +105 -70
- package/dist/index.mjs +87 -72
- package/hebcal.d.ts +116 -115
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -46,6 +46,19 @@ for (const ev of events) {
|
|
|
46
46
|
## Classes
|
|
47
47
|
|
|
48
48
|
<dl>
|
|
49
|
+
<dt><a href="#greg">greg</a></dt>
|
|
50
|
+
<dd><p>Gregorian date helper functions.</p>
|
|
51
|
+
</dd>
|
|
52
|
+
<dt><a href="#Locale">Locale</a></dt>
|
|
53
|
+
<dd><p>A locale in Hebcal is used for translations/transliterations of
|
|
54
|
+
holidays. <code>@hebcal/core</code> supports four locales by default</p>
|
|
55
|
+
<ul>
|
|
56
|
+
<li><code>en</code> - default, Sephardic transliterations (e.g. "Shabbat")</li>
|
|
57
|
+
<li><code>ashkenazi</code> - Ashkenazi transliterations (e.g. "Shabbos")</li>
|
|
58
|
+
<li><code>he</code> - Hebrew (e.g. "שַׁבָּת")</li>
|
|
59
|
+
<li><code>he-x-NoNikud</code> - Hebrew without nikud (e.g. "שבת")</li>
|
|
60
|
+
</ul>
|
|
61
|
+
</dd>
|
|
49
62
|
<dt><a href="#HDate">HDate</a></dt>
|
|
50
63
|
<dd><p>Represents a Hebrew date</p>
|
|
51
64
|
</dd>
|
|
@@ -119,24 +132,6 @@ Event names can be rendered in several languges using the <code>locale</code> op
|
|
|
119
132
|
</dd>
|
|
120
133
|
</dl>
|
|
121
134
|
|
|
122
|
-
## Objects
|
|
123
|
-
|
|
124
|
-
<dl>
|
|
125
|
-
<dt><a href="#greg">greg</a> : <code>object</code></dt>
|
|
126
|
-
<dd><p>Gregorian date helper functions.</p>
|
|
127
|
-
</dd>
|
|
128
|
-
<dt><a href="#Locale">Locale</a> : <code>object</code></dt>
|
|
129
|
-
<dd><p>A locale in Hebcal is used for translations/transliterations of
|
|
130
|
-
holidays. <code>@hebcal/core</code> supports four locales by default</p>
|
|
131
|
-
<ul>
|
|
132
|
-
<li><code>en</code> - default, Sephardic transliterations (e.g. "Shabbat")</li>
|
|
133
|
-
<li><code>ashkenazi</code> - Ashkenazi transliterations (e.g. "Shabbos")</li>
|
|
134
|
-
<li><code>he</code> - Hebrew (e.g. "שַׁבָּת")</li>
|
|
135
|
-
<li><code>he-x-NoNikud</code> - Hebrew without nikud (e.g. "שבת")</li>
|
|
136
|
-
</ul>
|
|
137
|
-
</dd>
|
|
138
|
-
</dl>
|
|
139
|
-
|
|
140
135
|
## Constants
|
|
141
136
|
|
|
142
137
|
<dl>
|
|
@@ -167,8 +162,202 @@ we omit the thousands (which is presently 5 [ה]).</p>
|
|
|
167
162
|
<dt><a href="#MishnaYomi">MishnaYomi</a> : <code>Object</code></dt>
|
|
168
163
|
<dd><p>Describes a mishna to be read</p>
|
|
169
164
|
</dd>
|
|
165
|
+
<dt><a href="#CalOptions">CalOptions</a> : <code>Object</code></dt>
|
|
166
|
+
<dd><p>Options to configure which events are returned</p>
|
|
167
|
+
</dd>
|
|
170
168
|
</dl>
|
|
171
169
|
|
|
170
|
+
<a name="greg"></a>
|
|
171
|
+
|
|
172
|
+
## greg
|
|
173
|
+
Gregorian date helper functions.
|
|
174
|
+
|
|
175
|
+
**Kind**: global class
|
|
176
|
+
|
|
177
|
+
* [greg](#greg)
|
|
178
|
+
* [.isLeapYear(year)](#greg.isLeapYear) ⇒ <code>boolean</code>
|
|
179
|
+
* [.daysInMonth(month, year)](#greg.daysInMonth) ⇒ <code>number</code>
|
|
180
|
+
* [.isDate(obj)](#greg.isDate) ⇒ <code>boolean</code>
|
|
181
|
+
* [.dayOfYear(date)](#greg.dayOfYear) ⇒ <code>number</code>
|
|
182
|
+
* [.greg2abs(date)](#greg.greg2abs) ⇒ <code>number</code>
|
|
183
|
+
* [.abs2greg(theDate)](#greg.abs2greg) ⇒ <code>Date</code>
|
|
184
|
+
|
|
185
|
+
<a name="greg.isLeapYear"></a>
|
|
186
|
+
|
|
187
|
+
### greg.isLeapYear(year) ⇒ <code>boolean</code>
|
|
188
|
+
Returns true if the Gregorian year is a leap year
|
|
189
|
+
|
|
190
|
+
**Kind**: static method of [<code>greg</code>](#greg)
|
|
191
|
+
|
|
192
|
+
| Param | Type | Description |
|
|
193
|
+
| --- | --- | --- |
|
|
194
|
+
| year | <code>number</code> | Gregorian year |
|
|
195
|
+
|
|
196
|
+
<a name="greg.daysInMonth"></a>
|
|
197
|
+
|
|
198
|
+
### greg.daysInMonth(month, year) ⇒ <code>number</code>
|
|
199
|
+
Number of days in the Gregorian month for given year
|
|
200
|
+
|
|
201
|
+
**Kind**: static method of [<code>greg</code>](#greg)
|
|
202
|
+
|
|
203
|
+
| Param | Type | Description |
|
|
204
|
+
| --- | --- | --- |
|
|
205
|
+
| month | <code>number</code> | Gregorian month (1=January, 12=December) |
|
|
206
|
+
| year | <code>number</code> | Gregorian year |
|
|
207
|
+
|
|
208
|
+
<a name="greg.isDate"></a>
|
|
209
|
+
|
|
210
|
+
### greg.isDate(obj) ⇒ <code>boolean</code>
|
|
211
|
+
Returns true if the object is a Javascript Date
|
|
212
|
+
|
|
213
|
+
**Kind**: static method of [<code>greg</code>](#greg)
|
|
214
|
+
|
|
215
|
+
| Param | Type |
|
|
216
|
+
| --- | --- |
|
|
217
|
+
| obj | <code>Object</code> |
|
|
218
|
+
|
|
219
|
+
<a name="greg.dayOfYear"></a>
|
|
220
|
+
|
|
221
|
+
### greg.dayOfYear(date) ⇒ <code>number</code>
|
|
222
|
+
Returns number of days since January 1 of that year
|
|
223
|
+
|
|
224
|
+
**Kind**: static method of [<code>greg</code>](#greg)
|
|
225
|
+
|
|
226
|
+
| Param | Type | Description |
|
|
227
|
+
| --- | --- | --- |
|
|
228
|
+
| date | <code>Date</code> | Gregorian date |
|
|
229
|
+
|
|
230
|
+
<a name="greg.greg2abs"></a>
|
|
231
|
+
|
|
232
|
+
### greg.greg2abs(date) ⇒ <code>number</code>
|
|
233
|
+
Converts Gregorian date to absolute R.D. (Rata Die) days
|
|
234
|
+
|
|
235
|
+
**Kind**: static method of [<code>greg</code>](#greg)
|
|
236
|
+
|
|
237
|
+
| Param | Type | Description |
|
|
238
|
+
| --- | --- | --- |
|
|
239
|
+
| date | <code>Date</code> | Gregorian date |
|
|
240
|
+
|
|
241
|
+
<a name="greg.abs2greg"></a>
|
|
242
|
+
|
|
243
|
+
### greg.abs2greg(theDate) ⇒ <code>Date</code>
|
|
244
|
+
Converts from Rata Die (R.D. number) to Gregorian date.
|
|
245
|
+
See the footnote on page 384 of ``Calendrical Calculations, Part II:
|
|
246
|
+
Three Historical Calendars'' by E. M. Reingold, N. Dershowitz, and S. M.
|
|
247
|
+
Clamen, Software--Practice and Experience, Volume 23, Number 4
|
|
248
|
+
(April, 1993), pages 383-404 for an explanation.
|
|
249
|
+
|
|
250
|
+
**Kind**: static method of [<code>greg</code>](#greg)
|
|
251
|
+
|
|
252
|
+
| Param | Type | Description |
|
|
253
|
+
| --- | --- | --- |
|
|
254
|
+
| theDate | <code>number</code> | R.D. number of days |
|
|
255
|
+
|
|
256
|
+
<a name="Locale"></a>
|
|
257
|
+
|
|
258
|
+
## Locale
|
|
259
|
+
A locale in Hebcal is used for translations/transliterations of
|
|
260
|
+
holidays. `@hebcal/core` supports four locales by default
|
|
261
|
+
* `en` - default, Sephardic transliterations (e.g. "Shabbat")
|
|
262
|
+
* `ashkenazi` - Ashkenazi transliterations (e.g. "Shabbos")
|
|
263
|
+
* `he` - Hebrew (e.g. "שַׁבָּת")
|
|
264
|
+
* `he-x-NoNikud` - Hebrew without nikud (e.g. "שבת")
|
|
265
|
+
|
|
266
|
+
**Kind**: global class
|
|
267
|
+
|
|
268
|
+
* [Locale](#Locale)
|
|
269
|
+
* [.lookupTranslation(id, [locale])](#Locale.lookupTranslation) ⇒ <code>string</code>
|
|
270
|
+
* [.gettext(id, [locale])](#Locale.gettext) ⇒ <code>string</code>
|
|
271
|
+
* [.addLocale(locale, data)](#Locale.addLocale)
|
|
272
|
+
* [.useLocale(locale)](#Locale.useLocale) ⇒ <code>LocaleData</code>
|
|
273
|
+
* [.getLocaleName()](#Locale.getLocaleName) ⇒ <code>string</code>
|
|
274
|
+
* [.getLocaleNames()](#Locale.getLocaleNames) ⇒ <code>Array.<string></code>
|
|
275
|
+
* [.ordinal(n, [locale])](#Locale.ordinal) ⇒ <code>string</code>
|
|
276
|
+
* [.hebrewStripNikkud(str)](#Locale.hebrewStripNikkud) ⇒ <code>string</code>
|
|
277
|
+
|
|
278
|
+
<a name="Locale.lookupTranslation"></a>
|
|
279
|
+
|
|
280
|
+
### Locale.lookupTranslation(id, [locale]) ⇒ <code>string</code>
|
|
281
|
+
Returns translation only if `locale` offers a non-empty translation for `id`.
|
|
282
|
+
Otherwise, returns `undefined`.
|
|
283
|
+
|
|
284
|
+
**Kind**: static method of [<code>Locale</code>](#Locale)
|
|
285
|
+
|
|
286
|
+
| Param | Type | Description |
|
|
287
|
+
| --- | --- | --- |
|
|
288
|
+
| id | <code>string</code> | Message ID to translate |
|
|
289
|
+
| [locale] | <code>string</code> | Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale. |
|
|
290
|
+
|
|
291
|
+
<a name="Locale.gettext"></a>
|
|
292
|
+
|
|
293
|
+
### Locale.gettext(id, [locale]) ⇒ <code>string</code>
|
|
294
|
+
By default, if no translation was found, returns `id`.
|
|
295
|
+
|
|
296
|
+
**Kind**: static method of [<code>Locale</code>](#Locale)
|
|
297
|
+
|
|
298
|
+
| Param | Type | Description |
|
|
299
|
+
| --- | --- | --- |
|
|
300
|
+
| id | <code>string</code> | Message ID to translate |
|
|
301
|
+
| [locale] | <code>string</code> | Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale. |
|
|
302
|
+
|
|
303
|
+
<a name="Locale.addLocale"></a>
|
|
304
|
+
|
|
305
|
+
### Locale.addLocale(locale, data)
|
|
306
|
+
Register locale translations.
|
|
307
|
+
|
|
308
|
+
**Kind**: static method of [<code>Locale</code>](#Locale)
|
|
309
|
+
|
|
310
|
+
| Param | Type | Description |
|
|
311
|
+
| --- | --- | --- |
|
|
312
|
+
| locale | <code>string</code> | Locale name (i.e.: `'he'`, `'fr'`) |
|
|
313
|
+
| data | <code>LocaleDate</code> | parsed data from a `.po` file. |
|
|
314
|
+
|
|
315
|
+
<a name="Locale.useLocale"></a>
|
|
316
|
+
|
|
317
|
+
### Locale.useLocale(locale) ⇒ <code>LocaleData</code>
|
|
318
|
+
Activates a locale. Throws an error if the locale has not been previously added.
|
|
319
|
+
After setting the locale to be used, all strings marked for translations
|
|
320
|
+
will be represented by the corresponding translation in the specified locale.
|
|
321
|
+
|
|
322
|
+
**Kind**: static method of [<code>Locale</code>](#Locale)
|
|
323
|
+
|
|
324
|
+
| Param | Type | Description |
|
|
325
|
+
| --- | --- | --- |
|
|
326
|
+
| locale | <code>string</code> | Locale name (i.e: `'he'`, `'fr'`) |
|
|
327
|
+
|
|
328
|
+
<a name="Locale.getLocaleName"></a>
|
|
329
|
+
|
|
330
|
+
### Locale.getLocaleName() ⇒ <code>string</code>
|
|
331
|
+
Returns the name of the active locale (i.e. 'he', 'ashkenazi', 'fr')
|
|
332
|
+
|
|
333
|
+
**Kind**: static method of [<code>Locale</code>](#Locale)
|
|
334
|
+
<a name="Locale.getLocaleNames"></a>
|
|
335
|
+
|
|
336
|
+
### Locale.getLocaleNames() ⇒ <code>Array.<string></code>
|
|
337
|
+
Returns the names of registered locales
|
|
338
|
+
|
|
339
|
+
**Kind**: static method of [<code>Locale</code>](#Locale)
|
|
340
|
+
<a name="Locale.ordinal"></a>
|
|
341
|
+
|
|
342
|
+
### Locale.ordinal(n, [locale]) ⇒ <code>string</code>
|
|
343
|
+
**Kind**: static method of [<code>Locale</code>](#Locale)
|
|
344
|
+
|
|
345
|
+
| Param | Type | Description |
|
|
346
|
+
| --- | --- | --- |
|
|
347
|
+
| n | <code>number</code> | |
|
|
348
|
+
| [locale] | <code>string</code> | Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale. |
|
|
349
|
+
|
|
350
|
+
<a name="Locale.hebrewStripNikkud"></a>
|
|
351
|
+
|
|
352
|
+
### Locale.hebrewStripNikkud(str) ⇒ <code>string</code>
|
|
353
|
+
Removes nekudot from Hebrew string
|
|
354
|
+
|
|
355
|
+
**Kind**: static method of [<code>Locale</code>](#Locale)
|
|
356
|
+
|
|
357
|
+
| Param | Type |
|
|
358
|
+
| --- | --- |
|
|
359
|
+
| str | <code>string</code> |
|
|
360
|
+
|
|
172
361
|
<a name="HDate"></a>
|
|
173
362
|
|
|
174
363
|
## HDate
|
|
@@ -2107,12 +2296,11 @@ Event names can be rendered in several languges using the `locale` option.
|
|
|
2107
2296
|
* [.reformatTimeStr(timeStr, suffix, options)](#HebrewCalendar.reformatTimeStr) ⇒ <code>string</code>
|
|
2108
2297
|
* [.version()](#HebrewCalendar.version) ⇒ <code>string</code>
|
|
2109
2298
|
* [.getSedra(hyear, il)](#HebrewCalendar.getSedra) ⇒ [<code>Sedra</code>](#Sedra)
|
|
2110
|
-
* [.Options](#HebrewCalendar.Options) : <code>Object</code>
|
|
2111
2299
|
|
|
2112
2300
|
<a name="HebrewCalendar.calendar"></a>
|
|
2113
2301
|
|
|
2114
2302
|
### HebrewCalendar.calendar([options]) ⇒ [<code>Array.<Event></code>](#Event)
|
|
2115
|
-
Calculates holidays and other Hebrew calendar events based on [
|
|
2303
|
+
Calculates holidays and other Hebrew calendar events based on [CalOptions](#CalOptions).
|
|
2116
2304
|
|
|
2117
2305
|
Each holiday is represented by an [Event](#Event) object which includes a date,
|
|
2118
2306
|
a description, flags and optional attributes.
|
|
@@ -2196,7 +2384,7 @@ Additional locales (such as `ru` or `fr`) are supported by the
|
|
|
2196
2384
|
|
|
2197
2385
|
| Param | Type | Default |
|
|
2198
2386
|
| --- | --- | --- |
|
|
2199
|
-
| [options] | [<code>
|
|
2387
|
+
| [options] | [<code>CalOptions</code>](#CalOptions) | <code>{}</code> |
|
|
2200
2388
|
|
|
2201
2389
|
**Example**
|
|
2202
2390
|
```js
|
|
@@ -2335,7 +2523,7 @@ Returns an array of Events on this date (or undefined if no events)
|
|
|
2335
2523
|
|
|
2336
2524
|
### HebrewCalendar.reformatTimeStr(timeStr, suffix, options) ⇒ <code>string</code>
|
|
2337
2525
|
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 `
|
|
2526
|
+
keep as "20:13" for any other locale/country. Uses `CalOptions` to determine
|
|
2339
2527
|
locale.
|
|
2340
2528
|
|
|
2341
2529
|
**Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
|
|
@@ -2344,7 +2532,7 @@ locale.
|
|
|
2344
2532
|
| --- | --- | --- |
|
|
2345
2533
|
| timeStr | <code>string</code> | original time like "20:30" |
|
|
2346
2534
|
| suffix | <code>string</code> | "p" or "pm" or " P.M.". Add leading space if you want it |
|
|
2347
|
-
| options | [<code>
|
|
2535
|
+
| options | [<code>CalOptions</code>](#CalOptions) | |
|
|
2348
2536
|
|
|
2349
2537
|
<a name="HebrewCalendar.version"></a>
|
|
2350
2538
|
|
|
@@ -2363,244 +2551,6 @@ created and cached instance.
|
|
|
2363
2551
|
| hyear | <code>number</code> |
|
|
2364
2552
|
| il | <code>boolean</code> |
|
|
2365
2553
|
|
|
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)
|
|
2528
|
-
|
|
2529
|
-
| Param | Type | Description |
|
|
2530
|
-
| --- | --- | --- |
|
|
2531
|
-
| id | <code>string</code> | Message ID to translate |
|
|
2532
|
-
| [locale] | <code>string</code> | Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale. |
|
|
2533
|
-
|
|
2534
|
-
<a name="Locale.gettext"></a>
|
|
2535
|
-
|
|
2536
|
-
### Locale.gettext(id, [locale]) ⇒ <code>string</code>
|
|
2537
|
-
By default, if no translation was found, returns `id`.
|
|
2538
|
-
|
|
2539
|
-
**Kind**: static method of [<code>Locale</code>](#Locale)
|
|
2540
|
-
|
|
2541
|
-
| Param | Type | Description |
|
|
2542
|
-
| --- | --- | --- |
|
|
2543
|
-
| id | <code>string</code> | Message ID to translate |
|
|
2544
|
-
| [locale] | <code>string</code> | Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale. |
|
|
2545
|
-
|
|
2546
|
-
<a name="Locale.addLocale"></a>
|
|
2547
|
-
|
|
2548
|
-
### Locale.addLocale(locale, data)
|
|
2549
|
-
Register locale translations.
|
|
2550
|
-
|
|
2551
|
-
**Kind**: static method of [<code>Locale</code>](#Locale)
|
|
2552
|
-
|
|
2553
|
-
| Param | Type | Description |
|
|
2554
|
-
| --- | --- | --- |
|
|
2555
|
-
| locale | <code>string</code> | Locale name (i.e.: `'he'`, `'fr'`) |
|
|
2556
|
-
| data | <code>LocaleDate</code> | parsed data from a `.po` file. |
|
|
2557
|
-
|
|
2558
|
-
<a name="Locale.useLocale"></a>
|
|
2559
|
-
|
|
2560
|
-
### Locale.useLocale(locale) ⇒ <code>LocaleData</code>
|
|
2561
|
-
Activates a locale. Throws an error if the locale has not been previously added.
|
|
2562
|
-
After setting the locale to be used, all strings marked for translations
|
|
2563
|
-
will be represented by the corresponding translation in the specified locale.
|
|
2564
|
-
|
|
2565
|
-
**Kind**: static method of [<code>Locale</code>](#Locale)
|
|
2566
|
-
|
|
2567
|
-
| Param | Type | Description |
|
|
2568
|
-
| --- | --- | --- |
|
|
2569
|
-
| locale | <code>string</code> | Locale name (i.e: `'he'`, `'fr'`) |
|
|
2570
|
-
|
|
2571
|
-
<a name="Locale.getLocaleName"></a>
|
|
2572
|
-
|
|
2573
|
-
### Locale.getLocaleName() ⇒ <code>string</code>
|
|
2574
|
-
Returns the name of the active locale (i.e. 'he', 'ashkenazi', 'fr')
|
|
2575
|
-
|
|
2576
|
-
**Kind**: static method of [<code>Locale</code>](#Locale)
|
|
2577
|
-
<a name="Locale.getLocaleNames"></a>
|
|
2578
|
-
|
|
2579
|
-
### Locale.getLocaleNames() ⇒ <code>Array.<string></code>
|
|
2580
|
-
Returns the names of registered locales
|
|
2581
|
-
|
|
2582
|
-
**Kind**: static method of [<code>Locale</code>](#Locale)
|
|
2583
|
-
<a name="Locale.ordinal"></a>
|
|
2584
|
-
|
|
2585
|
-
### Locale.ordinal(n, [locale]) ⇒ <code>string</code>
|
|
2586
|
-
**Kind**: static method of [<code>Locale</code>](#Locale)
|
|
2587
|
-
|
|
2588
|
-
| Param | Type | Description |
|
|
2589
|
-
| --- | --- | --- |
|
|
2590
|
-
| n | <code>number</code> | |
|
|
2591
|
-
| [locale] | <code>string</code> | Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale. |
|
|
2592
|
-
|
|
2593
|
-
<a name="Locale.hebrewStripNikkud"></a>
|
|
2594
|
-
|
|
2595
|
-
### Locale.hebrewStripNikkud(str) ⇒ <code>string</code>
|
|
2596
|
-
Removes nekudot from Hebrew string
|
|
2597
|
-
|
|
2598
|
-
**Kind**: static method of [<code>Locale</code>](#Locale)
|
|
2599
|
-
|
|
2600
|
-
| Param | Type |
|
|
2601
|
-
| --- | --- |
|
|
2602
|
-
| str | <code>string</code> |
|
|
2603
|
-
|
|
2604
2554
|
<a name="months"></a>
|
|
2605
2555
|
|
|
2606
2556
|
## months : <code>enum</code>
|
|
@@ -2742,3 +2692,42 @@ Describes a mishna to be read
|
|
|
2742
2692
|
| --- | --- | --- |
|
|
2743
2693
|
| k | <code>string</code> | tractate name in Sephardic transliteration (e.g. "Berakhot", "Moed Katan") |
|
|
2744
2694
|
| v | <code>string</code> | verse (e.g. "2:1") |
|
|
2695
|
+
|
|
2696
|
+
<a name="CalOptions"></a>
|
|
2697
|
+
|
|
2698
|
+
## CalOptions : <code>Object</code>
|
|
2699
|
+
Options to configure which events are returned
|
|
2700
|
+
|
|
2701
|
+
**Kind**: global typedef
|
|
2702
|
+
**Properties**
|
|
2703
|
+
|
|
2704
|
+
| Name | Type | Description |
|
|
2705
|
+
| --- | --- | --- |
|
|
2706
|
+
| location | [<code>Location</code>](#Location) | latitude/longitude/tzid used for candle-lighting |
|
|
2707
|
+
| year | <code>number</code> | Gregorian or Hebrew year |
|
|
2708
|
+
| isHebrewYear | <code>boolean</code> | to interpret year as Hebrew year |
|
|
2709
|
+
| month | <code>number</code> | Gregorian or Hebrew month (to filter results to a single month) |
|
|
2710
|
+
| numYears | <code>number</code> | generate calendar for multiple years (default 1) |
|
|
2711
|
+
| start | <code>Date</code> \| [<code>HDate</code>](#HDate) \| <code>number</code> | use specific start date (requires end date) |
|
|
2712
|
+
| end | <code>Date</code> \| [<code>HDate</code>](#HDate) \| <code>number</code> | use specific end date (requires start date) |
|
|
2713
|
+
| candlelighting | <code>boolean</code> | calculate candle-lighting and havdalah times |
|
|
2714
|
+
| candleLightingMins | <code>number</code> | minutes before sundown to light candles (default 18) |
|
|
2715
|
+
| 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. |
|
|
2716
|
+
| 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. |
|
|
2717
|
+
| sedrot | <code>boolean</code> | calculate parashah hashavua on Saturdays |
|
|
2718
|
+
| il | <code>boolean</code> | Israeli holiday and sedra schedule |
|
|
2719
|
+
| noMinorFast | <code>boolean</code> | suppress minor fasts |
|
|
2720
|
+
| noModern | <code>boolean</code> | suppress modern holidays |
|
|
2721
|
+
| noRoshChodesh | <code>boolean</code> | suppress Rosh Chodesh |
|
|
2722
|
+
| shabbatMevarchim | <code>boolean</code> | add Shabbat Mevarchim |
|
|
2723
|
+
| noSpecialShabbat | <code>boolean</code> | suppress Special Shabbat |
|
|
2724
|
+
| noHolidays | <code>boolean</code> | suppress regular holidays |
|
|
2725
|
+
| dafyomi | <code>boolean</code> | include Daf Yomi |
|
|
2726
|
+
| mishnaYomi | <code>boolean</code> | include Mishna Yomi |
|
|
2727
|
+
| omer | <code>boolean</code> | include Days of the Omer |
|
|
2728
|
+
| molad | <code>boolean</code> | include event announcing the molad |
|
|
2729
|
+
| ashkenazi | <code>boolean</code> | use Ashkenazi transliterations for event titles (default Sephardi transliterations) |
|
|
2730
|
+
| 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 |
|
|
2731
|
+
| addHebrewDates | <code>boolean</code> | print the Hebrew date for the entire date range |
|
|
2732
|
+
| addHebrewDatesForEvents | <code>boolean</code> | print the Hebrew date for dates with some events |
|
|
2733
|
+
| mask | <code>number</code> | use bitmask from `flags` to filter events |
|