@hebcal/core 5.1.1 → 5.2.1

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
@@ -1925,6 +1925,7 @@ https://gml.noaa.gov/grad/solcalc/calcdetails.html
1925
1925
  * [.tzeit([angle])](#Zmanim+tzeit) ⇒ <code>Date</code>
1926
1926
  * [.neitzHaChama()](#Zmanim+neitzHaChama) ⇒ <code>Date</code>
1927
1927
  * [.shkiah()](#Zmanim+shkiah) ⇒ <code>Date</code>
1928
+ * [.beinHaShmashos()](#Zmanim+beinHaShmashos) ⇒ <code>Date</code>
1928
1929
  * [.sunriseOffset(offset, roundMinute, forceSeaLevel)](#Zmanim+sunriseOffset) ⇒ <code>Date</code>
1929
1930
  * [.sunsetOffset(offset, roundMinute, forceSeaLevel)](#Zmanim+sunsetOffset) ⇒ <code>Date</code>
1930
1931
  * _static_
@@ -2121,6 +2122,15 @@ Alias for sunrise
2121
2122
  ### zmanim.shkiah() ⇒ <code>Date</code>
2122
2123
  Alias for sunset
2123
2124
 
2125
+ **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2126
+ <a name="Zmanim+beinHaShmashos"></a>
2127
+
2128
+ ### zmanim.beinHaShmashos() ⇒ <code>Date</code>
2129
+ Rabbeinu Tam holds that bein hashmashos is a specific time
2130
+ between sunset and tzeis hakochavim.
2131
+ One opinion on how to calculate this time is that
2132
+ it is 13.5 minutes before tzies 7.083
2133
+
2124
2134
  **Kind**: instance method of [<code>Zmanim</code>](#Zmanim)
2125
2135
  <a name="Zmanim+sunriseOffset"></a>
2126
2136
 
@@ -2671,6 +2681,8 @@ Represents a built-in holiday like Pesach, Purim or Tu BiShvat
2671
2681
  * [.urlDateSuffix()](#HolidayEvent+urlDateSuffix) ⇒ <code>string</code>
2672
2682
  * [.getEmoji()](#HolidayEvent+getEmoji) ⇒ <code>string</code>
2673
2683
  * [.getCategories()](#HolidayEvent+getCategories) ⇒ <code>Array.&lt;string&gt;</code>
2684
+ * [.render([locale])](#HolidayEvent+render) ⇒ <code>string</code>
2685
+ * [.renderBrief([locale])](#HolidayEvent+renderBrief) ⇒ <code>string</code>
2674
2686
 
2675
2687
  <a name="HolidayEvent+basename"></a>
2676
2688
 
@@ -2692,6 +2704,30 @@ Represents a built-in holiday like Pesach, Purim or Tu BiShvat
2692
2704
 
2693
2705
  ### holidayEvent.getCategories() ⇒ <code>Array.&lt;string&gt;</code>
2694
2706
  **Kind**: instance method of [<code>HolidayEvent</code>](#HolidayEvent)
2707
+ <a name="HolidayEvent+render"></a>
2708
+
2709
+ ### holidayEvent.render([locale]) ⇒ <code>string</code>
2710
+ Returns (translated) description of this event
2711
+
2712
+ **Kind**: instance method of [<code>HolidayEvent</code>](#HolidayEvent)
2713
+
2714
+ | Param | Type | Description |
2715
+ | --- | --- | --- |
2716
+ | [locale] | <code>string</code> | Optional locale name (defaults to active locale). |
2717
+
2718
+ <a name="HolidayEvent+renderBrief"></a>
2719
+
2720
+ ### holidayEvent.renderBrief([locale]) ⇒ <code>string</code>
2721
+ Returns a brief (translated) description of this event.
2722
+ For most events, this is the same as render(). For some events, it procudes
2723
+ a shorter text (e.g. without a time or added description).
2724
+
2725
+ **Kind**: instance method of [<code>HolidayEvent</code>](#HolidayEvent)
2726
+
2727
+ | Param | Type | Description |
2728
+ | --- | --- | --- |
2729
+ | [locale] | <code>string</code> | Optional locale name (defaults to active locale). |
2730
+
2695
2731
  <a name="RoshChodeshEvent"></a>
2696
2732
 
2697
2733
  ## RoshChodeshEvent
@@ -2754,13 +2790,14 @@ Represents Mevarchim haChodesh, the announcement of the new month
2754
2790
  **Kind**: global class
2755
2791
 
2756
2792
  * [MevarchimChodeshEvent](#MevarchimChodeshEvent)
2757
- * [new MevarchimChodeshEvent(date, monthName)](#new_MevarchimChodeshEvent_new)
2793
+ * [new MevarchimChodeshEvent(date, monthName, [memo])](#new_MevarchimChodeshEvent_new)
2758
2794
  * [.basename()](#MevarchimChodeshEvent+basename) ⇒ <code>string</code>
2759
2795
  * [.render([locale])](#MevarchimChodeshEvent+render) ⇒ <code>string</code>
2796
+ * [.renderBrief([locale])](#MevarchimChodeshEvent+renderBrief) ⇒ <code>string</code>
2760
2797
 
2761
2798
  <a name="new_MevarchimChodeshEvent_new"></a>
2762
2799
 
2763
- ### new MevarchimChodeshEvent(date, monthName)
2800
+ ### new MevarchimChodeshEvent(date, monthName, [memo])
2764
2801
  Constructs Mevarchim haChodesh event
2765
2802
 
2766
2803
 
@@ -2768,6 +2805,7 @@ Constructs Mevarchim haChodesh event
2768
2805
  | --- | --- | --- |
2769
2806
  | date | [<code>HDate</code>](#HDate) | Hebrew date event occurs |
2770
2807
  | monthName | <code>string</code> | Hebrew month name (not translated) |
2808
+ | [memo] | <code>string</code> | |
2771
2809
 
2772
2810
  <a name="MevarchimChodeshEvent+basename"></a>
2773
2811
 
@@ -2784,6 +2822,17 @@ Returns (translated) description of this event
2784
2822
  | --- | --- | --- |
2785
2823
  | [locale] | <code>string</code> | Optional locale name (defaults to active locale). |
2786
2824
 
2825
+ <a name="MevarchimChodeshEvent+renderBrief"></a>
2826
+
2827
+ ### mevarchimChodeshEvent.renderBrief([locale]) ⇒ <code>string</code>
2828
+ Returns (translated) description of this event
2829
+
2830
+ **Kind**: instance method of [<code>MevarchimChodeshEvent</code>](#MevarchimChodeshEvent)
2831
+
2832
+ | Param | Type | Description |
2833
+ | --- | --- | --- |
2834
+ | [locale] | <code>string</code> | Optional locale name (defaults to active locale). |
2835
+
2787
2836
  <a name="DailyLearning"></a>
2788
2837
 
2789
2838
  ## DailyLearning
@@ -2914,7 +2963,8 @@ These defaults can be changed using these options:
2914
2963
 
2915
2964
  If both `options.candlelighting=true` and `options.location` is specified,
2916
2965
  Chanukah candle-lighting times and minor fast start/end times will also be generated.
2917
- Chanukah candle-lighting is at dusk (when the sun is 6. below the horizon in the evening)
2966
+ Chanukah candle-lighting is at Bein HaShmashos (13.5 minutes before
2967
+ the sun is 7.083° below the horizon in the evening)
2918
2968
  on weekdays, at regular candle-lighting time on Fridays, and at regular Havdalah time on
2919
2969
  Saturday night (see above).
2920
2970
 
@@ -3225,6 +3275,7 @@ Holiday flags for Event
3225
3275
  | YOM_KIPPUR_KATAN | <code>number</code> | <code>8388608</code> | Yom Kippur Katan, minor day of atonement on the day preceeding each Rosh Chodesh |
3226
3276
  | YERUSHALMI_YOMI | <code>number</code> | <code>16777216</code> | Daily page of Jerusalem Talmud (Yerushalmi) |
3227
3277
  | NACH_YOMI | <code>number</code> | <code>33554432</code> | Nach Yomi |
3278
+ | DAILY_LEARNING | <code>number</code> | <code>67108864</code> | Daily Learning |
3228
3279
 
3229
3280
  <a name="parshiot"></a>
3230
3281
 
package/dist/bundle.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v5.1.1 */
1
+ /*! @hebcal/core v5.2.1 */
2
2
  var hebcal = (function (exports) {
3
3
  'use strict';
4
4
 
@@ -1755,7 +1755,9 @@ const flags = {
1755
1755
  /** Daily page of Jerusalem Talmud (Yerushalmi) */
1756
1756
  YERUSHALMI_YOMI: 0x1000000,
1757
1757
  /** Nach Yomi */
1758
- NACH_YOMI: 0x2000000
1758
+ NACH_YOMI: 0x2000000,
1759
+ /** Daily Learning */
1760
+ DAILY_LEARNING: 0x4000000
1759
1761
  };
1760
1762
  const flagToCategory = [[flags.MAJOR_FAST, 'holiday', 'major', 'fast'], [flags.CHANUKAH_CANDLES, 'holiday', 'major'], [flags.HEBREW_DATE, 'hebdate'], [flags.MINOR_FAST, 'holiday', 'fast'], [flags.MINOR_HOLIDAY, 'holiday', 'minor'], [flags.MODERN_HOLIDAY, 'holiday', 'modern'], [flags.MOLAD, 'molad'], [flags.OMER_COUNT, 'omer'], [flags.PARSHA_HASHAVUA, 'parashat'],
1761
1763
  // backwards-compat
@@ -6977,7 +6979,21 @@ class Zmanim {
6977
6979
  shkiah() {
6978
6980
  return this.sunset();
6979
6981
  }
6980
-
6982
+ /**
6983
+ * Rabbeinu Tam holds that bein hashmashos is a specific time
6984
+ * between sunset and tzeis hakochavim.
6985
+ * One opinion on how to calculate this time is that
6986
+ * it is 13.5 minutes before tzies 7.083
6987
+ * @return {Date}
6988
+ */
6989
+ beinHaShmashos() {
6990
+ const tzeit = this.tzeit(7.083);
6991
+ const millis = tzeit.getTime();
6992
+ if (isNaN(millis)) {
6993
+ return tzeit;
6994
+ }
6995
+ return new Date(millis - 13.5 * 60 * 1000);
6996
+ }
6981
6997
  /**
6982
6998
  * Uses timeFormat to return a date like '20:34'
6983
6999
  * @param {Date} dt
@@ -7353,7 +7369,9 @@ function makeTimedEvent(hd, time, desc, ev, options) {
7353
7369
  }
7354
7370
 
7355
7371
  /**
7356
- * Makes a candle-lighting event for Chankah (not on Friday/Saturday)
7372
+ * Makes a candle-lighting event for Chankah (not on Friday/Saturday).
7373
+ * At one point this used civil dusk (6 degrees below horizon).
7374
+ * Another source suggests 4.6667 degrees below horizon.
7357
7375
  * @private
7358
7376
  * @param {Event} ev
7359
7377
  * @param {HDate} hd
@@ -7363,8 +7381,7 @@ function makeTimedEvent(hd, time, desc, ev, options) {
7363
7381
  function makeWeekdayChanukahCandleLighting(ev, hd, options) {
7364
7382
  const location = options.location;
7365
7383
  const zmanim = new Zmanim(location, hd.greg(), options.useElevation);
7366
- const candleLightingTime = zmanim.dusk();
7367
- // const candleLightingTime = zmanim.tzeit(4.6667);
7384
+ const candleLightingTime = zmanim.beinHaShmashos();
7368
7385
  return makeTimedEvent(hd, candleLightingTime, ev.getDesc(), ev, options);
7369
7386
  }
7370
7387
 
@@ -10154,7 +10171,7 @@ class DailyLearning {
10154
10171
  }
10155
10172
 
10156
10173
  // DO NOT EDIT THIS AUTO-GENERATED FILE!
10157
- const version = '5.1.1';
10174
+ const version = '5.2.1';
10158
10175
 
10159
10176
  var objectGetOwnPropertyDescriptor = {};
10160
10177
 
@@ -11748,7 +11765,8 @@ class HebrewCalendar {
11748
11765
  *
11749
11766
  * If both `options.candlelighting=true` and `options.location` is specified,
11750
11767
  * Chanukah candle-lighting times and minor fast start/end times will also be generated.
11751
- * Chanukah candle-lighting is at dusk (when the sun is 6. below the horizon in the evening)
11768
+ * Chanukah candle-lighting is at Bein HaShmashos (13.5 minutes before
11769
+ * the sun is 7.083° below the horizon in the evening)
11752
11770
  * on weekdays, at regular candle-lighting time on Fridays, and at regular Havdalah time on
11753
11771
  * Saturday night (see above).
11754
11772
  *