@hebcal/core 6.3.1 → 6.3.2

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 (46) hide show
  1. package/dist/bundle.js +37 -10
  2. package/dist/bundle.js.map +1 -1
  3. package/dist/bundle.min.js +3 -3
  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.js +1 -1
  8. package/dist/esm/MevarchimChodeshEvent.js +1 -1
  9. package/dist/esm/ParshaEvent.js +1 -1
  10. package/dist/esm/TimedEvent.js +1 -1
  11. package/dist/esm/YomKippurKatanEvent.js +1 -1
  12. package/dist/esm/ashkenazi.po.js +1 -1
  13. package/dist/esm/calendar.js +36 -9
  14. package/dist/esm/calendar.js.map +1 -1
  15. package/dist/esm/candles.js +1 -1
  16. package/dist/esm/event.js +1 -1
  17. package/dist/esm/getStartAndEnd.js +1 -1
  18. package/dist/esm/hallel.js +1 -1
  19. package/dist/esm/he-x-NoNikud.po.js +1 -1
  20. package/dist/esm/he.po.js +1 -1
  21. package/dist/esm/hebcal.js +1 -1
  22. package/dist/esm/holidays.js +1 -1
  23. package/dist/esm/index.js +1 -1
  24. package/dist/esm/isAssurBemlacha.js +1 -1
  25. package/dist/esm/locale.js +1 -1
  26. package/dist/esm/location.js +1 -1
  27. package/dist/esm/modern.js +1 -1
  28. package/dist/esm/molad.js +1 -1
  29. package/dist/esm/moladBase.js +1 -1
  30. package/dist/esm/moladDate.js +1 -1
  31. package/dist/esm/omer.js +1 -1
  32. package/dist/esm/parshaName.js +1 -1
  33. package/dist/esm/parshaYear.js +1 -1
  34. package/dist/esm/pkgVersion.d.ts +1 -1
  35. package/dist/esm/pkgVersion.js +2 -2
  36. package/dist/esm/pkgVersion.js.map +1 -1
  37. package/dist/esm/reformatTimeStr.js +1 -1
  38. package/dist/esm/sedra.js +1 -1
  39. package/dist/esm/sefira.json.js +1 -1
  40. package/dist/esm/staticHolidays.js +1 -1
  41. package/dist/esm/tachanun.js +1 -1
  42. package/dist/esm/zmanim.js +1 -1
  43. package/dist/src/calendar.js +35 -8
  44. package/dist/src/pkgVersion.d.ts +1 -1
  45. package/dist/src/pkgVersion.js +1 -1
  46. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.3.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.3.2, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import { months } from '@hebcal/hdate';
3
3
  import { flags } from './event.js';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.3.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.3.2, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import { HDate, months } from '@hebcal/hdate';
3
3
  import { dateYomHaZikaron } from './modern.js';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.3.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.3.2, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import 'temporal-polyfill/global';
3
3
  import { NOAACalculator } from '@hebcal/noaa';
4
4
  import { HDate, isDate, getTimezoneOffset, pad2, getPseudoISO } from '@hebcal/hdate';
@@ -186,6 +186,18 @@ export function calendar(options = {}) {
186
186
  for (const ev of holidays) {
187
187
  candlesEv = appendHolidayAndRelated(candlesEv, evts, ev, options, isFriday, isSaturday, hasUserMask);
188
188
  }
189
+ const mm = hd.getMonth();
190
+ const dd = hd.getDate();
191
+ // When Erev Pesach falls on Shabbat, burning chametz is moved to Friday.
192
+ if (isFriday &&
193
+ options.candlelighting &&
194
+ mm === months.NISAN &&
195
+ dd === 13) {
196
+ const biurEv = makeBiurChametzEvent(hd, options);
197
+ if (biurEv) {
198
+ evts.push(biurEv);
199
+ }
200
+ }
189
201
  if (options.sedrot && isSaturday) {
190
202
  const parsha0 = sedra.lookup(abs);
191
203
  if (!parsha0.chag) {
@@ -193,8 +205,6 @@ export function calendar(options = {}) {
193
205
  }
194
206
  }
195
207
  if (options.yizkor) {
196
- const mm = hd.getMonth();
197
- const dd = hd.getDate();
198
208
  if ((mm === months.TISHREI && (dd === 10 || dd === 22)) ||
199
209
  (mm === NISAN && dd === (il ? 21 : 22)) ||
200
210
  (mm === SIVAN && dd === (il ? 6 : 7))) {
@@ -566,7 +576,7 @@ function appendHolidayAndRelated(candlesEv, events, ev, options, isFriday, isSat
566
576
  (options.noModern && eFlags & MODERN_HOLIDAY)) {
567
577
  return candlesEv; // bail out early
568
578
  }
569
- if (options.candlelighting && ev.getDesc() === 'Erev Pesach') {
579
+ if (options.candlelighting && ev.getDesc() === hdesc.EREV_PESACH) {
570
580
  const evts = makeErevPesachChametzEvents(ev, options);
571
581
  if (evts.length) {
572
582
  events.push(...evts);
@@ -577,7 +587,7 @@ function appendHolidayAndRelated(candlesEv, events, ev, options, isFriday, isSat
577
587
  let fastEv;
578
588
  if (options.candlelighting &&
579
589
  (isMajorFast || isMinorFast) &&
580
- ev.getDesc() !== 'Yom Kippur') {
590
+ ev.getDesc() !== hdesc.YOM_KIPPUR) {
581
591
  ev = fastEv = makeFastStartEnd(ev, options);
582
592
  if (fastEv.startEvent &&
583
593
  (isMajorFast || (isMinorFast && !options.noMinorFast))) {
@@ -670,15 +680,32 @@ function makeErevPesachChametzEvents(erevPesachEv, options) {
670
680
  const hd = erevPesachEv.getDate();
671
681
  const zmanim = new Zmanim(location, hd, useElevation);
672
682
  const zmanAchilas = zmanim.sofZmanTfilla(); // Gra
673
- const time = zmanim.sofZmanBiurChametzGRA();
674
- if (isNaN(zmanAchilas.getTime()) || isNaN(time.getTime())) {
683
+ if (isNaN(zmanAchilas.getTime())) {
675
684
  return [];
676
685
  }
677
686
  const zmanAchilasEv = new TimedEvent(hd, hdesc.SOF_ZMAN_ACHILAT_CHAMETZ, 0, zmanAchilas, location, undefined, options);
678
687
  zmanAchilasEv.emoji = '🍞';
679
688
  evts.push(zmanAchilasEv);
689
+ // When Erev Pesach falls on Shabbat, chametz cannot be burned on Shabbat,
690
+ // so Biur Chametz is emitted on the Friday before (see makeBiurChametzEvent
691
+ // called from the main calendar loop). Skip it here in that case.
692
+ if (hd.getDay() !== SAT) {
693
+ const biurEv = makeBiurChametzEvent(hd, options);
694
+ if (biurEv) {
695
+ evts.push(biurEv);
696
+ }
697
+ }
698
+ return evts;
699
+ }
700
+ function makeBiurChametzEvent(hd, options) {
701
+ const location = options.location;
702
+ const useElevation = Boolean(options.useElevation);
703
+ const zmanim = new Zmanim(location, hd, useElevation);
704
+ const time = zmanim.sofZmanBiurChametzGRA();
705
+ if (isNaN(time.getTime())) {
706
+ return undefined;
707
+ }
680
708
  const biurChametzEv = new TimedEvent(hd, hdesc.BIUR_CHAMETZ, 0, time, location, undefined, options);
681
709
  biurChametzEv.emoji = '🔥';
682
- evts.push(biurChametzEv);
683
- return evts;
710
+ return biurChametzEv;
684
711
  }
@@ -1,2 +1,2 @@
1
1
  /** DO NOT EDIT THIS AUTO-GENERATED FILE! */
2
- export declare const version = "6.3.1";
2
+ export declare const version = "6.3.2";
@@ -1,2 +1,2 @@
1
1
  /** DO NOT EDIT THIS AUTO-GENERATED FILE! */
2
- export const version = '6.3.1';
2
+ export const version = '6.3.2';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hebcal/core",
3
- "version": "6.3.1",
3
+ "version": "6.3.2",
4
4
  "author": "Michael J. Radwin (https://github.com/mjradwin)",
5
5
  "contributors": [
6
6
  "Eyal Schachter (https://github.com/Scimonster)",