@hebcal/core 5.1.0 → 5.2.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
@@ -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
 
package/dist/bundle.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v5.1.0 */
1
+ /*! @hebcal/core v5.2.0 */
2
2
  var hebcal = (function (exports) {
3
3
  'use strict';
4
4
 
@@ -1657,7 +1657,11 @@ function fixDate(date) {
1657
1657
  date.yy += 1;
1658
1658
  }
1659
1659
  date.dd -= daysInMonth(date.mm, date.yy);
1660
- date.mm += 1;
1660
+ if (date.mm === monthsInYear(date.yy)) {
1661
+ date.mm = 1; // rollover to NISAN
1662
+ } else {
1663
+ date.mm += 1;
1664
+ }
1661
1665
  fix(date);
1662
1666
  }
1663
1667
  fixMonth(date);
@@ -6973,7 +6977,21 @@ class Zmanim {
6973
6977
  shkiah() {
6974
6978
  return this.sunset();
6975
6979
  }
6976
-
6980
+ /**
6981
+ * Rabbeinu Tam holds that bein hashmashos is a specific time
6982
+ * between sunset and tzeis hakochavim.
6983
+ * One opinion on how to calculate this time is that
6984
+ * it is 13.5 minutes before tzies 7.083
6985
+ * @return {Date}
6986
+ */
6987
+ beinHaShmashos() {
6988
+ const tzeit = this.tzeit(7.083);
6989
+ const millis = tzeit.getTime();
6990
+ if (isNaN(millis)) {
6991
+ return tzeit;
6992
+ }
6993
+ return new Date(millis - 13.5 * 60 * 1000);
6994
+ }
6977
6995
  /**
6978
6996
  * Uses timeFormat to return a date like '20:34'
6979
6997
  * @param {Date} dt
@@ -7349,7 +7367,9 @@ function makeTimedEvent(hd, time, desc, ev, options) {
7349
7367
  }
7350
7368
 
7351
7369
  /**
7352
- * Makes a candle-lighting event for Chankah (not on Friday/Saturday)
7370
+ * Makes a candle-lighting event for Chankah (not on Friday/Saturday).
7371
+ * At one point this used civil dusk (6 degrees below horizon).
7372
+ * Another source suggests 4.6667 degrees below horizon.
7353
7373
  * @private
7354
7374
  * @param {Event} ev
7355
7375
  * @param {HDate} hd
@@ -7359,8 +7379,7 @@ function makeTimedEvent(hd, time, desc, ev, options) {
7359
7379
  function makeWeekdayChanukahCandleLighting(ev, hd, options) {
7360
7380
  const location = options.location;
7361
7381
  const zmanim = new Zmanim(location, hd.greg(), options.useElevation);
7362
- const candleLightingTime = zmanim.dusk();
7363
- // const candleLightingTime = zmanim.tzeit(4.6667);
7382
+ const candleLightingTime = zmanim.beinHaShmashos();
7364
7383
  return makeTimedEvent(hd, candleLightingTime, ev.getDesc(), ev, options);
7365
7384
  }
7366
7385
 
@@ -8803,10 +8822,10 @@ var store$1 = sharedStore;
8803
8822
  (shared$3.exports = function (key, value) {
8804
8823
  return store$1[key] || (store$1[key] = value !== undefined ? value : {});
8805
8824
  })('versions', []).push({
8806
- version: '3.35.0',
8825
+ version: '3.35.1',
8807
8826
  mode: 'global',
8808
- copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
8809
- license: 'https://github.com/zloirock/core-js/blob/v3.35.0/LICENSE',
8827
+ copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
8828
+ license: 'https://github.com/zloirock/core-js/blob/v3.35.1/LICENSE',
8810
8829
  source: 'https://github.com/zloirock/core-js'
8811
8830
  });
8812
8831
 
@@ -9049,7 +9068,7 @@ var TEMPLATE = String(String).split('String');
9049
9068
 
9050
9069
  var makeBuiltIn$2 = makeBuiltIn$3.exports = function (value, name, options) {
9051
9070
  if (stringSlice$1($String(name), 0, 7) === 'Symbol(') {
9052
- name = '[' + replace($String(name), /^Symbol\(([^)]*)\)/, '$1') + ']';
9071
+ name = '[' + replace($String(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
9053
9072
  }
9054
9073
  if (options && options.getter) name = 'get ' + name;
9055
9074
  if (options && options.setter) name = 'set ' + name;
@@ -10150,7 +10169,7 @@ class DailyLearning {
10150
10169
  }
10151
10170
 
10152
10171
  // DO NOT EDIT THIS AUTO-GENERATED FILE!
10153
- const version = '5.1.0';
10172
+ const version = '5.2.0';
10154
10173
 
10155
10174
  var objectGetOwnPropertyDescriptor = {};
10156
10175
 
@@ -10297,7 +10316,8 @@ var min = Math.min;
10297
10316
  // `ToLength` abstract operation
10298
10317
  // https://tc39.es/ecma262/#sec-tolength
10299
10318
  var toLength$1 = function (argument) {
10300
- return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
10319
+ var len = toIntegerOrInfinity(argument);
10320
+ return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
10301
10321
  };
10302
10322
 
10303
10323
  var toLength = toLength$1;
@@ -10478,7 +10498,7 @@ var _export = function (options, source) {
10478
10498
  } else if (STATIC) {
10479
10499
  target = global$1[TARGET] || defineGlobalProperty(TARGET, {});
10480
10500
  } else {
10481
- target = (global$1[TARGET] || {}).prototype;
10501
+ target = global$1[TARGET] && global$1[TARGET].prototype;
10482
10502
  }
10483
10503
  if (target) for (key in source) {
10484
10504
  sourceProperty = source[key];
@@ -11743,7 +11763,8 @@ class HebrewCalendar {
11743
11763
  *
11744
11764
  * If both `options.candlelighting=true` and `options.location` is specified,
11745
11765
  * Chanukah candle-lighting times and minor fast start/end times will also be generated.
11746
- * Chanukah candle-lighting is at dusk (when the sun is 6. below the horizon in the evening)
11766
+ * Chanukah candle-lighting is at Bein HaShmashos (13.5 minutes before
11767
+ * the sun is 7.083° below the horizon in the evening)
11747
11768
  * on weekdays, at regular candle-lighting time on Fridays, and at regular Havdalah time on
11748
11769
  * Saturday night (see above).
11749
11770
  *