Skip to content

Commit

Permalink
Include Yizkor event earlier in event array (before omer / candles)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjradwin committed Nov 12, 2024
1 parent 83ee626 commit fc96c55
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 92 deletions.
156 changes: 78 additions & 78 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hebcal/core",
"version": "5.8.0",
"version": "5.8.1",
"author": "Michael J. Radwin (https://github.com/mjradwin)",
"contributors": [
"Eyal Schachter (https://github.com/Scimonster)",
Expand Down Expand Up @@ -45,6 +45,7 @@
"bugs": {
"url": "https://github.com/hebcal/hebcal-es6/issues"
},
"homepage": "https://hebcal.github.io/api/core/",
"files": [
"dist"
],
Expand Down Expand Up @@ -88,7 +89,7 @@
"gts": "^6.0.2",
"jest": "^29.7.0",
"pretty-bytes": "^6.1.1",
"rollup": "^4.24.4",
"rollup": "^4.25.0",
"rollup-plugin-bundle-size": "^1.0.3",
"rollup-plugin-visualizer": "^5.12.0",
"ttag-cli": "^1.10.12",
Expand Down
24 changes: 12 additions & 12 deletions src/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,18 @@ export function calendar(options: CalOptions = {}): Event[] {
evts.push(new ParshaEvent(hd, parsha0.parsha, il, parsha0.num));
}
}
if (options.yizkor) {
const mm = hd.getMonth();
const dd = hd.getDate();
if (
(mm === months.TISHREI && (dd === 10 || dd === 22)) ||
(mm === NISAN && dd === (il ? 21 : 22)) ||
(mm === SIVAN && dd === (il ? 6 : 7))
) {
const ev = new Event(hd, 'Yizkor', flags.YIZKOR, {emoji: '🕯️'});
evts.push(ev);
}
}
const dailyLearning = options.dailyLearning;
if (typeof dailyLearning === 'object') {
const events = makeDailyLearning(hd, dailyLearning, il);
Expand Down Expand Up @@ -234,18 +246,6 @@ export function calendar(options: CalOptions = {}): Event[] {
if (candlesEv) {
evts.push(candlesEv);
}
if (options.yizkor) {
const mm = hd.getMonth();
const dd = hd.getDate();
if (
(mm === months.TISHREI && (dd === 10 || dd === 22)) ||
(mm === NISAN && dd === (il ? 21 : 22)) ||
(mm === SIVAN && dd === (il ? 6 : 7))
) {
const ev = new Event(hd, 'Yizkor', flags.YIZKOR, {emoji: '🕯️'});
evts.push(ev);
}
}
if (
options.addHebrewDates ||
(options.addHebrewDatesForEvents && prevEventsLength !== evts.length)
Expand Down

0 comments on commit fc96c55

Please sign in to comment.