@hebcal/core 3.38.0 → 3.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -399,7 +399,6 @@ Represents a Hebrew date
399
399
  * [.daysInMonth(month, year)](#HDate.daysInMonth) ⇒ <code>number</code>
400
400
  * [.getMonthName(month, year)](#HDate.getMonthName) ⇒ <code>string</code>
401
401
  * [.monthNum(month)](#HDate.monthNum) ⇒ <code>number</code>
402
- * [.elapsedDays(year)](#HDate.elapsedDays) ⇒ <code>number</code>
403
402
  * [.daysInYear(year)](#HDate.daysInYear) ⇒ <code>number</code>
404
403
  * [.longCheshvan(year)](#HDate.longCheshvan) ⇒ <code>boolean</code>
405
404
  * [.shortKislev(year)](#HDate.shortKislev) ⇒ <code>boolean</code>
@@ -802,18 +801,6 @@ Returns the Hebrew month number (NISAN=1, TISHREI=7)
802
801
  | --- | --- | --- |
803
802
  | month | <code>number</code> \| <code>string</code> | A number, or Hebrew month name string |
804
803
 
805
- <a name="HDate.elapsedDays"></a>
806
-
807
- ### HDate.elapsedDays(year) ⇒ <code>number</code>
808
- Days from sunday prior to start of Hebrew calendar to mean
809
- conjunction of Tishrei in Hebrew YEAR
810
-
811
- **Kind**: static method of [<code>HDate</code>](#HDate)
812
-
813
- | Param | Type | Description |
814
- | --- | --- | --- |
815
- | year | <code>number</code> | Hebrew year |
816
-
817
804
  <a name="HDate.daysInYear"></a>
818
805
 
819
806
  ### HDate.daysInYear(year) ⇒ <code>number</code>
@@ -903,6 +890,7 @@ Represents an Event with a title, date, and flags
903
890
  * [.url()](#Event+url) ⇒ <code>string</code>
904
891
  * [.observedInIsrael()](#Event+observedInIsrael) ⇒ <code>boolean</code>
905
892
  * [.observedInDiaspora()](#Event+observedInDiaspora) ⇒ <code>boolean</code>
893
+ * [.observedIn(il)](#Event+observedIn) ⇒ <code>boolean</code>
906
894
  * ~~[.getAttrs()](#Event+getAttrs) ⇒ <code>Object</code>~~
907
895
  * [.clone()](#Event+clone) ⇒ [<code>Event</code>](#Event)
908
896
 
@@ -1016,6 +1004,26 @@ ev1.observedInDiaspora(); // true
1016
1004
  const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);
1017
1005
  ev2.observedInDiaspora(); // true
1018
1006
  ```
1007
+ <a name="Event+observedIn"></a>
1008
+
1009
+ ### event.observedIn(il) ⇒ <code>boolean</code>
1010
+ Is this event observed in Israel/Diaspora?
1011
+
1012
+ **Kind**: instance method of [<code>Event</code>](#Event)
1013
+
1014
+ | Param | Type |
1015
+ | --- | --- |
1016
+ | il | <code>boolean</code> |
1017
+
1018
+ **Example**
1019
+ ```js
1020
+ const ev1 = new Event(new HDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY);
1021
+ ev1.observedIn(false); // true
1022
+ ev1.observedIn(true); // false
1023
+ const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);
1024
+ ev2.observedIn(false); // true
1025
+ ev2.observedIn(true); // true
1026
+ ```
1019
1027
  <a name="Event+getAttrs"></a>
1020
1028
 
1021
1029
  ### ~~event.getAttrs() ⇒ <code>Object</code>~~
@@ -1823,12 +1831,14 @@ Represents a day 1-49 of counting the Omer from Pesach to Shavuot
1823
1831
 
1824
1832
  * [OmerEvent](#OmerEvent)
1825
1833
  * [new OmerEvent(date, omerDay)](#new_OmerEvent_new)
1834
+ * [.sefira(lang)](#OmerEvent+sefira) ⇒ <code>string</code>
1826
1835
  * [.render([locale])](#OmerEvent+render) ⇒ <code>string</code>
1827
1836
  * [.renderBrief([locale])](#OmerEvent+renderBrief) ⇒ <code>string</code>
1828
1837
  * [.getEmoji()](#OmerEvent+getEmoji) ⇒ <code>string</code>
1829
1838
  * [.getWeeks()](#OmerEvent+getWeeks) ⇒ <code>number</code>
1830
1839
  * [.getDaysWithinWeeks()](#OmerEvent+getDaysWithinWeeks) ⇒ <code>number</code>
1831
1840
  * [.getTodayIs(locale)](#OmerEvent+getTodayIs) ⇒ <code>string</code>
1841
+ * [.url()](#OmerEvent+url) ⇒ <code>string</code>
1832
1842
 
1833
1843
  <a name="new_OmerEvent_new"></a>
1834
1844
 
@@ -1839,6 +1849,15 @@ Represents a day 1-49 of counting the Omer from Pesach to Shavuot
1839
1849
  | date | [<code>HDate</code>](#HDate) |
1840
1850
  | omerDay | <code>number</code> |
1841
1851
 
1852
+ <a name="OmerEvent+sefira"></a>
1853
+
1854
+ ### omerEvent.sefira(lang) ⇒ <code>string</code>
1855
+ **Kind**: instance method of [<code>OmerEvent</code>](#OmerEvent)
1856
+
1857
+ | Param | Type | Default |
1858
+ | --- | --- | --- |
1859
+ | lang | <code>string</code> | <code>&quot;en&quot;</code> |
1860
+
1842
1861
  <a name="OmerEvent+render"></a>
1843
1862
 
1844
1863
  ### omerEvent.render([locale]) ⇒ <code>string</code>
@@ -1855,7 +1874,7 @@ Represents a day 1-49 of counting the Omer from Pesach to Shavuot
1855
1874
  <a name="OmerEvent+renderBrief"></a>
1856
1875
 
1857
1876
  ### omerEvent.renderBrief([locale]) ⇒ <code>string</code>
1858
- Returns translation of "Omer 22" without ordinal numbers.
1877
+ Returns translation of "Omer day 22" without ordinal numbers.
1859
1878
 
1860
1879
  **Kind**: instance method of [<code>OmerEvent</code>](#OmerEvent)
1861
1880
 
@@ -1884,6 +1903,10 @@ Returns translation of "Omer 22" without ordinal numbers.
1884
1903
  | --- | --- |
1885
1904
  | locale | <code>string</code> |
1886
1905
 
1906
+ <a name="OmerEvent+url"></a>
1907
+
1908
+ ### omerEvent.url() ⇒ <code>string</code>
1909
+ **Kind**: instance method of [<code>OmerEvent</code>](#OmerEvent)
1887
1910
  <a name="DafYomi"></a>
1888
1911
 
1889
1912
  ## DafYomi
@@ -2645,29 +2668,29 @@ Holiday flags for Event
2645
2668
 
2646
2669
  | Name | Type | Default | Description |
2647
2670
  | --- | --- | --- | --- |
2648
- | CHAG | <code>number</code> | <code>CHAG$1</code> | Chag, yontiff, yom tov |
2649
- | LIGHT_CANDLES | <code>number</code> | <code>LIGHT_CANDLES$2</code> | Light candles 18 minutes before sundown |
2650
- | YOM_TOV_ENDS | <code>number</code> | <code>YOM_TOV_ENDS$2</code> | End of holiday (end of Yom Tov) |
2651
- | CHUL_ONLY | <code>number</code> | <code>CHUL_ONLY$2</code> | Observed only in the Diaspora (chutz l'aretz) |
2652
- | IL_ONLY | <code>number</code> | <code>IL_ONLY$2</code> | Observed only in Israel |
2653
- | LIGHT_CANDLES_TZEIS | <code>number</code> | <code>LIGHT_CANDLES_TZEIS$2</code> | Light candles in the evening at Tzeit time (3 small stars) |
2654
- | CHANUKAH_CANDLES | <code>number</code> | <code>CHANUKAH_CANDLES$2</code> | Candle-lighting for Chanukah |
2655
- | ROSH_CHODESH | <code>number</code> | <code>ROSH_CHODESH$1</code> | Rosh Chodesh, beginning of a new Hebrew month |
2656
- | MINOR_FAST | <code>number</code> | <code>MINOR_FAST$2</code> | Minor fasts like Tzom Tammuz, Ta'anit Esther, ... |
2657
- | SPECIAL_SHABBAT | <code>number</code> | <code>SPECIAL_SHABBAT$2</code> | Shabbat Shekalim, Zachor, ... |
2658
- | PARSHA_HASHAVUA | <code>number</code> | <code>PARSHA_HASHAVUA$1</code> | Weekly sedrot on Saturdays |
2659
- | DAF_YOMI | <code>number</code> | <code>DAF_YOMI$1</code> | Daily page of Talmud |
2660
- | OMER_COUNT | <code>number</code> | <code>OMER_COUNT$1</code> | Days of the Omer |
2661
- | MODERN_HOLIDAY | <code>number</code> | <code>MODERN_HOLIDAY$2</code> | Yom HaShoah, Yom HaAtzma'ut, ... |
2662
- | MAJOR_FAST | <code>number</code> | <code>MAJOR_FAST$2</code> | Yom Kippur and Tish'a B'Av |
2663
- | SHABBAT_MEVARCHIM | <code>number</code> | <code>SHABBAT_MEVARCHIM$1</code> | On the Saturday before Rosh Chodesh |
2664
- | MOLAD | <code>number</code> | <code>MOLAD</code> | Molad |
2665
- | USER_EVENT | <code>number</code> | <code>USER_EVENT</code> | Yahrzeit or Hebrew Anniversary |
2666
- | HEBREW_DATE | <code>number</code> | <code>HEBREW_DATE</code> | Daily Hebrew date ("11th of Sivan, 5780") |
2667
- | MINOR_HOLIDAY | <code>number</code> | <code>MINOR_HOLIDAY$2</code> | A holiday that's not major, modern, rosh chodesh, or a fast day |
2668
- | EREV | <code>number</code> | <code>EREV$2</code> | Evening before a major or minor holiday |
2669
- | CHOL_HAMOED | <code>number</code> | <code>CHOL_HAMOED$2</code> | Chol haMoed, intermediate days of Pesach or Sukkot |
2670
- | MISHNA_YOMI | <code>number</code> | <code>MISHNA_YOMI</code> | Mishna Yomi |
2671
+ | CHAG | <code>number</code> | <code>1</code> | Chag, yontiff, yom tov |
2672
+ | LIGHT_CANDLES | <code>number</code> | <code>2</code> | Light candles 18 minutes before sundown |
2673
+ | YOM_TOV_ENDS | <code>number</code> | <code>4</code> | End of holiday (end of Yom Tov) |
2674
+ | CHUL_ONLY | <code>number</code> | <code>8</code> | Observed only in the Diaspora (chutz l'aretz) |
2675
+ | IL_ONLY | <code>number</code> | <code>16</code> | Observed only in Israel |
2676
+ | LIGHT_CANDLES_TZEIS | <code>number</code> | <code>32</code> | Light candles in the evening at Tzeit time (3 small stars) |
2677
+ | CHANUKAH_CANDLES | <code>number</code> | <code>64</code> | Candle-lighting for Chanukah |
2678
+ | ROSH_CHODESH | <code>number</code> | <code>128</code> | Rosh Chodesh, beginning of a new Hebrew month |
2679
+ | MINOR_FAST | <code>number</code> | <code>256</code> | Minor fasts like Tzom Tammuz, Ta'anit Esther, ... |
2680
+ | SPECIAL_SHABBAT | <code>number</code> | <code>512</code> | Shabbat Shekalim, Zachor, ... |
2681
+ | PARSHA_HASHAVUA | <code>number</code> | <code>1024</code> | Weekly sedrot on Saturdays |
2682
+ | DAF_YOMI | <code>number</code> | <code>2048</code> | Daily page of Talmud |
2683
+ | OMER_COUNT | <code>number</code> | <code>4096</code> | Days of the Omer |
2684
+ | MODERN_HOLIDAY | <code>number</code> | <code>8192</code> | Yom HaShoah, Yom HaAtzma'ut, ... |
2685
+ | MAJOR_FAST | <code>number</code> | <code>16384</code> | Yom Kippur and Tish'a B'Av |
2686
+ | SHABBAT_MEVARCHIM | <code>number</code> | <code>32768</code> | On the Saturday before Rosh Chodesh |
2687
+ | MOLAD | <code>number</code> | <code>65536</code> | Molad |
2688
+ | USER_EVENT | <code>number</code> | <code>131072</code> | Yahrzeit or Hebrew Anniversary |
2689
+ | HEBREW_DATE | <code>number</code> | <code>262144</code> | Daily Hebrew date ("11th of Sivan, 5780") |
2690
+ | MINOR_HOLIDAY | <code>number</code> | <code>524288</code> | A holiday that's not major, modern, rosh chodesh, or a fast day |
2691
+ | EREV | <code>number</code> | <code>1048576</code> | Evening before a major or minor holiday |
2692
+ | CHOL_HAMOED | <code>number</code> | <code>2097152</code> | Chol haMoed, intermediate days of Pesach or Sukkot |
2693
+ | MISHNA_YOMI | <code>number</code> | <code>4194304</code> | Mishna Yomi |
2671
2694
 
2672
2695
  <a name="parshiot"></a>
2673
2696