Skip to content

Commit

Permalink
If Special Shabbat includes Haftara (e.g. Machar Chodesh), remove
Browse files Browse the repository at this point in the history
any Sephardic-specific Haftara from leyning result
  • Loading branch information
mjradwin committed Jan 14, 2024
1 parent 6f3e3e3 commit 02a345c
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 65 deletions.
124 changes: 62 additions & 62 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hebcal/leyning",
"version": "8.1.4",
"version": "8.1.5",
"author": "Michael J. Radwin (https://github.com/mjradwin)",
"keywords": [
"hebcal",
Expand Down Expand Up @@ -41,7 +41,7 @@
"leyning-csv": "bin/leyning-csv"
},
"dependencies": {
"@hebcal/core": "^5.0.7"
"@hebcal/core": "^5.1.0"
},
"scripts": {
"build:rollup": "rollup -c",
Expand All @@ -63,6 +63,6 @@
"eslint-config-google": "^0.14.0",
"jsdoc": "^4.0.2",
"jsdoc-to-markdown": "^8.0.0",
"rollup": "^4.9.4"
"rollup": "^4.9.5"
}
}
10 changes: 10 additions & 0 deletions src/getLeyningForParshaHaShavua.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,3 +440,13 @@ test('Shabbat Shekalim-seph', (t) => {
t.is(reading.haftara, 'II Kings 12:1-17');
t.is(reading.sephardic, 'II Kings 11:17-12:17');
});

test('special-deletes-seph', (t) => {
const hd = new HDate(29, 'Tishrei', 5784);
const ev = new ParshaEvent(hd, ['Bereshit'], false);
const reading = getLeyningForParshaHaShavua(ev, false);
t.is(reading.reason.haftara, 'Shabbat Machar Chodesh');
t.is(reading.reason.sephardic, undefined);
t.is(reading.haftara, 'I Samuel 20:18-42');
t.is(reading.sephardic, undefined);
});
4 changes: 4 additions & 0 deletions src/leyning.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ export function getLeyningForParshaHaShavua(ev, il=false) {
const seph = result.seph = cloneHaftara(special.seph);
result.sephardic = makeSummaryFromParts(seph);
result.sephardicNumV = sumVerses(seph);
} else if (result.seph) {
delete result.seph;
delete result.sephardic;
delete result.sephardicNumV;
}
}
if (reason['7'] || reason['M']) {
Expand Down

0 comments on commit 02a345c

Please sign in to comment.