@hebcal/core 3.26.2 → 3.26.6
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 +122 -65
- package/dist/bundle.js +993 -77
- package/dist/bundle.min.js +2 -2
- package/dist/hdate-bundle.js +959 -52
- package/dist/hdate-bundle.min.js +2 -2
- package/dist/hdate.js +35 -31
- package/dist/hdate.mjs +35 -31
- package/dist/index.js +69 -36
- package/dist/index.mjs +69 -36
- package/hebcal.d.ts +66 -35
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -136,6 +136,14 @@ Event names can be rendered in several languges using the <code>locale</code> op
|
|
|
136
136
|
</dd>
|
|
137
137
|
</dl>
|
|
138
138
|
|
|
139
|
+
## Functions
|
|
140
|
+
|
|
141
|
+
<dl>
|
|
142
|
+
<dt><a href="#gematriya">gematriya(number)</a> ⇒ <code>string</code></dt>
|
|
143
|
+
<dd><p>Converts a numerical value to a string of Hebrew letters</p>
|
|
144
|
+
</dd>
|
|
145
|
+
</dl>
|
|
146
|
+
|
|
139
147
|
## Typedefs
|
|
140
148
|
|
|
141
149
|
<dl>
|
|
@@ -166,17 +174,17 @@ Represents a Hebrew date
|
|
|
166
174
|
* [.greg()](#HDate+greg) ⇒ <code>Date</code>
|
|
167
175
|
* [.abs()](#HDate+abs) ⇒ <code>number</code>
|
|
168
176
|
* [.getMonthName()](#HDate+getMonthName) ⇒ <code>string</code>
|
|
169
|
-
* [.render([locale])](#HDate+render) ⇒ <code>string</code>
|
|
177
|
+
* [.render([locale], [showYear])](#HDate+render) ⇒ <code>string</code>
|
|
170
178
|
* [.renderGematriya()](#HDate+renderGematriya) ⇒ <code>string</code>
|
|
171
|
-
* [.before(day)](#HDate+before) ⇒
|
|
172
|
-
* [.onOrBefore(dow)](#HDate+onOrBefore) ⇒
|
|
173
|
-
* [.nearest(dow)](#HDate+nearest) ⇒
|
|
174
|
-
* [.onOrAfter(dow)](#HDate+onOrAfter) ⇒
|
|
175
|
-
* [.after(day)](#HDate+after) ⇒
|
|
176
|
-
* [.next()](#HDate+next) ⇒
|
|
177
|
-
* [.prev()](#HDate+prev) ⇒
|
|
178
|
-
* [.add(number, [units])](#HDate+add) ⇒
|
|
179
|
-
* [.subtract(number, [units])](#HDate+subtract) ⇒
|
|
179
|
+
* [.before(day)](#HDate+before) ⇒ <code>HDate</code>
|
|
180
|
+
* [.onOrBefore(dow)](#HDate+onOrBefore) ⇒ <code>HDate</code>
|
|
181
|
+
* [.nearest(dow)](#HDate+nearest) ⇒ <code>HDate</code>
|
|
182
|
+
* [.onOrAfter(dow)](#HDate+onOrAfter) ⇒ <code>HDate</code>
|
|
183
|
+
* [.after(day)](#HDate+after) ⇒ <code>HDate</code>
|
|
184
|
+
* [.next()](#HDate+next) ⇒ <code>HDate</code>
|
|
185
|
+
* [.prev()](#HDate+prev) ⇒ <code>HDate</code>
|
|
186
|
+
* [.add(number, [units])](#HDate+add) ⇒ <code>HDate</code>
|
|
187
|
+
* [.subtract(number, [units])](#HDate+subtract) ⇒ <code>HDate</code>
|
|
180
188
|
* [.deltaDays(other)](#HDate+deltaDays) ⇒ <code>number</code>
|
|
181
189
|
* [.isSameDate(other)](#HDate+isSameDate) ⇒ <code>boolean</code>
|
|
182
190
|
* [.toString()](#HDate+toString) ⇒ <code>string</code>
|
|
@@ -214,7 +222,7 @@ Create a Hebrew date. There are 3 basic forms for the `HDate()` constructor.
|
|
|
214
222
|
|
|
215
223
|
| Param | Type | Description |
|
|
216
224
|
| --- | --- | --- |
|
|
217
|
-
| [day] | <code>number</code> \| <code>Date</code> \|
|
|
225
|
+
| [day] | <code>number</code> \| <code>Date</code> \| <code>HDate</code> | 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. |
|
|
218
226
|
| [month] | <code>number</code> \| <code>string</code> | Hebrew month of year (1=NISAN, 7=TISHREI) |
|
|
219
227
|
| [year] | <code>number</code> | Hebrew year |
|
|
220
228
|
|
|
@@ -295,15 +303,16 @@ Returns a transliterated Hebrew month name, e.g. `'Elul'` or `'Cheshvan'`.
|
|
|
295
303
|
**Kind**: instance method of [<code>HDate</code>](#HDate)
|
|
296
304
|
<a name="HDate+render"></a>
|
|
297
305
|
|
|
298
|
-
### hDate.render([locale]) ⇒ <code>string</code>
|
|
306
|
+
### hDate.render([locale], [showYear]) ⇒ <code>string</code>
|
|
299
307
|
Renders this Hebrew date as a translated or transliterated string,
|
|
300
308
|
including ordinal e.g. `'15th of Cheshvan, 5769'`.
|
|
301
309
|
|
|
302
310
|
**Kind**: instance method of [<code>HDate</code>](#HDate)
|
|
303
311
|
|
|
304
|
-
| Param | Type | Description |
|
|
305
|
-
| --- | --- | --- |
|
|
306
|
-
| [locale] | <code>string</code> | Optional locale name (defaults to active locale). |
|
|
312
|
+
| Param | Type | Default | Description |
|
|
313
|
+
| --- | --- | --- | --- |
|
|
314
|
+
| [locale] | <code>string</code> | <code>null</code> | Optional locale name (defaults to active locale). |
|
|
315
|
+
| [showYear] | <code>boolean</code> | <code>true</code> | Display year (defaults to true). |
|
|
307
316
|
|
|
308
317
|
**Example**
|
|
309
318
|
```js
|
|
@@ -311,7 +320,7 @@ import {HDate, months} from '@hebcal/core';
|
|
|
311
320
|
|
|
312
321
|
const hd = new HDate(15, months.CHESHVAN, 5769);
|
|
313
322
|
console.log(hd.render()); // '15th of Cheshvan, 5769'
|
|
314
|
-
console.log(hd.render('he')); // '15
|
|
323
|
+
console.log(hd.render('he')); // '15 חֶשְׁוָן, 5769'
|
|
315
324
|
```
|
|
316
325
|
<a name="HDate+renderGematriya"></a>
|
|
317
326
|
|
|
@@ -327,7 +336,7 @@ console.log(ev.renderGematriya()); // 'ט״ו חֶשְׁוָן תשס״ט'
|
|
|
327
336
|
```
|
|
328
337
|
<a name="HDate+before"></a>
|
|
329
338
|
|
|
330
|
-
### hDate.before(day) ⇒
|
|
339
|
+
### hDate.before(day) ⇒ <code>HDate</code>
|
|
331
340
|
Returns an `HDate` representing the a dayNumber before the current date.
|
|
332
341
|
Sunday=0, Saturday=6
|
|
333
342
|
|
|
@@ -343,7 +352,7 @@ new HDate(new Date('Wednesday February 19, 2014')).before(6).greg() // Sat Feb 1
|
|
|
343
352
|
```
|
|
344
353
|
<a name="HDate+onOrBefore"></a>
|
|
345
354
|
|
|
346
|
-
### hDate.onOrBefore(dow) ⇒
|
|
355
|
+
### hDate.onOrBefore(dow) ⇒ <code>HDate</code>
|
|
347
356
|
Returns an `HDate` representing the a dayNumber on or before the current date.
|
|
348
357
|
Sunday=0, Saturday=6
|
|
349
358
|
|
|
@@ -361,7 +370,7 @@ new HDate(new Date('Sunday February 23, 2014')).onOrBefore(6).greg() // Sat Feb
|
|
|
361
370
|
```
|
|
362
371
|
<a name="HDate+nearest"></a>
|
|
363
372
|
|
|
364
|
-
### hDate.nearest(dow) ⇒
|
|
373
|
+
### hDate.nearest(dow) ⇒ <code>HDate</code>
|
|
365
374
|
Returns an `HDate` representing the nearest dayNumber to the current date
|
|
366
375
|
Sunday=0, Saturday=6
|
|
367
376
|
|
|
@@ -378,7 +387,7 @@ new HDate(new Date('Tuesday February 18, 2014')).nearest(6).greg() // Sat Feb 15
|
|
|
378
387
|
```
|
|
379
388
|
<a name="HDate+onOrAfter"></a>
|
|
380
389
|
|
|
381
|
-
### hDate.onOrAfter(dow) ⇒
|
|
390
|
+
### hDate.onOrAfter(dow) ⇒ <code>HDate</code>
|
|
382
391
|
Returns an `HDate` representing the a dayNumber on or after the current date.
|
|
383
392
|
Sunday=0, Saturday=6
|
|
384
393
|
|
|
@@ -396,7 +405,7 @@ new HDate(new Date('Sunday February 23, 2014')).onOrAfter(6).greg() // Sat Mar 0
|
|
|
396
405
|
```
|
|
397
406
|
<a name="HDate+after"></a>
|
|
398
407
|
|
|
399
|
-
### hDate.after(day) ⇒
|
|
408
|
+
### hDate.after(day) ⇒ <code>HDate</code>
|
|
400
409
|
Returns an `HDate` representing the a dayNumber after the current date.
|
|
401
410
|
Sunday=0, Saturday=6
|
|
402
411
|
|
|
@@ -414,19 +423,19 @@ new HDate(new Date('Sunday February 23, 2014')).after(6).greg() // Sat Mar 01 20
|
|
|
414
423
|
```
|
|
415
424
|
<a name="HDate+next"></a>
|
|
416
425
|
|
|
417
|
-
### hDate.next() ⇒
|
|
426
|
+
### hDate.next() ⇒ <code>HDate</code>
|
|
418
427
|
Returns the next Hebrew date
|
|
419
428
|
|
|
420
429
|
**Kind**: instance method of [<code>HDate</code>](#HDate)
|
|
421
430
|
<a name="HDate+prev"></a>
|
|
422
431
|
|
|
423
|
-
### hDate.prev() ⇒
|
|
432
|
+
### hDate.prev() ⇒ <code>HDate</code>
|
|
424
433
|
Returns the previous Hebrew date
|
|
425
434
|
|
|
426
435
|
**Kind**: instance method of [<code>HDate</code>](#HDate)
|
|
427
436
|
<a name="HDate+add"></a>
|
|
428
437
|
|
|
429
|
-
### hDate.add(number, [units]) ⇒
|
|
438
|
+
### hDate.add(number, [units]) ⇒ <code>HDate</code>
|
|
430
439
|
Returns a cloned `HDate` object with a specified amount of time added
|
|
431
440
|
|
|
432
441
|
Units are case insensitive, and support plural and short forms.
|
|
@@ -448,7 +457,7 @@ Note, short forms are case sensitive.
|
|
|
448
457
|
|
|
449
458
|
<a name="HDate+subtract"></a>
|
|
450
459
|
|
|
451
|
-
### hDate.subtract(number, [units]) ⇒
|
|
460
|
+
### hDate.subtract(number, [units]) ⇒ <code>HDate</code>
|
|
452
461
|
Returns a cloned `HDate` object with a specified amount of time subracted
|
|
453
462
|
|
|
454
463
|
Units are case insensitive, and support plural and short forms.
|
|
@@ -491,7 +500,7 @@ The result is zero if the two dates are identical.
|
|
|
491
500
|
|
|
492
501
|
| Param | Type | Description |
|
|
493
502
|
| --- | --- | --- |
|
|
494
|
-
| other |
|
|
503
|
+
| other | <code>HDate</code> | Hebrew date to compare |
|
|
495
504
|
|
|
496
505
|
**Example**
|
|
497
506
|
```js
|
|
@@ -510,7 +519,7 @@ Compares this date to another date, returning `true` if the dates match.
|
|
|
510
519
|
|
|
511
520
|
| Param | Type | Description |
|
|
512
521
|
| --- | --- | --- |
|
|
513
|
-
| other |
|
|
522
|
+
| other | <code>HDate</code> | Hebrew date to compare |
|
|
514
523
|
|
|
515
524
|
<a name="HDate+toString"></a>
|
|
516
525
|
|
|
@@ -680,7 +689,7 @@ Represents an Event with a title, date, and flags
|
|
|
680
689
|
|
|
681
690
|
* [Event](#Event)
|
|
682
691
|
* [new Event(date, desc, [mask], [attrs])](#new_Event_new)
|
|
683
|
-
* [.getDate()](#Event+getDate) ⇒
|
|
692
|
+
* [.getDate()](#Event+getDate) ⇒ <code>HDate</code>
|
|
684
693
|
* [.getDesc()](#Event+getDesc) ⇒ <code>string</code>
|
|
685
694
|
* [.getFlags()](#Event+getFlags) ⇒ <code>number</code>
|
|
686
695
|
* [.render([locale])](#Event+render) ⇒ <code>string</code>
|
|
@@ -701,14 +710,14 @@ Constructs Event
|
|
|
701
710
|
|
|
702
711
|
| Param | Type | Default | Description |
|
|
703
712
|
| --- | --- | --- | --- |
|
|
704
|
-
| date |
|
|
713
|
+
| date | <code>HDate</code> | | Hebrew date event occurs |
|
|
705
714
|
| desc | <code>string</code> | | Description (not translated) |
|
|
706
715
|
| [mask] | <code>number</code> | <code>0</code> | optional bitmask of holiday flags (see [flags](#flags)) |
|
|
707
716
|
| [attrs] | <code>Object</code> | <code>{}</code> | optional additional attributes (e.g. `eventTimeStr`, `cholHaMoedDay`) |
|
|
708
717
|
|
|
709
718
|
<a name="Event+getDate"></a>
|
|
710
719
|
|
|
711
|
-
### event.getDate() ⇒
|
|
720
|
+
### event.getDate() ⇒ <code>HDate</code>
|
|
712
721
|
Hebrew date of this event
|
|
713
722
|
|
|
714
723
|
**Kind**: instance method of [<code>Event</code>](#Event)
|
|
@@ -826,8 +835,9 @@ Daily Hebrew date ("11th of Sivan, 5780")
|
|
|
826
835
|
* [new HebrewDateEvent(date)](#new_HebrewDateEvent_new)
|
|
827
836
|
* _instance_
|
|
828
837
|
* [.render([locale])](#HebrewDateEvent+render) ⇒ <code>string</code>
|
|
838
|
+
* [.renderBrief([locale])](#HebrewDateEvent+renderBrief) ⇒ <code>string</code>
|
|
829
839
|
* _static_
|
|
830
|
-
* [.renderHebrew(day, monthName, fullYear)](#HebrewDateEvent.renderHebrew) ⇒ <code>string</code
|
|
840
|
+
* ~~[.renderHebrew(day, monthName, fullYear)](#HebrewDateEvent.renderHebrew) ⇒ <code>string</code>~~
|
|
831
841
|
|
|
832
842
|
<a name="new_HebrewDateEvent_new"></a>
|
|
833
843
|
|
|
@@ -835,7 +845,7 @@ Daily Hebrew date ("11th of Sivan, 5780")
|
|
|
835
845
|
|
|
836
846
|
| Param | Type |
|
|
837
847
|
| --- | --- |
|
|
838
|
-
| date |
|
|
848
|
+
| date | <code>HDate</code> |
|
|
839
849
|
|
|
840
850
|
<a name="HebrewDateEvent+render"></a>
|
|
841
851
|
|
|
@@ -855,9 +865,29 @@ const ev = new HebrewDateEvent(hd);
|
|
|
855
865
|
console.log(ev.render()); // '15th of Cheshvan, 5769'
|
|
856
866
|
console.log(ev.render('he')); // 'ט״ו חֶשְׁוָן תשס״ט'
|
|
857
867
|
```
|
|
868
|
+
<a name="HebrewDateEvent+renderBrief"></a>
|
|
869
|
+
|
|
870
|
+
### hebrewDateEvent.renderBrief([locale]) ⇒ <code>string</code>
|
|
871
|
+
**Kind**: instance method of [<code>HebrewDateEvent</code>](#HebrewDateEvent)
|
|
872
|
+
|
|
873
|
+
| Param | Type | Description |
|
|
874
|
+
| --- | --- | --- |
|
|
875
|
+
| [locale] | <code>string</code> | Optional locale name (defaults to active locale). |
|
|
876
|
+
|
|
877
|
+
**Example**
|
|
878
|
+
```js
|
|
879
|
+
import {HDate, HebrewDateEvent, months} from '@hebcal/core';
|
|
880
|
+
|
|
881
|
+
const hd = new HDate(15, months.CHESHVAN, 5769);
|
|
882
|
+
const ev = new HebrewDateEvent(hd);
|
|
883
|
+
console.log(ev.renderBrief()); // '15th of Cheshvan'
|
|
884
|
+
console.log(ev.renderBrief('he')); // 'ט״ו חֶשְׁוָן'
|
|
885
|
+
```
|
|
858
886
|
<a name="HebrewDateEvent.renderHebrew"></a>
|
|
859
887
|
|
|
860
|
-
### HebrewDateEvent.renderHebrew(day, monthName, fullYear) ⇒ <code>string</code
|
|
888
|
+
### ~~HebrewDateEvent.renderHebrew(day, monthName, fullYear) ⇒ <code>string</code>~~
|
|
889
|
+
***Deprecated***
|
|
890
|
+
|
|
861
891
|
Helper function to render a Hebrew date
|
|
862
892
|
|
|
863
893
|
**Kind**: static method of [<code>HebrewDateEvent</code>](#HebrewDateEvent)
|
|
@@ -919,7 +949,7 @@ Initialize a Zmanim instance.
|
|
|
919
949
|
|
|
920
950
|
| Param | Type | Description |
|
|
921
951
|
| --- | --- | --- |
|
|
922
|
-
| date | <code>Date</code> \|
|
|
952
|
+
| date | <code>Date</code> \| <code>HDate</code> | Regular or Hebrew Date. If `date` is a regular `Date`, hours, minutes, seconds and milliseconds are ignored. |
|
|
923
953
|
| latitude | <code>number</code> | |
|
|
924
954
|
| longitude | <code>number</code> | |
|
|
925
955
|
|
|
@@ -1211,7 +1241,7 @@ Gets a 24-hour time formatter (e.g. 07:41 or 20:03) for this location
|
|
|
1211
1241
|
|
|
1212
1242
|
| Param | Type |
|
|
1213
1243
|
| --- | --- |
|
|
1214
|
-
| hdate | <code>Date</code> \|
|
|
1244
|
+
| hdate | <code>Date</code> \| <code>HDate</code> |
|
|
1215
1245
|
|
|
1216
1246
|
<a name="Location+tzeit"></a>
|
|
1217
1247
|
|
|
@@ -1222,7 +1252,7 @@ Gets a 24-hour time formatter (e.g. 07:41 or 20:03) for this location
|
|
|
1222
1252
|
|
|
1223
1253
|
| Param | Type |
|
|
1224
1254
|
| --- | --- |
|
|
1225
|
-
| hdate | <code>Date</code> \|
|
|
1255
|
+
| hdate | <code>Date</code> \| <code>HDate</code> |
|
|
1226
1256
|
| [angle] | <code>number</code> |
|
|
1227
1257
|
|
|
1228
1258
|
<a name="Location+toString"></a>
|
|
@@ -1328,7 +1358,7 @@ An event that has an `eventTime` and `eventTimeStr`
|
|
|
1328
1358
|
|
|
1329
1359
|
| Param | Type | Description |
|
|
1330
1360
|
| --- | --- | --- |
|
|
1331
|
-
| date |
|
|
1361
|
+
| date | <code>HDate</code> | |
|
|
1332
1362
|
| desc | <code>string</code> | Description (not translated) |
|
|
1333
1363
|
| mask | <code>number</code> | |
|
|
1334
1364
|
| eventTime | <code>Date</code> | |
|
|
@@ -1374,7 +1404,7 @@ Havdalah after Shabbat or holiday
|
|
|
1374
1404
|
|
|
1375
1405
|
| Param | Type |
|
|
1376
1406
|
| --- | --- |
|
|
1377
|
-
| date |
|
|
1407
|
+
| date | <code>HDate</code> |
|
|
1378
1408
|
| mask | <code>number</code> |
|
|
1379
1409
|
| eventTime | <code>Date</code> |
|
|
1380
1410
|
| location | [<code>Location</code>](#Location) |
|
|
@@ -1422,7 +1452,7 @@ Candle lighting before Shabbat or holiday
|
|
|
1422
1452
|
|
|
1423
1453
|
| Param | Type |
|
|
1424
1454
|
| --- | --- |
|
|
1425
|
-
| date |
|
|
1455
|
+
| date | <code>HDate</code> |
|
|
1426
1456
|
| mask | <code>number</code> |
|
|
1427
1457
|
| eventTime | <code>Date</code> |
|
|
1428
1458
|
| location | [<code>Location</code>](#Location) |
|
|
@@ -1509,7 +1539,7 @@ Represents a Molad announcement on Shabbat Mevarchim
|
|
|
1509
1539
|
|
|
1510
1540
|
| Param | Type | Description |
|
|
1511
1541
|
| --- | --- | --- |
|
|
1512
|
-
| date |
|
|
1542
|
+
| date | <code>HDate</code> | Hebrew date event occurs |
|
|
1513
1543
|
| hyear | <code>number</code> | molad year |
|
|
1514
1544
|
| hmonth | <code>number</code> | molad month |
|
|
1515
1545
|
|
|
@@ -1544,7 +1574,7 @@ Represents a day 1-49 of counting the Omer from Pesach to Shavuot
|
|
|
1544
1574
|
|
|
1545
1575
|
| Param | Type |
|
|
1546
1576
|
| --- | --- |
|
|
1547
|
-
| date |
|
|
1577
|
+
| date | <code>HDate</code> |
|
|
1548
1578
|
| omerDay | <code>number</code> |
|
|
1549
1579
|
|
|
1550
1580
|
<a name="OmerEvent+render"></a>
|
|
@@ -1653,7 +1683,7 @@ Event wrapper around a DafYomi instance
|
|
|
1653
1683
|
|
|
1654
1684
|
| Param | Type |
|
|
1655
1685
|
| --- | --- |
|
|
1656
|
-
| date |
|
|
1686
|
+
| date | <code>HDate</code> |
|
|
1657
1687
|
|
|
1658
1688
|
<a name="DafYomiEvent+render"></a>
|
|
1659
1689
|
|
|
@@ -1695,7 +1725,7 @@ Represents Parashah HaShavua for an entire Hebrew year
|
|
|
1695
1725
|
* [.get(hDate)](#Sedra+get) ⇒ <code>Array.<string></code>
|
|
1696
1726
|
* [.getString(hDate, [locale])](#Sedra+getString) ⇒ <code>string</code>
|
|
1697
1727
|
* [.isParsha(hDate)](#Sedra+isParsha) ⇒ <code>boolean</code>
|
|
1698
|
-
* [.find(parsha)](#Sedra+find) ⇒
|
|
1728
|
+
* [.find(parsha)](#Sedra+find) ⇒ <code>HDate</code>
|
|
1699
1729
|
* [.getFirstSaturday()](#Sedra+getFirstSaturday) ⇒ <code>number</code>
|
|
1700
1730
|
* [.getYear()](#Sedra+getYear) ⇒ <code>number</code>
|
|
1701
1731
|
* [.lookup(hDate)](#Sedra+lookup) ⇒ [<code>SedraResult</code>](#SedraResult)
|
|
@@ -1720,7 +1750,7 @@ Returns the parsha (or parshiyot) read on Hebrew date
|
|
|
1720
1750
|
|
|
1721
1751
|
| Param | Type | Description |
|
|
1722
1752
|
| --- | --- | --- |
|
|
1723
|
-
| hDate |
|
|
1753
|
+
| hDate | <code>HDate</code> \| <code>number</code> | Hebrew date or R.D. days |
|
|
1724
1754
|
|
|
1725
1755
|
<a name="Sedra+getString"></a>
|
|
1726
1756
|
|
|
@@ -1731,7 +1761,7 @@ Looks up parsha for the date, then returns a translated or transliterated string
|
|
|
1731
1761
|
|
|
1732
1762
|
| Param | Type | Description |
|
|
1733
1763
|
| --- | --- | --- |
|
|
1734
|
-
| hDate |
|
|
1764
|
+
| hDate | <code>HDate</code> \| <code>number</code> | Hebrew date or R.D. days |
|
|
1735
1765
|
| [locale] | <code>string</code> | Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale |
|
|
1736
1766
|
|
|
1737
1767
|
<a name="Sedra+isParsha"></a>
|
|
@@ -1744,11 +1774,11 @@ Torah reading or special holiday reading
|
|
|
1744
1774
|
|
|
1745
1775
|
| Param | Type | Description |
|
|
1746
1776
|
| --- | --- | --- |
|
|
1747
|
-
| hDate |
|
|
1777
|
+
| hDate | <code>HDate</code> \| <code>number</code> | Hebrew date or R.D. days |
|
|
1748
1778
|
|
|
1749
1779
|
<a name="Sedra+find"></a>
|
|
1750
1780
|
|
|
1751
|
-
### sedra.find(parsha) ⇒
|
|
1781
|
+
### sedra.find(parsha) ⇒ <code>HDate</code>
|
|
1752
1782
|
Returns the date that a parsha occurs
|
|
1753
1783
|
|
|
1754
1784
|
**Kind**: instance method of [<code>Sedra</code>](#Sedra)
|
|
@@ -1776,7 +1806,7 @@ Returns an object describing the parsha on the first Saturday on or after absdat
|
|
|
1776
1806
|
|
|
1777
1807
|
| Param | Type | Description |
|
|
1778
1808
|
| --- | --- | --- |
|
|
1779
|
-
| hDate |
|
|
1809
|
+
| hDate | <code>HDate</code> \| <code>number</code> | Hebrew date or R.D. days |
|
|
1780
1810
|
|
|
1781
1811
|
<a name="ParshaEvent"></a>
|
|
1782
1812
|
|
|
@@ -1798,7 +1828,7 @@ Represents one of 54 weekly Torah portions, always on a Saturday
|
|
|
1798
1828
|
|
|
1799
1829
|
| Param | Type | Description |
|
|
1800
1830
|
| --- | --- | --- |
|
|
1801
|
-
| date |
|
|
1831
|
+
| date | <code>HDate</code> | |
|
|
1802
1832
|
| parsha | <code>Array.<string></code> | untranslated name of single or double parsha, such as ['Bereshit'] or ['Achrei Mot', 'Kedoshim'] |
|
|
1803
1833
|
| il | <code>boolean</code> | |
|
|
1804
1834
|
|
|
@@ -1845,7 +1875,7 @@ Constructs Holiday event
|
|
|
1845
1875
|
|
|
1846
1876
|
| Param | Type | Default | Description |
|
|
1847
1877
|
| --- | --- | --- | --- |
|
|
1848
|
-
| date |
|
|
1878
|
+
| date | <code>HDate</code> | | Hebrew date event occurs |
|
|
1849
1879
|
| desc | <code>string</code> | | Description (not translated) |
|
|
1850
1880
|
| [mask] | <code>number</code> | <code>0</code> | optional holiday flags |
|
|
1851
1881
|
| [attrs] | <code>Object</code> | <code>{}</code> | |
|
|
@@ -1887,7 +1917,7 @@ Constructs Rosh Chodesh event
|
|
|
1887
1917
|
|
|
1888
1918
|
| Param | Type | Description |
|
|
1889
1919
|
| --- | --- | --- |
|
|
1890
|
-
| date |
|
|
1920
|
+
| date | <code>HDate</code> | Hebrew date event occurs |
|
|
1891
1921
|
| monthName | <code>string</code> | Hebrew month name (not translated) |
|
|
1892
1922
|
|
|
1893
1923
|
<a name="RoshChodeshEvent+render"></a>
|
|
@@ -1929,7 +1959,7 @@ Constructs AsaraBTevetEvent
|
|
|
1929
1959
|
|
|
1930
1960
|
| Param | Type | Default | Description |
|
|
1931
1961
|
| --- | --- | --- | --- |
|
|
1932
|
-
| date |
|
|
1962
|
+
| date | <code>HDate</code> | | Hebrew date event occurs |
|
|
1933
1963
|
| desc | <code>string</code> | | Description (not translated) |
|
|
1934
1964
|
| [mask] | <code>number</code> | <code>0</code> | optional holiday flags |
|
|
1935
1965
|
| [attrs] | <code>Object</code> | <code>{}</code> | |
|
|
@@ -1957,7 +1987,7 @@ Constructs Mevarchim haChodesh event
|
|
|
1957
1987
|
|
|
1958
1988
|
| Param | Type | Description |
|
|
1959
1989
|
| --- | --- | --- |
|
|
1960
|
-
| date |
|
|
1990
|
+
| date | <code>HDate</code> | Hebrew date event occurs |
|
|
1961
1991
|
| monthName | <code>string</code> | Hebrew month name (not translated) |
|
|
1962
1992
|
|
|
1963
1993
|
<a name="MevarchimChodeshEvent+render"></a>
|
|
@@ -1982,6 +2012,7 @@ Gregorian date helper functions.
|
|
|
1982
2012
|
* [.monthNames](#greg.monthNames) : <code>Array.<string></code>
|
|
1983
2013
|
* [.isLeapYear(year)](#greg.isLeapYear) ⇒ <code>boolean</code>
|
|
1984
2014
|
* [.daysInMonth(month, year)](#greg.daysInMonth) ⇒ <code>number</code>
|
|
2015
|
+
* [.isDate(obj)](#greg.isDate) ⇒ <code>boolean</code>
|
|
1985
2016
|
* [.dayOfYear(date)](#greg.dayOfYear) ⇒ <code>number</code>
|
|
1986
2017
|
* [.greg2abs(date)](#greg.greg2abs) ⇒ <code>number</code>
|
|
1987
2018
|
* [.abs2greg(theDate)](#greg.abs2greg) ⇒ <code>Date</code>
|
|
@@ -2016,6 +2047,17 @@ Number of days in the Gregorian month for given year
|
|
|
2016
2047
|
| month | <code>number</code> | Gregorian month (1=January, 12=December) |
|
|
2017
2048
|
| year | <code>number</code> | Gregorian year |
|
|
2018
2049
|
|
|
2050
|
+
<a name="greg.isDate"></a>
|
|
2051
|
+
|
|
2052
|
+
### greg.isDate(obj) ⇒ <code>boolean</code>
|
|
2053
|
+
Returns true if the object is a Javascript Date
|
|
2054
|
+
|
|
2055
|
+
**Kind**: static method of [<code>greg</code>](#greg)
|
|
2056
|
+
|
|
2057
|
+
| Param | Type |
|
|
2058
|
+
| --- | --- |
|
|
2059
|
+
| obj | <code>Object</code> |
|
|
2060
|
+
|
|
2019
2061
|
<a name="greg.dayOfYear"></a>
|
|
2020
2062
|
|
|
2021
2063
|
### greg.dayOfYear(date) ⇒ <code>number</code>
|
|
@@ -2229,8 +2271,8 @@ Event names can be rendered in several languges using the `locale` option.
|
|
|
2229
2271
|
|
|
2230
2272
|
* [HebrewCalendar](#HebrewCalendar)
|
|
2231
2273
|
* [.calendar([options])](#HebrewCalendar.calendar) ⇒ [<code>Array.<Event></code>](#Event)
|
|
2232
|
-
* [.getBirthdayOrAnniversary(hyear, gdate)](#HebrewCalendar.getBirthdayOrAnniversary) ⇒
|
|
2233
|
-
* [.getYahrzeit(hyear, gdate)](#HebrewCalendar.getYahrzeit) ⇒
|
|
2274
|
+
* [.getBirthdayOrAnniversary(hyear, gdate)](#HebrewCalendar.getBirthdayOrAnniversary) ⇒ <code>HDate</code>
|
|
2275
|
+
* [.getYahrzeit(hyear, gdate)](#HebrewCalendar.getYahrzeit) ⇒ <code>HDate</code>
|
|
2234
2276
|
* [.getHolidaysForYear(year)](#HebrewCalendar.getHolidaysForYear) ⇒ <code>Map.<string, Array.<Event>></code>
|
|
2235
2277
|
* [.getHolidaysForYearArray(year, il)](#HebrewCalendar.getHolidaysForYearArray) ⇒ [<code>Array.<Event></code>](#Event)
|
|
2236
2278
|
* [.getHolidaysOnDate(date, [il])](#HebrewCalendar.getHolidaysOnDate) ⇒ [<code>Array.<Event></code>](#Event)
|
|
@@ -2253,7 +2295,7 @@ The date range returned by this function can be controlled by:
|
|
|
2253
2295
|
* `options.numYears` - generate calendar for multiple years (default 1)
|
|
2254
2296
|
* `options.month` - Gregorian or Hebrew month (to filter results to a single month)
|
|
2255
2297
|
|
|
2256
|
-
Alternatively, specify start and end days with `Date` or [HDate](
|
|
2298
|
+
Alternatively, specify start and end days with `Date` or [HDate](HDate) instances:
|
|
2257
2299
|
* `options.start` - use specific start date (requires `end` date)
|
|
2258
2300
|
* `options.end` - use specific end date (requires `start` date)
|
|
2259
2301
|
|
|
@@ -2346,7 +2388,7 @@ for (const ev of events) {
|
|
|
2346
2388
|
```
|
|
2347
2389
|
<a name="HebrewCalendar.getBirthdayOrAnniversary"></a>
|
|
2348
2390
|
|
|
2349
|
-
### HebrewCalendar.getBirthdayOrAnniversary(hyear, gdate) ⇒
|
|
2391
|
+
### HebrewCalendar.getBirthdayOrAnniversary(hyear, gdate) ⇒ <code>HDate</code>
|
|
2350
2392
|
Calculates a birthday or anniversary (non-yahrzeit).
|
|
2351
2393
|
`hyear` must be after original `gdate` of anniversary.
|
|
2352
2394
|
Returns `undefined` when requested year preceeds or is same as original year.
|
|
@@ -2365,12 +2407,12 @@ has his birthday postponed until the first of the following month in
|
|
|
2365
2407
|
years where that day does not occur. [Calendrical Calculations p. 111]
|
|
2366
2408
|
|
|
2367
2409
|
**Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
|
|
2368
|
-
**Returns**:
|
|
2410
|
+
**Returns**: <code>HDate</code> - anniversary occurring in `hyear`
|
|
2369
2411
|
|
|
2370
2412
|
| Param | Type | Description |
|
|
2371
2413
|
| --- | --- | --- |
|
|
2372
2414
|
| hyear | <code>number</code> | Hebrew year |
|
|
2373
|
-
| gdate | <code>Date</code> \|
|
|
2415
|
+
| gdate | <code>Date</code> \| <code>HDate</code> | Gregorian or Hebrew date of event |
|
|
2374
2416
|
|
|
2375
2417
|
**Example**
|
|
2376
2418
|
```js
|
|
@@ -2381,7 +2423,7 @@ console.log(hd.greg().toLocaleDateString('en-US')); // '3/26/2020'
|
|
|
2381
2423
|
```
|
|
2382
2424
|
<a name="HebrewCalendar.getYahrzeit"></a>
|
|
2383
2425
|
|
|
2384
|
-
### HebrewCalendar.getYahrzeit(hyear, gdate) ⇒
|
|
2426
|
+
### HebrewCalendar.getYahrzeit(hyear, gdate) ⇒ <code>HDate</code>
|
|
2385
2427
|
Calculates yahrzeit.
|
|
2386
2428
|
`hyear` must be after original `gdate` of death.
|
|
2387
2429
|
Returns `undefined` when requested year preceeds or is same as original year.
|
|
@@ -2408,12 +2450,12 @@ There are several cases:
|
|
|
2408
2450
|
of the date of death. [Calendrical Calculations p. 113]
|
|
2409
2451
|
|
|
2410
2452
|
**Kind**: static method of [<code>HebrewCalendar</code>](#HebrewCalendar)
|
|
2411
|
-
**Returns**:
|
|
2453
|
+
**Returns**: <code>HDate</code> - anniversary occurring in hyear
|
|
2412
2454
|
|
|
2413
2455
|
| Param | Type | Description |
|
|
2414
2456
|
| --- | --- | --- |
|
|
2415
2457
|
| hyear | <code>number</code> | Hebrew year |
|
|
2416
|
-
| gdate | <code>Date</code> \|
|
|
2458
|
+
| gdate | <code>Date</code> \| <code>HDate</code> | Gregorian or Hebrew date of death |
|
|
2417
2459
|
|
|
2418
2460
|
**Example**
|
|
2419
2461
|
```js
|
|
@@ -2456,7 +2498,7 @@ Returns an array of Events on this date (or undefined if no events)
|
|
|
2456
2498
|
|
|
2457
2499
|
| Param | Type | Description |
|
|
2458
2500
|
| --- | --- | --- |
|
|
2459
|
-
| date |
|
|
2501
|
+
| date | <code>HDate</code> \| <code>Date</code> \| <code>number</code> | Hebrew Date, Gregorian date, or absolute R.D. day number |
|
|
2460
2502
|
| [il] | <code>boolean</code> | use the Israeli schedule for holidays |
|
|
2461
2503
|
|
|
2462
2504
|
<a name="HebrewCalendar.reformatTimeStr"></a>
|
|
@@ -2493,8 +2535,8 @@ Options to configure which events are returned
|
|
|
2493
2535
|
| isHebrewYear | <code>boolean</code> | to interpret year as Hebrew year |
|
|
2494
2536
|
| month | <code>number</code> | Gregorian or Hebrew month (to filter results to a single month) |
|
|
2495
2537
|
| numYears | <code>number</code> | generate calendar for multiple years (default 1) |
|
|
2496
|
-
| start | <code>Date</code> \|
|
|
2497
|
-
| end | <code>Date</code> \|
|
|
2538
|
+
| start | <code>Date</code> \| <code>HDate</code> \| <code>number</code> | use specific start date (requires end date) |
|
|
2539
|
+
| end | <code>Date</code> \| <code>HDate</code> \| <code>number</code> | use specific end date (requires start date) |
|
|
2498
2540
|
| candlelighting | <code>boolean</code> | calculate candle-lighting and havdalah times |
|
|
2499
2541
|
| candleLightingMins | <code>number</code> | minutes before sundown to light candles (default 18) |
|
|
2500
2542
|
| 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. |
|
|
@@ -2516,6 +2558,21 @@ Options to configure which events are returned
|
|
|
2516
2558
|
| addHebrewDatesForEvents | <code>boolean</code> | print the Hebrew date for dates with some events |
|
|
2517
2559
|
| mask | <code>number</code> | use bitmask from `flags` to filter events |
|
|
2518
2560
|
|
|
2561
|
+
<a name="gematriya"></a>
|
|
2562
|
+
|
|
2563
|
+
## gematriya(number) ⇒ <code>string</code>
|
|
2564
|
+
Converts a numerical value to a string of Hebrew letters
|
|
2565
|
+
|
|
2566
|
+
**Kind**: global function
|
|
2567
|
+
|
|
2568
|
+
| Param | Type |
|
|
2569
|
+
| --- | --- |
|
|
2570
|
+
| number | <code>number</code> |
|
|
2571
|
+
|
|
2572
|
+
**Example**
|
|
2573
|
+
```js
|
|
2574
|
+
gematriya(5774) // תשע״ד - cropped to 774
|
|
2575
|
+
```
|
|
2519
2576
|
<a name="ZmanimTimesResult"></a>
|
|
2520
2577
|
|
|
2521
2578
|
## ZmanimTimesResult : <code>Object</code>
|