@hebcal/core 6.4.0 → 6.5.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 (70) hide show
  1. package/README.md +33 -0
  2. package/dist/bundle.js +126 -64
  3. package/dist/bundle.js.map +1 -1
  4. package/dist/bundle.min.js +5 -5
  5. package/dist/bundle.min.js.map +1 -1
  6. package/dist/esm/DailyLearning.js +1 -1
  7. package/dist/esm/HebrewDateEvent.js +1 -1
  8. package/dist/esm/HolidayEvent.js +1 -1
  9. package/dist/esm/MevarchimChodeshEvent.js +1 -1
  10. package/dist/esm/ParshaEvent.d.ts +6 -1
  11. package/dist/esm/ParshaEvent.js +7 -2
  12. package/dist/esm/ParshaEvent.js.map +1 -1
  13. package/dist/esm/TimedEvent.js +1 -1
  14. package/dist/esm/YomKippurKatanEvent.js +1 -1
  15. package/dist/esm/ashkenazi.po.js +1 -1
  16. package/dist/esm/calendar.js +1 -1
  17. package/dist/esm/candles.js +1 -1
  18. package/dist/esm/event.js +2 -2
  19. package/dist/esm/event.js.map +1 -1
  20. package/dist/esm/getStartAndEnd.js +1 -1
  21. package/dist/esm/hallel.js +1 -1
  22. package/dist/esm/he-x-NoNikud.po.js +1 -1
  23. package/dist/esm/he.po.js +1 -1
  24. package/dist/esm/hebcal.js +1 -1
  25. package/dist/esm/holidays.js +1 -1
  26. package/dist/esm/index.d.ts +2 -0
  27. package/dist/esm/index.js +3 -1
  28. package/dist/esm/index.js.map +1 -1
  29. package/dist/esm/isAssurBemlacha.js +1 -1
  30. package/dist/esm/isAveilut.d.ts +11 -0
  31. package/dist/esm/isAveilut.js +42 -0
  32. package/dist/esm/isAveilut.js.map +1 -0
  33. package/dist/esm/isFastDay.d.ts +9 -0
  34. package/dist/esm/isFastDay.js +24 -0
  35. package/dist/esm/isFastDay.js.map +1 -0
  36. package/dist/esm/locale.js +1 -1
  37. package/dist/esm/location.d.ts +0 -1
  38. package/dist/esm/location.js +1 -2
  39. package/dist/esm/location.js.map +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.js +1 -1
  45. package/dist/esm/parshaName.js +1 -1
  46. package/dist/esm/parshaYear.js +1 -1
  47. package/dist/esm/pkgVersion.d.ts +1 -1
  48. package/dist/esm/pkgVersion.js +2 -2
  49. package/dist/esm/pkgVersion.js.map +1 -1
  50. package/dist/esm/reformatTimeStr.js +1 -1
  51. package/dist/esm/sedra.js +1 -1
  52. package/dist/esm/sefira.json.js +1 -1
  53. package/dist/esm/staticHolidays.js +1 -1
  54. package/dist/esm/tachanun.js +1 -1
  55. package/dist/esm/temporal-shim.js +1 -1
  56. package/dist/esm/zmanim.js +1 -1
  57. package/dist/src/ParshaEvent.d.ts +6 -1
  58. package/dist/src/ParshaEvent.js +6 -1
  59. package/dist/src/event.js +1 -1
  60. package/dist/src/index.d.ts +2 -0
  61. package/dist/src/index.js +2 -0
  62. package/dist/src/isAveilut.d.ts +11 -0
  63. package/dist/src/isAveilut.js +37 -0
  64. package/dist/src/isFastDay.d.ts +9 -0
  65. package/dist/src/isFastDay.js +19 -0
  66. package/dist/src/location.d.ts +0 -1
  67. package/dist/src/location.js +0 -1
  68. package/dist/src/pkgVersion.d.ts +1 -1
  69. package/dist/src/pkgVersion.js +1 -1
  70. package/package.json +4 -4
package/README.md CHANGED
@@ -42,6 +42,39 @@ for (const ev of events) {
42
42
  }
43
43
  ```
44
44
 
45
+ ## Displaying the current Shabbat
46
+
47
+ `ParshaEvent` is designed for regular weekly parsha readings. On Shabbatot
48
+ with holiday readings, such as Shabbat Chol HaMoed, use holiday events or the
49
+ `@hebcal/leyning` package instead.
50
+
51
+ For a lightweight holiday title from `@hebcal/core`:
52
+
53
+ ```javascript
54
+ import {HDate, getHolidaysOnDate, getSedra, ParshaEvent} from '@hebcal/core';
55
+
56
+ const hdate = new HDate(new Date(2025, 9, 11));
57
+ const sedra = getSedra(hdate.getFullYear(), true).lookup(hdate);
58
+ const event = sedra.chag
59
+ ? getHolidaysOnDate(hdate, true)[0]
60
+ : new ParshaEvent(sedra);
61
+
62
+ console.log(event.render('he'));
63
+ ```
64
+
65
+ For full Torah reading metadata and Shabbat/holiday leyning titles:
66
+
67
+ ```javascript
68
+ import {HDate} from '@hebcal/hdate';
69
+ import {getLeyningOnDate} from '@hebcal/leyning';
70
+
71
+ const hdate = new HDate(new Date(2025, 9, 11));
72
+ const reading = getLeyningOnDate(hdate, true, false, 'he');
73
+
74
+ console.log(reading.name.he);
75
+ console.log(reading.summary);
76
+ ```
77
+
45
78
  ## Usage
46
79
 
47
80
  This package exports two categories of output:
package/dist/bundle.js CHANGED
@@ -1,9 +1,9 @@
1
- /*! @hebcal/core v6.4.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.5.0, distributed under GPLv2 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.4.0';
6
+ const version = '6.5.0';
7
7
 
8
8
  /*! @hebcal/hdate v0.22.2, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
9
9
  /** @private */
@@ -175,11 +175,11 @@ function hebrewStripNikkud(str) {
175
175
  /*
176
176
  * More minimal HDate
177
177
  */
178
- const NISAN$4 = 1;
178
+ const NISAN$5 = 1;
179
179
  const IYYAR$1 = 2;
180
- const SIVAN$1 = 3;
181
- const TAMUZ$1 = 4;
182
- const AV$1 = 5;
180
+ const SIVAN$2 = 3;
181
+ const TAMUZ$2 = 4;
182
+ const AV$2 = 5;
183
183
  const ELUL$1 = 6;
184
184
  const TISHREI$2 = 7;
185
185
  const CHESHVAN$1 = 8;
@@ -195,15 +195,15 @@ const ADAR_II$2 = 13;
195
195
  */
196
196
  const months = {
197
197
  /** Nissan / ניסן */
198
- NISAN: NISAN$4,
198
+ NISAN: NISAN$5,
199
199
  /** Iyyar / אייר */
200
200
  IYYAR: IYYAR$1,
201
201
  /** Sivan / סיון */
202
- SIVAN: SIVAN$1,
202
+ SIVAN: SIVAN$2,
203
203
  /** Tamuz (sometimes Tammuz) / תמוז */
204
- TAMUZ: TAMUZ$1,
204
+ TAMUZ: TAMUZ$2,
205
205
  /** Av / אב */
206
- AV: AV$1,
206
+ AV: AV$2,
207
207
  /** Elul / אלול */
208
208
  ELUL: ELUL$1,
209
209
  /** Tishrei / תִּשְׁרֵי */
@@ -280,7 +280,7 @@ function hebrew2abs(year, month, day) {
280
280
  for (let m = TISHREI$2; m <= endMonth; m++) {
281
281
  tempabs += daysInMonth(m, year);
282
282
  }
283
- for (let m = NISAN$4; m < month; m++) {
283
+ for (let m = NISAN$5; m < month; m++) {
284
284
  tempabs += daysInMonth(m, year);
285
285
  }
286
286
  }
@@ -482,7 +482,7 @@ function monthFromName(monthName) {
482
482
  if (c[1] === 'o') {
483
483
  break; /* this catches "november" */
484
484
  }
485
- return NISAN$4;
485
+ return NISAN$5;
486
486
  case 'i':
487
487
  return IYYAR$1;
488
488
  case 'e':
@@ -496,7 +496,7 @@ function monthFromName(monthName) {
496
496
  case 's':
497
497
  switch (c[1]) {
498
498
  case 'i':
499
- return SIVAN$1;
499
+ return SIVAN$2;
500
500
  case 'h':
501
501
  return SHVAT$1;
502
502
  }
@@ -504,7 +504,7 @@ function monthFromName(monthName) {
504
504
  case 't':
505
505
  switch (c[1]) {
506
506
  case 'a':
507
- return TAMUZ$1;
507
+ return TAMUZ$2;
508
508
  case 'i':
509
509
  return TISHREI$2;
510
510
  case 'e':
@@ -514,7 +514,7 @@ function monthFromName(monthName) {
514
514
  case 'a':
515
515
  switch (c[1]) {
516
516
  case 'v':
517
- return AV$1;
517
+ return AV$2;
518
518
  case 'd':
519
519
  if (/(1|[^i]i|a|א)$/i.test(c)) {
520
520
  return ADAR_I$2;
@@ -523,7 +523,7 @@ function monthFromName(monthName) {
523
523
  }
524
524
  break;
525
525
  case 'ס':
526
- return SIVAN$1;
526
+ return SIVAN$2;
527
527
  case 'ט':
528
528
  return TEVET$2;
529
529
  case 'ש':
@@ -531,7 +531,7 @@ function monthFromName(monthName) {
531
531
  case 'א':
532
532
  switch (c[1]) {
533
533
  case 'ב':
534
- return AV$1;
534
+ return AV$2;
535
535
  case 'ד':
536
536
  if (/(1|[^i]i|a|א)$/i.test(c)) {
537
537
  return ADAR_I$2;
@@ -546,7 +546,7 @@ function monthFromName(monthName) {
546
546
  case 'ת':
547
547
  switch (c[1]) {
548
548
  case 'מ':
549
- return TAMUZ$1;
549
+ return TAMUZ$2;
550
550
  case 'ש':
551
551
  return TISHREI$2;
552
552
  }
@@ -557,7 +557,7 @@ function monthFromName(monthName) {
557
557
 
558
558
  /*! @hebcal/hdate v0.22.2, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
559
559
 
560
- const NISAN$3 = months.NISAN;
560
+ const NISAN$4 = months.NISAN;
561
561
  const CHESHVAN = months.CHESHVAN;
562
562
  const KISLEV$1 = months.KISLEV;
563
563
  const TEVET$1 = months.TEVET;
@@ -663,7 +663,7 @@ function getBirthdayHD(hyear, date) {
663
663
  day === 30 &&
664
664
  isOrigLeap &&
665
665
  !isLeapYear(hyear)) {
666
- month = NISAN$3;
666
+ month = NISAN$4;
667
667
  day = 1;
668
668
  }
669
669
  return { yy: hyear, mm: month, dd: day };
@@ -1919,7 +1919,7 @@ const flags = {
1919
1919
  };
1920
1920
  const flagToCategory = [
1921
1921
  [flags.MAJOR_FAST, 'holiday', 'major', 'fast'],
1922
- [flags.CHANUKAH_CANDLES, 'holiday', 'major'],
1922
+ [flags.CHANUKAH_CANDLES, 'holiday', 'minor'],
1923
1923
  [flags.HEBREW_DATE, 'hebdate'],
1924
1924
  [flags.MINOR_FAST, 'holiday', 'fast'],
1925
1925
  [flags.MINOR_HOLIDAY, 'holiday', 'minor'],
@@ -9298,8 +9298,8 @@ class QuickLRU extends Map {
9298
9298
  const SUN$1 = 0;
9299
9299
  const TUE$1 = 2;
9300
9300
  const FRI$2 = 5;
9301
- const SAT$2 = 6;
9302
- const NISAN$2 = months.NISAN;
9301
+ const SAT$3 = 6;
9302
+ const NISAN$3 = months.NISAN;
9303
9303
  const IYYAR = months.IYYAR;
9304
9304
  /**
9305
9305
  * Yom HaShoah first observed in 1951.
@@ -9315,12 +9315,12 @@ function dateYomHaShoah(year) {
9315
9315
  if (year < 5711) {
9316
9316
  return null;
9317
9317
  }
9318
- let nisan27dt = new HDate(27, NISAN$2, year);
9318
+ let nisan27dt = new HDate(27, NISAN$3, year);
9319
9319
  if (nisan27dt.getDay() === FRI$2) {
9320
- nisan27dt = new HDate(26, NISAN$2, year);
9320
+ nisan27dt = new HDate(26, NISAN$3, year);
9321
9321
  }
9322
9322
  else if (nisan27dt.getDay() === SUN$1) {
9323
- nisan27dt = new HDate(28, NISAN$2, year);
9323
+ nisan27dt = new HDate(28, NISAN$3, year);
9324
9324
  }
9325
9325
  return nisan27dt;
9326
9326
  }
@@ -9334,12 +9334,12 @@ function dateYomHaZikaron(year) {
9334
9334
  return null;
9335
9335
  }
9336
9336
  let day;
9337
- const pesach = new HDate(15, NISAN$2, year);
9337
+ const pesach = new HDate(15, NISAN$3, year);
9338
9338
  const pdow = pesach.getDay();
9339
9339
  if (pdow === SUN$1) {
9340
9340
  day = 2;
9341
9341
  }
9342
- else if (pdow === SAT$2) {
9342
+ else if (pdow === SAT$3) {
9343
9343
  day = 3;
9344
9344
  }
9345
9345
  else if (year < 5764) {
@@ -9848,7 +9848,7 @@ const IL_ONLY$2 = flags.IL_ONLY;
9848
9848
  const LIGHT_CANDLES_TZEIS$3 = flags.LIGHT_CANDLES_TZEIS;
9849
9849
  const MAJOR_FAST$2 = flags.MAJOR_FAST;
9850
9850
  const MINOR_HOLIDAY$2 = flags.MINOR_HOLIDAY;
9851
- const EREV$2 = flags.EREV;
9851
+ const EREV$3 = flags.EREV;
9852
9852
  const CHOL_HAMOED$1 = flags.CHOL_HAMOED;
9853
9853
  const emojiPesach = '🫓';
9854
9854
  const emojiSukkot = '🌿🍋';
@@ -10084,7 +10084,7 @@ const staticHolidays = [
10084
10084
  flags: CHAG$1 | YOM_TOV_ENDS$1,
10085
10085
  emoji: '🍏🍯',
10086
10086
  },
10087
- { mm: Tishrei, dd: 9, desc: EREV_YOM_KIPPUR, flags: EREV$2 | LIGHT_CANDLES$3 },
10087
+ { mm: Tishrei, dd: 9, desc: EREV_YOM_KIPPUR, flags: EREV$3 | LIGHT_CANDLES$3 },
10088
10088
  {
10089
10089
  mm: Tishrei,
10090
10090
  dd: 10,
@@ -10095,7 +10095,7 @@ const staticHolidays = [
10095
10095
  mm: Tishrei,
10096
10096
  dd: 14,
10097
10097
  desc: EREV_SUKKOT,
10098
- flags: CHUL_ONLY$1 | EREV$2 | LIGHT_CANDLES$3,
10098
+ flags: CHUL_ONLY$1 | EREV$3 | LIGHT_CANDLES$3,
10099
10099
  emoji: emojiSukkot,
10100
10100
  },
10101
10101
  {
@@ -10160,7 +10160,7 @@ const staticHolidays = [
10160
10160
  mm: Tishrei,
10161
10161
  dd: 14,
10162
10162
  desc: EREV_SUKKOT,
10163
- flags: IL_ONLY$2 | EREV$2 | LIGHT_CANDLES$3,
10163
+ flags: IL_ONLY$2 | EREV$3 | LIGHT_CANDLES$3,
10164
10164
  emoji: emojiSukkot,
10165
10165
  },
10166
10166
  {
@@ -10229,7 +10229,7 @@ const staticHolidays = [
10229
10229
  mm: Adar2,
10230
10230
  dd: 13,
10231
10231
  desc: EREV_PURIM,
10232
- flags: EREV$2 | MINOR_HOLIDAY$2,
10232
+ flags: EREV$3 | MINOR_HOLIDAY$2,
10233
10233
  emoji: '🎭️📜',
10234
10234
  },
10235
10235
  { mm: Adar2, dd: 14, desc: PURIM, flags: MINOR_HOLIDAY$2, emoji: '🎭️📜' },
@@ -10245,7 +10245,7 @@ const staticHolidays = [
10245
10245
  mm: Nisan,
10246
10246
  dd: 14,
10247
10247
  desc: EREV_PESACH,
10248
- flags: IL_ONLY$2 | EREV$2 | LIGHT_CANDLES$3,
10248
+ flags: IL_ONLY$2 | EREV$3 | LIGHT_CANDLES$3,
10249
10249
  emoji: '🫓🍷',
10250
10250
  },
10251
10251
  {
@@ -10307,7 +10307,7 @@ const staticHolidays = [
10307
10307
  mm: Nisan,
10308
10308
  dd: 14,
10309
10309
  desc: EREV_PESACH,
10310
- flags: CHUL_ONLY$1 | EREV$2 | LIGHT_CANDLES$3,
10310
+ flags: CHUL_ONLY$1 | EREV$3 | LIGHT_CANDLES$3,
10311
10311
  emoji: '🫓🍷',
10312
10312
  },
10313
10313
  {
@@ -10376,7 +10376,7 @@ const staticHolidays = [
10376
10376
  mm: Sivan,
10377
10377
  dd: 5,
10378
10378
  desc: EREV_SHAVUOT,
10379
- flags: EREV$2 | LIGHT_CANDLES$3,
10379
+ flags: EREV$3 | LIGHT_CANDLES$3,
10380
10380
  emoji: '⛰️🌸',
10381
10381
  },
10382
10382
  {
@@ -10412,7 +10412,7 @@ const staticHolidays = [
10412
10412
  mm: Elul,
10413
10413
  dd: 29,
10414
10414
  desc: EREV_ROSH_HASHANA,
10415
- flags: EREV$2 | LIGHT_CANDLES$3,
10415
+ flags: EREV$3 | LIGHT_CANDLES$3,
10416
10416
  emoji: '🍏🍯',
10417
10417
  },
10418
10418
  ];
@@ -10733,15 +10733,15 @@ const SPECIAL_SHABBAT$1 = flags.SPECIAL_SHABBAT;
10733
10733
  const MODERN_HOLIDAY$1 = flags.MODERN_HOLIDAY;
10734
10734
  const MAJOR_FAST$1 = flags.MAJOR_FAST;
10735
10735
  const MINOR_HOLIDAY$1 = flags.MINOR_HOLIDAY;
10736
- const EREV$1 = flags.EREV;
10736
+ const EREV$2 = flags.EREV;
10737
10737
  const SUN = 0;
10738
10738
  const TUE = 2;
10739
10739
  const THU = 4;
10740
10740
  const FRI$1 = 5;
10741
- const SAT$1 = 6;
10742
- const NISAN$1 = months.NISAN;
10743
- const TAMUZ = months.TAMUZ;
10744
- const AV = months.AV;
10741
+ const SAT$2 = 6;
10742
+ const NISAN$2 = months.NISAN;
10743
+ const TAMUZ$1 = months.TAMUZ;
10744
+ const AV$1 = months.AV;
10745
10745
  const TISHREI$1 = months.TISHREI;
10746
10746
  const KISLEV = months.KISLEV;
10747
10747
  const TEVET = months.TEVET;
@@ -10767,14 +10767,14 @@ function getHolidaysForYear_(year) {
10767
10767
  return cached;
10768
10768
  }
10769
10769
  const RH = new HDate(1, TISHREI$1, year);
10770
- const pesach = new HDate(15, NISAN$1, year);
10770
+ const pesach = new HDate(15, NISAN$2, year);
10771
10771
  const map = new Map();
10772
10772
  function add(...events) {
10773
10773
  for (const ev of events) {
10774
10774
  const key = ev.date.toString();
10775
10775
  const arr = map.get(key);
10776
10776
  if (typeof arr === 'object') {
10777
- if (arr[0].getFlags() & EREV$1) {
10777
+ if (arr[0].getFlags() & EREV$2) {
10778
10778
  arr.unshift(ev);
10779
10779
  }
10780
10780
  else {
@@ -10801,12 +10801,12 @@ function getHolidaysForYear_(year) {
10801
10801
  const tzomGedaliahDay = RH.getDay() === THU ? 4 : 3;
10802
10802
  add(new HolidayEvent(new HDate(tzomGedaliahDay, TISHREI$1, year), holidayDesc.TZOM_GEDALIAH, MINOR_FAST$1));
10803
10803
  // first SAT after RH
10804
- add(new HolidayEvent(new HDate(HDate.dayOnOrBefore(SAT$1, 7 + RH.abs())), holidayDesc.SHABBAT_SHUVA, SPECIAL_SHABBAT$1));
10804
+ add(new HolidayEvent(new HDate(HDate.dayOnOrBefore(SAT$2, 7 + RH.abs())), holidayDesc.SHABBAT_SHUVA, SPECIAL_SHABBAT$1));
10805
10805
  const rchTevet = HDate.shortKislev(year)
10806
10806
  ? new HDate(1, TEVET, year)
10807
10807
  : new HDate(30, KISLEV, year);
10808
10808
  add(new HolidayEvent(rchTevet, holidayDesc.CHAG_HABANOT, MINOR_HOLIDAY$1));
10809
- add(new ChanukahEvent(new HDate(24, KISLEV, year), holidayDesc.CHANUKAH_1_CANDLE, EREV$1 | MINOR_HOLIDAY$1 | CHANUKAH_CANDLES$1, undefined));
10809
+ add(new ChanukahEvent(new HDate(24, KISLEV, year), holidayDesc.CHANUKAH_1_CANDLE, EREV$2 | MINOR_HOLIDAY$1 | CHANUKAH_CANDLES$1, undefined));
10810
10810
  // yes, we know Kislev 30-32 are wrong
10811
10811
  // HDate() corrects the month automatically
10812
10812
  for (let candles = 2; candles <= 8; candles++) {
@@ -10816,14 +10816,14 @@ function getHolidaysForYear_(year) {
10816
10816
  add(new ChanukahEvent(new HDate(32, KISLEV, year), holidayDesc.CHANUKAH_8TH_DAY, MINOR_HOLIDAY$1, 8));
10817
10817
  add(new AsaraBTevetEvent(new HDate(10, TEVET, year), holidayDesc.ASARA_BTEVET, MINOR_FAST$1));
10818
10818
  const pesachAbs = pesach.abs();
10819
- add(new HolidayEvent(new HDate(HDate.dayOnOrBefore(SAT$1, pesachAbs - 43)), holidayDesc.SHABBAT_SHEKALIM, SPECIAL_SHABBAT$1), new HolidayEvent(new HDate(HDate.dayOnOrBefore(SAT$1, pesachAbs - 30)), holidayDesc.SHABBAT_ZACHOR, SPECIAL_SHABBAT$1), new HolidayEvent(new HDate(pesachAbs - (pesach.getDay() === TUE ? 33 : 31)), holidayDesc.TAANIT_ESTHER, MINOR_FAST$1));
10820
- const haChodeshAbs = HDate.dayOnOrBefore(SAT$1, pesachAbs - 14);
10821
- add(new HolidayEvent(new HDate(haChodeshAbs - 7), holidayDesc.SHABBAT_PARAH, SPECIAL_SHABBAT$1), new HolidayEvent(new HDate(haChodeshAbs), holidayDesc.SHABBAT_HACHODESH, SPECIAL_SHABBAT$1), new HolidayEvent(new HDate(HDate.dayOnOrBefore(SAT$1, pesachAbs - 1)), holidayDesc.SHABBAT_HAGADOL, SPECIAL_SHABBAT$1), new HolidayEvent(
10819
+ add(new HolidayEvent(new HDate(HDate.dayOnOrBefore(SAT$2, pesachAbs - 43)), holidayDesc.SHABBAT_SHEKALIM, SPECIAL_SHABBAT$1), new HolidayEvent(new HDate(HDate.dayOnOrBefore(SAT$2, pesachAbs - 30)), holidayDesc.SHABBAT_ZACHOR, SPECIAL_SHABBAT$1), new HolidayEvent(new HDate(pesachAbs - (pesach.getDay() === TUE ? 33 : 31)), holidayDesc.TAANIT_ESTHER, MINOR_FAST$1));
10820
+ const haChodeshAbs = HDate.dayOnOrBefore(SAT$2, pesachAbs - 14);
10821
+ add(new HolidayEvent(new HDate(haChodeshAbs - 7), holidayDesc.SHABBAT_PARAH, SPECIAL_SHABBAT$1), new HolidayEvent(new HDate(haChodeshAbs), holidayDesc.SHABBAT_HACHODESH, SPECIAL_SHABBAT$1), new HolidayEvent(new HDate(HDate.dayOnOrBefore(SAT$2, pesachAbs - 1)), holidayDesc.SHABBAT_HAGADOL, SPECIAL_SHABBAT$1), new HolidayEvent(
10822
10822
  // if the fast falls on Shabbat, move to Thursday
10823
- pesach.prev().getDay() === SAT$1
10823
+ pesach.prev().getDay() === SAT$2
10824
10824
  ? pesach.onOrBefore(THU)
10825
- : new HDate(14, NISAN$1, year), holidayDesc.TAANIT_BECHOROT, MINOR_FAST$1));
10826
- add(new HolidayEvent(new HDate(HDate.dayOnOrBefore(SAT$1, new HDate(1, TISHREI$1, year + 1).abs() - 4)), holidayDesc.LEIL_SELICHOT, MINOR_HOLIDAY$1, { emoji: '🕍' }));
10825
+ : new HDate(14, NISAN$2, year), holidayDesc.TAANIT_BECHOROT, MINOR_FAST$1));
10826
+ add(new HolidayEvent(new HDate(HDate.dayOnOrBefore(SAT$2, new HDate(1, TISHREI$1, year + 1).abs() - 4)), holidayDesc.LEIL_SELICHOT, MINOR_HOLIDAY$1, { emoji: '🕍' }));
10827
10827
  if (pesach.getDay() === SUN) {
10828
10828
  add(new HolidayEvent(new HDate(16, ADAR_II, year), holidayDesc.PURIM_MESHULASH, MINOR_HOLIDAY$1));
10829
10829
  }
@@ -10843,13 +10843,13 @@ function getHolidaysForYear_(year) {
10843
10843
  if (year >= h.firstYear) {
10844
10844
  let hd = new HDate(h.dd, h.mm, year);
10845
10845
  const dow = hd.getDay();
10846
- if (h.friSatMovetoThu && (dow === FRI$1 || dow === SAT$1)) {
10846
+ if (h.friSatMovetoThu && (dow === FRI$1 || dow === SAT$2)) {
10847
10847
  hd = hd.onOrBefore(THU);
10848
10848
  }
10849
10849
  else if (h.friPostponeToSun && dow === FRI$1) {
10850
10850
  hd = new HDate(hd.abs() + 2);
10851
10851
  }
10852
- else if (h.satPostponeToSun && dow === SAT$1) {
10852
+ else if (h.satPostponeToSun && dow === SAT$2) {
10853
10853
  hd = hd.next();
10854
10854
  }
10855
10855
  const mask = h.chul ? MODERN_HOLIDAY$1 : MODERN_HOLIDAY$1 | IL_ONLY$1;
@@ -10860,27 +10860,27 @@ function getHolidaysForYear_(year) {
10860
10860
  add(ev);
10861
10861
  }
10862
10862
  }
10863
- let tamuz17 = new HDate(17, TAMUZ, year);
10863
+ let tamuz17 = new HDate(17, TAMUZ$1, year);
10864
10864
  let tamuz17attrs;
10865
- if (tamuz17.getDay() === SAT$1) {
10866
- tamuz17 = new HDate(18, TAMUZ, year);
10865
+ if (tamuz17.getDay() === SAT$2) {
10866
+ tamuz17 = new HDate(18, TAMUZ$1, year);
10867
10867
  tamuz17attrs = { observed: true };
10868
10868
  }
10869
10869
  add(new HolidayEvent(tamuz17, holidayDesc.TZOM_TAMMUZ, MINOR_FAST$1, tamuz17attrs));
10870
- let av9dt = new HDate(9, AV, year);
10870
+ let av9dt = new HDate(9, AV$1, year);
10871
10871
  let av9title = holidayDesc.TISHA_BAV;
10872
10872
  let av9attrs;
10873
- if (av9dt.getDay() === SAT$1) {
10873
+ if (av9dt.getDay() === SAT$2) {
10874
10874
  av9dt = av9dt.next();
10875
10875
  av9attrs = { observed: true };
10876
10876
  av9title += ' (observed)';
10877
10877
  }
10878
10878
  const av9abs = av9dt.abs();
10879
- add(new HolidayEvent(new HDate(HDate.dayOnOrBefore(SAT$1, av9abs)), holidayDesc.SHABBAT_CHAZON, SPECIAL_SHABBAT$1), new HolidayEvent(av9dt.prev(), holidayDesc.EREV_TISHA_BAV, EREV$1 | MAJOR_FAST$1, av9attrs), new HolidayEvent(av9dt, av9title, MAJOR_FAST$1, av9attrs), new HolidayEvent(new HDate(HDate.dayOnOrBefore(SAT$1, av9abs + 7)), holidayDesc.SHABBAT_NACHAMU, SPECIAL_SHABBAT$1));
10879
+ add(new HolidayEvent(new HDate(HDate.dayOnOrBefore(SAT$2, av9abs)), holidayDesc.SHABBAT_CHAZON, SPECIAL_SHABBAT$1), new HolidayEvent(av9dt.prev(), holidayDesc.EREV_TISHA_BAV, EREV$2 | MAJOR_FAST$1, av9attrs), new HolidayEvent(av9dt, av9title, MAJOR_FAST$1, av9attrs), new HolidayEvent(new HDate(HDate.dayOnOrBefore(SAT$2, av9abs + 7)), holidayDesc.SHABBAT_NACHAMU, SPECIAL_SHABBAT$1));
10880
10880
  const monthsInYear = HDate.monthsInYear(year);
10881
10881
  for (let month = 1; month <= monthsInYear; month++) {
10882
10882
  const monthName = HDate.getMonthName(month, year);
10883
- if ((month === NISAN$1
10883
+ if ((month === NISAN$2
10884
10884
  ? HDate.daysInMonth(HDate.monthsInYear(year - 1), year - 1)
10885
10885
  : HDate.daysInMonth(month - 1, year)) === 30) {
10886
10886
  add(new RoshChodeshEvent(new HDate(1, month, year), monthName));
@@ -10904,7 +10904,7 @@ function getHolidaysForYear_(year) {
10904
10904
  }
10905
10905
  let ykk = new HDate(29, month, year);
10906
10906
  const dow = ykk.getDay();
10907
- if (dow === FRI$1 || dow === SAT$1) {
10907
+ if (dow === FRI$1 || dow === SAT$2) {
10908
10908
  ykk = ykk.onOrBefore(THU);
10909
10909
  }
10910
10910
  const nextMonthName = HDate.getMonthName(nextMonth, year);
@@ -10935,7 +10935,7 @@ function getHolidaysForYear_(year) {
10935
10935
  */
10936
10936
  function getBirkatHaChama(year) {
10937
10937
  const leap = HDate.isLeapYear(year);
10938
- const startMonth = leap ? ADAR_II : NISAN$1;
10938
+ const startMonth = leap ? ADAR_II : NISAN$2;
10939
10939
  const startDay = leap ? 20 : 1;
10940
10940
  const baseRd = HDate.hebrew2abs(year, startMonth, startDay);
10941
10941
  for (let day = 0; day <= 40; day++) {
@@ -11027,6 +11027,61 @@ function isAssurBemlacha(currentTime, location, useElevation) {
11027
11027
  return false;
11028
11028
  }
11029
11029
 
11030
+ const NISAN$1 = months.NISAN;
11031
+ const SIVAN$1 = months.SIVAN;
11032
+ const TAMUZ = months.TAMUZ;
11033
+ const AV = months.AV;
11034
+ const SAT$1 = 6;
11035
+ function getHDate(date) {
11036
+ return HDate.isHDate(date) ? date : new HDate(date);
11037
+ }
11038
+ function isSefiratHaOmer(hd) {
11039
+ const hyear = hd.getFullYear();
11040
+ const beginOmer = new HDate(16, NISAN$1, hyear).abs();
11041
+ const endOmer = new HDate(5, SIVAN$1, hyear).abs();
11042
+ const abs = hd.abs();
11043
+ return abs >= beginOmer && abs <= endOmer;
11044
+ }
11045
+ function isBeinHaMetzarim(hd) {
11046
+ const hyear = hd.getFullYear();
11047
+ const begin = new HDate(17, TAMUZ, hyear).abs();
11048
+ const tishaBav = new HDate(9, AV, hyear);
11049
+ const end = tishaBav.getDay() === SAT$1 ? new HDate(10, AV, hyear).abs() : tishaBav.abs();
11050
+ const abs = hd.abs();
11051
+ return abs >= begin && abs <= end;
11052
+ }
11053
+ /**
11054
+ * Utility method to determine if the given date is during a mourning period.
11055
+ *
11056
+ * This broad helper returns `true` during Sefirat HaOmer and Bein HaMetzarim.
11057
+ * It does not attempt to model minhag-specific exceptions within those periods.
11058
+ *
11059
+ * @param date Hebrew Date, Gregorian date, or absolute R.D. day number
11060
+ * @return `true` if the date is during a mourning period
11061
+ */
11062
+ function isAveilut(date) {
11063
+ const hd = getHDate(date);
11064
+ return isSefiratHaOmer(hd) || isBeinHaMetzarim(hd);
11065
+ }
11066
+
11067
+ const FAST_DAY = flags.MAJOR_FAST | flags.MINOR_FAST;
11068
+ const EREV$1 = flags.EREV;
11069
+ /**
11070
+ * Utility method to determine if the given date is a fast day.
11071
+ *
11072
+ * @param date Hebrew Date, Gregorian date, or absolute R.D. day number
11073
+ * @param il use the Israeli schedule for holidays
11074
+ * @return `true` if the date is a major or minor fast day
11075
+ */
11076
+ function isFastDay(date, il) {
11077
+ const events = getHolidaysOnDate(date, il) || [];
11078
+ const fastDay = events.find(ev => {
11079
+ const mask = ev.getFlags();
11080
+ return mask & FAST_DAY && !(mask & EREV$1);
11081
+ });
11082
+ return Boolean(fastDay);
11083
+ }
11084
+
11030
11085
  const HAVDALAH = holidayDesc.HAVDALAH;
11031
11086
  const CANDLE_LIGHTING = holidayDesc.CANDLE_LIGHTING;
11032
11087
  /** An event that has an `eventTime` and `eventTimeStr` */
@@ -11645,7 +11700,12 @@ function renderParshaName(parsha, locale) {
11645
11700
  }
11646
11701
 
11647
11702
  /**
11648
- * Represents one of 54 weekly Torah portions, always on a Saturday
11703
+ * Represents one of 54 weekly Torah portions, always on a Saturday.
11704
+ *
11705
+ * `ParshaEvent` is for regular Parashat HaShavua readings. For Shabbatot
11706
+ * with holiday readings such as Shabbat Chol ha-Moed, use
11707
+ * `getHolidaysOnDate()` from `@hebcal/core`, or `getLeyningOnDate()` from
11708
+ * `@hebcal/leyning` when the display title and exact Torah readings are needed.
11649
11709
  */
11650
11710
  class ParshaEvent extends Event {
11651
11711
  constructor(parsha) {
@@ -13126,6 +13186,8 @@ exports.getMoladAsDate = getMoladAsDate;
13126
13186
  exports.getSedra = getSedra;
13127
13187
  exports.holidayDesc = holidayDesc;
13128
13188
  exports.isAssurBemlacha = isAssurBemlacha;
13189
+ exports.isAveilut = isAveilut;
13190
+ exports.isFastDay = isFastDay;
13129
13191
  exports.months = months;
13130
13192
  exports.parshaYear = parshaYear;
13131
13193
  exports.parshiot = parshiot;