Skip to content

Commit

Permalink
Additional fixes for Triennial haftarot
Browse files Browse the repository at this point in the history
  • Loading branch information
mjradwin committed Jul 7, 2022
1 parent 0271796 commit 2c20016
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hebcal/leyning",
"version": "4.14.5",
"version": "4.14.6",
"author": "Michael J. Radwin (https://github.com/mjradwin)",
"keywords": [
"hebcal",
Expand Down
9 changes: 3 additions & 6 deletions src/triennial-haft.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@
},
"Tazria":{
"1":{"k":"Isaiah","b":"46:3","e":"46:13","note":"since birth // birth"},
"2":{"k":"Isaiah","b":"46:3","e":"46:13","note":"im yoled zakhar // v'yaldah zakhar"},
"3":{"k":"Jeremiah","b":"30:1","e":"30:9"}
"2":{"k":"Jeremiah","b":"30:1","e":"30:9","note":"im yoled zakhar // v'yaldah zakhar"}
},
"Metzora":{
"1":{"k":"II Kings","b":"5:1","e":"5:14","note":"Healing of a leper"},
Expand All @@ -157,8 +156,7 @@
},
"Achrei Mot":{
"1":{"k":"Ezekiel","b":"22:1","e":"22:16","note":"abominations // arayot"},
"2":{"k":"Ezekiel","b":"20:2","e":"20:20","note":"abominations of Egypt // arayot"},
"3":{"k":"Ezekiel","b":"20:2","e":"20:20"}
"2":{"k":"Ezekiel","b":"20:2","e":"20:20","note":"abominations of Egypt // arayot"}
},
"Kedoshim":{
"1":{"k":"Isaiah","b":"61:1","e":"61:9","note":"you shall be called Priests // kedoshim"},
Expand All @@ -175,8 +173,7 @@
},
"Behar":{
"1":{"k":"Jeremiah","b":"32:6","e":"32:15","note":"land redemption // shmittah"},
"2":{"k":"Jeremiah","b":"32:16","e":"32:27","note":"prayerwill Israel ever redeem its land // shmittah"},
"3":{"k":"Jeremiah","b":"32:16","e":"32:27"}
"2":{"k":"Jeremiah","b":"32:16","e":"32:27","note":"prayerwill Israel ever redeem its land // shmittah"}
},
"Bechukotai":{
"1":{"k":"Jeremiah","b":"17:1","e":"17:14","note":"blessings and curses // tokhechah"},
Expand Down
5 changes: 3 additions & 2 deletions src/triennial.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,9 @@ export function getTriennialForParshaHaShavua(ev, context=false) {
*/
const triHaft = parsha.length === 1 ? triennialHaft[name] :
yearNum === 0 ? triennialHaft[p1] : triennialHaft[parsha[1]];
if (typeof triHaft === 'object') {
const haft = reading.haft = cloneHaftara(triHaft[yearNum + 1]);
const triHaft2 = triHaft && triHaft[yearNum + 1];
if (typeof triHaft2 === 'object') {
const haft = reading.haft = cloneHaftara(triHaft2);
reading.haftara = makeHaftaraSummary(haft);
reading.haftaraNumV = calculateHaftaraNumV(haft);
}
Expand Down
8 changes: 7 additions & 1 deletion src/triennial.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,13 @@ test('multi-year', (t) => {
noHolidays: true,
});
for (const ev of events) {
getTriennialForParshaHaShavua(ev, true);
try {
getTriennialForParshaHaShavua(ev, true);
} catch (err) {
console.log(ev);
console.log(err);
t.fail(ev.getDesc());
}
}
}
t.pass();
Expand Down

0 comments on commit 2c20016

Please sign in to comment.