@hebcal/core 6.15.0 → 6.16.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.
Files changed (60) hide show
  1. package/dist/bundle.js +106 -54
  2. package/dist/bundle.js.map +1 -1
  3. package/dist/bundle.min.js +5 -5
  4. package/dist/bundle.min.js.map +1 -1
  5. package/dist/esm/DailyLearning.js +1 -1
  6. package/dist/esm/HebrewDateEvent.js +1 -1
  7. package/dist/esm/HolidayEvent.d.ts +1 -1
  8. package/dist/esm/HolidayEvent.js +3 -3
  9. package/dist/esm/HolidayEvent.js.map +1 -1
  10. package/dist/esm/KiddushLevanaEvent.js +1 -1
  11. package/dist/esm/MevarchimChodeshEvent.js +1 -1
  12. package/dist/esm/ParshaEvent.js +2 -2
  13. package/dist/esm/ParshaEvent.js.map +1 -1
  14. package/dist/esm/TimedEvent.js +1 -1
  15. package/dist/esm/YomKippurKatanEvent.js +1 -1
  16. package/dist/esm/ashkenazi.po.js +1 -1
  17. package/dist/esm/calendar.js +1 -1
  18. package/dist/esm/candles.js +1 -1
  19. package/dist/esm/cities.json.js +1 -1
  20. package/dist/esm/event.js +1 -1
  21. package/dist/esm/getStartAndEnd.js +1 -1
  22. package/dist/esm/hallel.d.ts +26 -3
  23. package/dist/esm/hallel.js +86 -29
  24. package/dist/esm/hallel.js.map +1 -1
  25. package/dist/esm/he-x-NoNikud.po.js +1 -1
  26. package/dist/esm/he.po.js +1 -1
  27. package/dist/esm/hebcal.d.ts +3 -9
  28. package/dist/esm/hebcal.js +6 -16
  29. package/dist/esm/hebcal.js.map +1 -1
  30. package/dist/esm/holidays.js +1 -1
  31. package/dist/esm/horizon.js +1 -1
  32. package/dist/esm/index.d.ts +1 -0
  33. package/dist/esm/index.js +2 -1
  34. package/dist/esm/index.js.map +1 -1
  35. package/dist/esm/isAssurBemlacha.js +1 -1
  36. package/dist/esm/isAveilut.js +1 -1
  37. package/dist/esm/isFastDay.js +1 -1
  38. package/dist/esm/locale.js +1 -1
  39. package/dist/esm/location.js +1 -1
  40. package/dist/esm/modern.js +1 -1
  41. package/dist/esm/molad.js +1 -1
  42. package/dist/esm/moladBase.js +1 -1
  43. package/dist/esm/moladDate.js +1 -1
  44. package/dist/esm/omer.d.ts +4 -0
  45. package/dist/esm/omer.js +6 -2
  46. package/dist/esm/omer.js.map +1 -1
  47. package/dist/esm/parshaName.js +1 -1
  48. package/dist/esm/parshaYear.js +1 -1
  49. package/dist/esm/pkgVersion.d.ts +1 -1
  50. package/dist/esm/pkgVersion.js +2 -2
  51. package/dist/esm/pkgVersion.js.map +1 -1
  52. package/dist/esm/reformatTimeStr.js +1 -1
  53. package/dist/esm/sedra.js +1 -1
  54. package/dist/esm/sefira.json.js +1 -1
  55. package/dist/esm/staticHolidays.js +1 -1
  56. package/dist/esm/string.js +1 -1
  57. package/dist/esm/tachanun.js +1 -1
  58. package/dist/esm/zenith.js +1 -1
  59. package/dist/esm/zmanim.js +1 -1
  60. package/package.json +1 -1
package/dist/bundle.js CHANGED
@@ -1,9 +1,9 @@
1
- /*! @hebcal/core v6.15.0, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.16.0, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  var hebcal = (function (exports) {
3
3
  'use strict';
4
4
 
5
5
  /** DO NOT EDIT THIS AUTO-GENERATED FILE! */
6
- const version = '6.15.0';
6
+ const version = '6.16.0';
7
7
 
8
8
  /*! @hebcal/hdate v0.23.1, distributed under GPLv2 or later https://www.gnu.org/licenses/gpl-2.0.txt */
9
9
  /**
@@ -11690,7 +11690,7 @@ class HolidayEvent extends Event {
11690
11690
  /**
11691
11691
  * Returns a `https://www.hebcal.com/holidays/...` URL for more detail on
11692
11692
  * this holiday. Israel-only holidays get an `?i=on` query parameter.
11693
- * Returns `undefined` for years outside `[100, 2999]` and for
11693
+ * Returns `undefined` for Gregorian years outside `[1752, 2499]` and for
11694
11694
  * Ta'anit BeHaB, which has no holiday page.
11695
11695
  */
11696
11696
  url() {
@@ -11698,7 +11698,7 @@ class HolidayEvent extends Event {
11698
11698
  return undefined;
11699
11699
  }
11700
11700
  const year = this.greg().getFullYear();
11701
- if (year < 100 || year > 2999) {
11701
+ if (year < 1752 || year > 2499) {
11702
11702
  return undefined;
11703
11703
  }
11704
11704
  const url = `https://www.hebcal.com/holidays/${urlFriendly(this.basename())}-${this.urlDateSuffix()}`;
@@ -14097,9 +14097,13 @@ class OmerEvent extends Event {
14097
14097
  }
14098
14098
  return str;
14099
14099
  }
14100
+ /**
14101
+ * Returns a `https://www.hebcal.com/omer/...` URL, or `undefined` for Hebrew
14102
+ * years outside `[5513, 6260]` (roughly Gregorian 1752–2499).
14103
+ */
14100
14104
  url() {
14101
14105
  const year = this.getDate().getFullYear();
14102
- if (year < 5000 || year > 6759) {
14106
+ if (year < 5513 || year > 6260) {
14103
14107
  return undefined;
14104
14108
  }
14105
14109
  return `https://www.hebcal.com/omer/${year}/${this.omer}`;
@@ -14275,6 +14279,97 @@ function tachanunYear(year, il) {
14275
14279
  };
14276
14280
  }
14277
14281
 
14282
+ const NONE = 0;
14283
+ const HALF = 1;
14284
+ const WHOLE = 2;
14285
+ /**
14286
+ * Determines which form of Hallel (if any) is recited
14287
+ * on a given Hebrew date.
14288
+ *
14289
+ * Returns 0 (none), 1 (half Hallel), or 2 (whole Hallel).
14290
+ *
14291
+ * Whole Hallel is said on Chanukah, the first Yom Tov of Pesach, Shavuot, Sukkot,
14292
+ * Shmini Atzeret, Simchat Torah, Yom Ha'atzmaut, and Yom Yerushalayim.
14293
+ *
14294
+ * Half Hallel is said on Rosh Chodesh (not Rosh Hashanah), and the last 6 days of Pesach.
14295
+ * Rosh Chodesh Tevet falls during Chanukah, so whole Hallel is said then.
14296
+ *
14297
+ * The result is computed directly from the Hebrew month and day,
14298
+ * without generating holiday events.
14299
+ * @example
14300
+ * import {hallel, HDate, months} from '@hebcal/core';
14301
+ * hallel(new HDate(25, months.KISLEV, 5784), false); // 2 (Chanukah)
14302
+ * hallel(new HDate(1, months.SHVAT, 5784), false); // 1 (Rosh Chodesh)
14303
+ * hallel(new HDate(2, months.SHVAT, 5784), false); // 0
14304
+ * hallel(new HDate(16, months.NISAN, 5784), false); // 2 (Pesach II, Diaspora)
14305
+ * hallel(new HDate(16, months.NISAN, 5784), true); // 1 (Chol HaMoed, Israel)
14306
+ * @param hdate Hebrew date to test
14307
+ * @param il use the Israeli holiday schedule
14308
+ * @returns 0 for no Hallel, 1 for half Hallel, 2 for whole Hallel
14309
+ */
14310
+ function hallel(hdate, il) {
14311
+ const mm = hdate.getMonth();
14312
+ const dd = hdate.getDate();
14313
+ switch (mm) {
14314
+ case months.TISHREI:
14315
+ // Sukkot (15-21), Shmini Atzeret (22), Simchat Torah (23, Diaspora)
14316
+ if (dd >= 15 && dd <= (il ? 22 : 23)) {
14317
+ return WHOLE;
14318
+ }
14319
+ break;
14320
+ case months.KISLEV:
14321
+ // Chanukah begins 25 Kislev; the first candle on the evening of
14322
+ // 24 Kislev precedes the first morning of Chanukah
14323
+ if (dd >= 25) {
14324
+ return WHOLE;
14325
+ }
14326
+ break;
14327
+ case months.TEVET: {
14328
+ // Chanukah lasts 8 days, ending on 2 Tevet (3 Tevet if Kislev is short)
14329
+ const lastDay = HDate.shortKislev(hdate.getFullYear()) ? 3 : 2;
14330
+ if (dd <= lastDay) {
14331
+ return WHOLE;
14332
+ }
14333
+ break;
14334
+ }
14335
+ case months.NISAN:
14336
+ // First day(s) of Pesach
14337
+ if (dd === 15 || (dd === 16 && !il)) {
14338
+ return WHOLE;
14339
+ }
14340
+ // Remaining days of Pesach
14341
+ if (dd >= 16 && dd <= (il ? 21 : 22)) {
14342
+ return HALF;
14343
+ }
14344
+ break;
14345
+ case months.IYYAR: {
14346
+ const year = hdate.getFullYear();
14347
+ // Yom Yerushalayim
14348
+ if (dd === 28 && year >= 5727) {
14349
+ return WHOLE;
14350
+ }
14351
+ // Yom Ha'atzmaut, the day after Yom HaZikaron
14352
+ const yomHaZikaron = dateYomHaZikaron(year);
14353
+ if (yomHaZikaron !== null && dd === yomHaZikaron.getDate() + 1) {
14354
+ return WHOLE;
14355
+ }
14356
+ break;
14357
+ }
14358
+ case months.SIVAN:
14359
+ // Shavuot
14360
+ if (dd === 6 || (dd === 7 && !il)) {
14361
+ return WHOLE;
14362
+ }
14363
+ break;
14364
+ }
14365
+ // Rosh Chodesh: the 30th of any month, or the 1st of any month
14366
+ // other than Tishrei (Rosh Hashana)
14367
+ if (dd === 30 || (dd === 1 && mm !== months.TISHREI)) {
14368
+ return HALF;
14369
+ }
14370
+ return NONE;
14371
+ }
14372
+
14278
14373
  /** @internal */
14279
14374
  function renderParshaName(parsha, locale) {
14280
14375
  let name = Locale.gettext(parsha[0], locale);
@@ -14332,7 +14427,7 @@ class ParshaEvent extends Event {
14332
14427
  }
14333
14428
  url() {
14334
14429
  const year = this.greg().getFullYear();
14335
- if (year < 100 || year > 2999) {
14430
+ if (year < 1752 || year > 2499) {
14336
14431
  return undefined;
14337
14432
  }
14338
14433
  const dt = this.urlDateSuffix();
@@ -15388,40 +15483,6 @@ function makeBiurChametzEvent(hd, options) {
15388
15483
  return biurChametzEv;
15389
15484
  }
15390
15485
 
15391
- const NONE = 0;
15392
- const HALF = 1;
15393
- const WHOLE = 2;
15394
- /** @internal */
15395
- function hallel_(events, hdate) {
15396
- const abs = hdate.abs();
15397
- for (const ev of events) {
15398
- const hd = ev.getDate();
15399
- if (hd.abs() !== abs) {
15400
- continue;
15401
- }
15402
- const desc = ev.getDesc();
15403
- const month = hd.getMonth();
15404
- const mday = hd.getDate();
15405
- if (desc.startsWith('Chanukah') ||
15406
- desc.startsWith('Shavuot') ||
15407
- desc.startsWith('Sukkot') ||
15408
- (month === months.NISAN &&
15409
- (mday === 15 || mday === 16) &&
15410
- ev.hasFlag('CHAG')) || // Pesach
15411
- desc === holidayDesc.YOM_HAATZMA_UT ||
15412
- desc === holidayDesc.YOM_YERUSHALAYIM) {
15413
- return WHOLE;
15414
- }
15415
- if (ev.hasFlag('ROSH_CHODESH') ||
15416
- (desc.startsWith('Pesach') &&
15417
- desc !== holidayDesc.PESACH_I &&
15418
- desc !== holidayDesc.PESACH_II)) {
15419
- return HALF;
15420
- }
15421
- }
15422
- return NONE;
15423
- }
15424
-
15425
15486
  /*
15426
15487
  Hebcal - A Jewish Calendar Generator
15427
15488
  Copyright (c) 1994-2020 Danny Sadinoff
@@ -15682,15 +15743,9 @@ class HebrewCalendar {
15682
15743
  return getSedra(hyear, il);
15683
15744
  }
15684
15745
  /**
15685
- * Determines which form of Hallel (if any) is recited
15686
- * on a given Hebrew date.
15687
- *
15688
- * Returns 0 (none), 1 (half Hallel), or 2 (whole Hallel).
15689
- *
15690
- * Whole Hallel is said on Chanukah, the first Yom Tov of Pesach, Shavuot, Sukkot,
15691
- * Yom Ha'atzmaut, and Yom Yerushalayim.
15692
- *
15693
- * Half Hallel is said on Rosh Chodesh (not Rosh Hashanah), and the last 6 days of Pesach.
15746
+ * Determines which form of Hallel (if any) is recited on a given Hebrew date:
15747
+ * 0 (none), 1 (half Hallel), or 2 (whole Hallel).
15748
+ * See {@link hallel} for details.
15694
15749
  * @example
15695
15750
  * import {HebrewCalendar, HDate, months} from '@hebcal/core';
15696
15751
  * HebrewCalendar.hallel(new HDate(25, months.KISLEV, 5784), false); // 2 (Chanukah)
@@ -15701,11 +15756,7 @@ class HebrewCalendar {
15701
15756
  * @returns 0 for no Hallel, 1 for half Hallel, 2 for whole Hallel
15702
15757
  */
15703
15758
  static hallel(hdate, il) {
15704
- const events = getHolidaysOnDate(hdate, il);
15705
- if (!events) {
15706
- return 0;
15707
- }
15708
- return hallel_(events, hdate);
15759
+ return hallel(hdate, il);
15709
15760
  }
15710
15761
  /**
15711
15762
  * Return details on what Tachanun (or Tzidchatcha on Shabbat) is said on `hdate`.
@@ -15784,6 +15835,7 @@ exports.getHolidaysOnDate = getHolidaysOnDate;
15784
15835
  exports.getMoladAsDate = getMoladAsDate;
15785
15836
  exports.getSedra = getSedra;
15786
15837
  exports.greg = greg;
15838
+ exports.hallel = hallel;
15787
15839
  exports.holidayDesc = holidayDesc;
15788
15840
  exports.isAssurBemlacha = isAssurBemlacha;
15789
15841
  exports.isAveilut = isAveilut;