@hebcal/core 3.41.0 → 3.41.3

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/dist/bundle.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v3.41.0 */
1
+ /*! @hebcal/core v3.41.3 */
2
2
  var hebcal = (function (exports) {
3
3
  'use strict';
4
4
 
@@ -513,10 +513,10 @@ var store$2 = sharedStore;
513
513
  (shared$3.exports = function (key, value) {
514
514
  return store$2[key] || (store$2[key] = value !== undefined ? value : {});
515
515
  })('versions', []).push({
516
- version: '3.23.2',
516
+ version: '3.23.3',
517
517
  mode: 'global',
518
518
  copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
519
- license: 'https://github.com/zloirock/core-js/blob/v3.23.2/LICENSE',
519
+ license: 'https://github.com/zloirock/core-js/blob/v3.23.3/LICENSE',
520
520
  source: 'https://github.com/zloirock/core-js'
521
521
  });
522
522
 
@@ -890,7 +890,8 @@ var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
890
890
  if (options && options.getter) name = 'get ' + name;
891
891
  if (options && options.setter) name = 'set ' + name;
892
892
  if (!hasOwn$2(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
893
- defineProperty(value, 'name', { value: name, configurable: true });
893
+ if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true });
894
+ else value.name = name;
894
895
  }
895
896
  if (CONFIGURABLE_LENGTH && options && hasOwn$2(options, 'arity') && value.length !== options.arity) {
896
897
  defineProperty(value, 'length', { value: options.arity });
@@ -927,8 +928,10 @@ var defineBuiltIn$1 = function (O, key, value, options) {
927
928
  if (simple) O[key] = value;
928
929
  else defineGlobalProperty$1(key, value);
929
930
  } else {
930
- if (!options.unsafe) delete O[key];
931
- else if (O[key]) simple = true;
931
+ try {
932
+ if (!options.unsafe) delete O[key];
933
+ else if (O[key]) simple = true;
934
+ } catch (error) { /* empty */ }
932
935
  if (simple) O[key] = value;
933
936
  else definePropertyModule$2.f(O, key, {
934
937
  value: value,
@@ -1432,32 +1435,11 @@ function daysInMonth$1(month, year) {
1432
1435
  function isDate(obj) {
1433
1436
  return _typeof(obj) === 'object' && Date.prototype === obj.__proto__;
1434
1437
  }
1435
- /**
1436
- * Returns number of days since January 1 of that year
1437
- * @private
1438
- * @param {Date} date Gregorian date
1439
- * @return {number}
1440
- */
1441
-
1442
- function dayOfYear(date) {
1443
- if (!isDate(date)) {
1444
- throw new TypeError("Argument not a Date: ".concat(date));
1445
- }
1446
-
1447
- var month = date.getMonth();
1448
- var doy = date.getDate() + 31 * month;
1449
-
1450
- if (month > 1) {
1451
- // FEB
1452
- doy -= Math.floor((4 * (month + 1) + 23) / 10);
1453
-
1454
- if (isLeapYear$1(date.getFullYear())) {
1455
- doy++;
1456
- }
1457
- }
1438
+ /*
1439
+ const ABS_14SEP1752 = 639797;
1440
+ const ABS_2SEP1752 = 639785;
1441
+ */
1458
1442
 
1459
- return doy;
1460
- }
1461
1443
  /**
1462
1444
  * Converts Gregorian date to absolute R.D. (Rata Die) days
1463
1445
  * @private
@@ -1470,12 +1452,14 @@ function greg2abs(date) {
1470
1452
  throw new TypeError("Argument not a Date: ".concat(date));
1471
1453
  }
1472
1454
 
1473
- var year = date.getFullYear() - 1;
1474
- return dayOfYear(date) + // days this year
1475
- 365 * year + ( // + days in prior years
1476
- Math.floor(year / 4) - // + Julian Leap years
1477
- Math.floor(year / 100) + // - century years
1478
- Math.floor(year / 400)); // + Gregorian leap years
1455
+ var abs = toFixed(date.getFullYear(), date.getMonth() + 1, date.getDate());
1456
+ /*
1457
+ if (abs < ABS_14SEP1752 && abs > ABS_2SEP1752) {
1458
+ throw new RangeError(`Invalid Date: ${date}`);
1459
+ }
1460
+ */
1461
+
1462
+ return abs;
1479
1463
  }
1480
1464
  /**
1481
1465
  * @private
@@ -1498,8 +1482,8 @@ function yearFromFixed(abs) {
1498
1482
  /**
1499
1483
  * @private
1500
1484
  * @param {number} year
1501
- * @param {number} month
1502
- * @param {number} day
1485
+ * @param {number} month (1-12)
1486
+ * @param {number} day (1-31)
1503
1487
  * @return {number}
1504
1488
  */
1505
1489
 
@@ -1526,6 +1510,12 @@ function abs2greg(abs) {
1526
1510
  }
1527
1511
 
1528
1512
  abs = Math.trunc(abs);
1513
+ /*
1514
+ if (abs < ABS_14SEP1752 && abs > ABS_2SEP1752) {
1515
+ throw new RangeError(`Invalid Date: ${abs}`);
1516
+ }
1517
+ */
1518
+
1529
1519
  var year = yearFromFixed(abs);
1530
1520
  var priorDays = abs - toFixed(year, 1, 1);
1531
1521
  var correction = abs < toFixed(year, 3, 1) ? 0 : isLeapYear$1(year) ? 1 : 2;
@@ -1591,14 +1581,31 @@ var greg = /*#__PURE__*/function () {
1591
1581
  }
1592
1582
  /**
1593
1583
  * Returns number of days since January 1 of that year
1584
+ * @deprecated
1594
1585
  * @param {Date} date Gregorian date
1595
1586
  * @return {number}
1596
1587
  */
1597
1588
 
1598
1589
  }, {
1599
1590
  key: "dayOfYear",
1600
- value: function dayOfYear$1(date) {
1601
- return dayOfYear(date);
1591
+ value: function dayOfYear(date) {
1592
+ if (!isDate(date)) {
1593
+ throw new TypeError("Argument not a Date: ".concat(date));
1594
+ }
1595
+
1596
+ var month = date.getMonth();
1597
+ var doy = date.getDate() + 31 * month;
1598
+
1599
+ if (month > 1) {
1600
+ // FEB
1601
+ doy -= Math.floor((4 * (month + 1) + 23) / 10);
1602
+
1603
+ if (isLeapYear$1(date.getFullYear())) {
1604
+ doy++;
1605
+ }
1606
+ }
1607
+
1608
+ return doy;
1602
1609
  }
1603
1610
  /**
1604
1611
  * Converts Gregorian date to absolute R.D. (Rata Die) days
@@ -7013,14 +7020,21 @@ var MevarchimChodeshEvent = /*#__PURE__*/function (_Event2) {
7013
7020
  _this.memo = molad.render();
7014
7021
  return _this;
7015
7022
  }
7016
- /**
7017
- * Returns (translated) description of this event
7018
- * @param {string} [locale] Optional locale name (defaults to active locale).
7019
- * @return {string}
7020
- */
7023
+ /** @return {string} */
7021
7024
 
7022
7025
 
7023
7026
  _createClass(MevarchimChodeshEvent, [{
7027
+ key: "basename",
7028
+ value: function basename() {
7029
+ return this.getDesc();
7030
+ }
7031
+ /**
7032
+ * Returns (translated) description of this event
7033
+ * @param {string} [locale] Optional locale name (defaults to active locale).
7034
+ * @return {string}
7035
+ */
7036
+
7037
+ }, {
7024
7038
  key: "render",
7025
7039
  value: function render(locale) {
7026
7040
  return Locale.gettext(mevarchimChodeshStr, locale) + ' ' + Locale.gettext(this.monthName, locale);
@@ -7069,6 +7083,7 @@ var RoshHashanaEvent = /*#__PURE__*/function (_HolidayEvent3) {
7069
7083
 
7070
7084
  return RoshHashanaEvent;
7071
7085
  }(HolidayEvent);
7086
+ var ykk = 'Yom Kippur Katan';
7072
7087
  /** Represents Rosh Hashana, the Jewish New Year */
7073
7088
 
7074
7089
  var YomKippurKatanEvent = /*#__PURE__*/function (_HolidayEvent4) {
@@ -7086,7 +7101,8 @@ var YomKippurKatanEvent = /*#__PURE__*/function (_HolidayEvent4) {
7086
7101
 
7087
7102
  _classCallCheck(this, YomKippurKatanEvent);
7088
7103
 
7089
- _this3 = _super6.call(this, date, 'Yom Kippur Katan', flags.MINOR_FAST);
7104
+ _this3 = _super6.call(this, date, "".concat(ykk, " ").concat(nextMonthName), flags.MINOR_FAST);
7105
+ _this3.nextMonthName = nextMonthName;
7090
7106
  _this3.memo = "Minor Day of Atonement on the day preceeding Rosh Chodesh ".concat(nextMonthName);
7091
7107
  return _this3;
7092
7108
  }
@@ -7094,11 +7110,36 @@ var YomKippurKatanEvent = /*#__PURE__*/function (_HolidayEvent4) {
7094
7110
 
7095
7111
 
7096
7112
  _createClass(YomKippurKatanEvent, [{
7097
- key: "urlDateSuffix",
7098
- value: function urlDateSuffix() {
7099
- var isoDateTime = this.getDate().greg().toISOString();
7100
- var isoDate = isoDateTime.substring(0, isoDateTime.indexOf('T'));
7101
- return isoDate.replace(/-/g, '');
7113
+ key: "basename",
7114
+ value: function basename() {
7115
+ return this.getDesc();
7116
+ }
7117
+ /**
7118
+ * @param {string} [locale] Optional locale name (defaults to active locale).
7119
+ * @return {string}
7120
+ */
7121
+
7122
+ }, {
7123
+ key: "render",
7124
+ value: function render(locale) {
7125
+ return Locale.gettext(ykk, locale) + ' ' + Locale.gettext(this.nextMonthName, locale);
7126
+ }
7127
+ /**
7128
+ * @param {string} [locale] Optional locale name (defaults to active locale).
7129
+ * @return {string}
7130
+ */
7131
+
7132
+ }, {
7133
+ key: "renderBrief",
7134
+ value: function renderBrief(locale) {
7135
+ return Locale.gettext(ykk, locale);
7136
+ }
7137
+ /** @return {string} */
7138
+
7139
+ }, {
7140
+ key: "url",
7141
+ value: function url() {
7142
+ return undefined;
7102
7143
  }
7103
7144
  }]);
7104
7145
 
@@ -7530,16 +7571,17 @@ function getHolidaysForYear_(year) {
7530
7571
  continue;
7531
7572
  }
7532
7573
 
7533
- var ykk = new HDate(29, _month, year);
7534
- var dow = ykk.getDay();
7574
+ var _ykk = new HDate(29, _month, year);
7575
+
7576
+ var dow = _ykk.getDay();
7535
7577
 
7536
7578
  if (dow === FRI$1 || dow === SAT$1) {
7537
- ykk = ykk.onOrBefore(THU);
7579
+ _ykk = _ykk.onOrBefore(THU);
7538
7580
  }
7539
7581
 
7540
7582
  var _nextMonthName = HDate.getMonthName(nextMonth, year);
7541
7583
 
7542
- var ev = new YomKippurKatanEvent(ykk, _nextMonthName);
7584
+ var ev = new YomKippurKatanEvent(_ykk, _nextMonthName);
7543
7585
  add(ev);
7544
7586
  }
7545
7587
 
@@ -7830,7 +7872,7 @@ function getBirthdayOrAnniversary_(hyear, gdate) {
7830
7872
  return new HDate(day, month, hyear);
7831
7873
  }
7832
7874
 
7833
- var version="3.41.0";
7875
+ var version="3.41.3";
7834
7876
 
7835
7877
  var headers$1={"plural-forms":"nplurals=2; plural=(n > 1);",language:"en_CA@ashkenazi"};var contexts$1={"":{Berachot:["Berachos"],Shabbat:["Shabbos"],Taanit:["Taanis"],Yevamot:["Yevamos"],Ketubot:["Kesubos"],"Baba Batra":["Baba Basra"],Makkot:["Makkos"],Shevuot:["Shevuos"],Horayot:["Horayos"],Menachot:["Menachos"],Bechorot:["Bechoros"],Keritot:["Kerisos"],Midot:["Midos"],"Achrei Mot":["Achrei Mos"],Bechukotai:["Bechukosai"],"Beha'alotcha":["Beha'aloscha"],Bereshit:["Bereshis"],Chukat:["Chukas"],"Erev Shavuot":["Erev Shavuos"],"Erev Sukkot":["Erev Sukkos"],"Ki Tavo":["Ki Savo"],"Ki Teitzei":["Ki Seitzei"],"Ki Tisa":["Ki Sisa"],Matot:["Matos"],"Purim Katan":["Purim Koton"],Tazria:["Sazria"],"Shabbat Chazon":["Shabbos Chazon"],"Shabbat HaChodesh":["Shabbos HaChodesh"],"Shabbat HaGadol":["Shabbos HaGadol"],"Shabbat Nachamu":["Shabbos Nachamu"],"Shabbat Parah":["Shabbos Parah"],"Shabbat Shekalim":["Shabbos Shekalim"],"Shabbat Shuva":["Shabbos Shuvah"],"Shabbat Zachor":["Shabbos Zachor"],Shavuot:["Shavuos"],"Shavuot I":["Shavuos I"],"Shavuot II":["Shavuos II"],Shemot:["Shemos"],"Shmini Atzeret":["Shmini Atzeres"],"Simchat Torah":["Simchas Torah"],Sukkot:["Sukkos"],"Sukkot I":["Sukkos I"],"Sukkot II":["Sukkos II"],"Sukkot II (CH''M)":["Sukkos II (CH''M)"],"Sukkot III (CH''M)":["Sukkos III (CH''M)"],"Sukkot IV (CH''M)":["Sukkos IV (CH''M)"],"Sukkot V (CH''M)":["Sukkos V (CH''M)"],"Sukkot VI (CH''M)":["Sukkos VI (CH''M)"],"Sukkot VII (Hoshana Raba)":["Sukkos VII (Hoshana Raba)"],"Ta'anit Bechorot":["Ta'anis Bechoros"],"Ta'anit Esther":["Ta'anis Esther"],Toldot:["Toldos"],Vaetchanan:["Vaeschanan"],Yitro:["Yisro"],"Vezot Haberakhah":["Vezos Haberakhah"],Parashat:["Parshas"],"Leil Selichot":["Leil Selichos"],"Shabbat Mevarchim Chodesh":["Shabbos Mevorchim Chodesh"],"Shabbat Shirah":["Shabbos Shirah"],Tevet:["Teves"],"Asara B'Tevet":["Asara B'Teves"],Berakhot:["Berakhos"],Sheviit:["Sheviis"],Terumot:["Terumos"],Maasrot:["Maasros"],Eduyot:["Eduyos"],Avot:["Avos"],Bekhorot:["Bekhoros"],Middot:["Middos"],Oholot:["Oholos"],Tahorot:["Tahoros"],Mikvaot:["Mikvaos"]}};var poAshkenazi = {headers:headers$1,contexts:contexts$1};
7836
7878