From 2c200168f3c650df859ab332336da91d858265f0 Mon Sep 17 00:00:00 2001 From: "Michael J. Radwin" Date: Thu, 7 Jul 2022 16:15:13 -0700 Subject: [PATCH] Additional fixes for Triennial haftarot --- package.json | 2 +- src/triennial-haft.json | 9 +++------ src/triennial.js | 5 +++-- src/triennial.spec.js | 8 +++++++- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 6feaa28..4cb2fe2 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/triennial-haft.json b/src/triennial-haft.json index 12975f2..0450bb8 100644 --- a/src/triennial-haft.json +++ b/src/triennial-haft.json @@ -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"}, @@ -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"}, @@ -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"}, diff --git a/src/triennial.js b/src/triennial.js index f843a63..3a63281 100644 --- a/src/triennial.js +++ b/src/triennial.js @@ -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); } diff --git a/src/triennial.spec.js b/src/triennial.spec.js index cd2297e..bb1fa0d 100644 --- a/src/triennial.spec.js +++ b/src/triennial.spec.js @@ -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();