Skip to content

Commit

Permalink
return Vezot Haberakhah for getLeyningOnDate weekday (Mon/Thu) leynin…
Browse files Browse the repository at this point in the history
…g between RH and Simchat Torah when Vayeilech or Ha'azinu does not fall between RH and YK #423
mjradwin committed Sep 27, 2024

Verified

This commit was signed with the committer’s verified signature.
legendecas Chengzhong Wu
1 parent ad05273 commit 2951788
Showing 4 changed files with 93 additions and 83 deletions.
151 changes: 72 additions & 79 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.2.3",
"version": "8.2.4",
"author": "Michael J. Radwin (https://github.com/mjradwin)",
"keywords": [
"hebcal",
@@ -66,10 +66,10 @@
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^12.1.0",
"@types/jest": "^29.5.13",
"@types/node": "^22.7.2",
"@types/node": "^22.7.3",
"gts": "^5.3.1",
"jest": "^29.7.0",
"rollup": "^4.22.4",
"rollup": "^4.22.5",
"ts-jest": "^29.2.5",
"typedoc": "^0.26.7",
"typescript": "^5.6.2"
5 changes: 4 additions & 1 deletion src/getLeyningOnDate.ts
Original file line number Diff line number Diff line change
@@ -16,10 +16,13 @@ function findParshaHaShavua(saturday: HDate, il: boolean): SedraResult {
return parsha;
}
// Special case between YK and Simchat Torah
// If Vayeilech or Ha'azinu occurs between RH and YK, the following block for
// Monday/Thursday weekday isn't executed because the above sedra.lookup()
// would have already found the regular Saturday parsha.
if (saturday.getMonth() === months.TISHREI) {
const dd = saturday.getDate();
const simchatTorah = il ? 22 : 23;
if (dd > 10 && dd <= simchatTorah) {
if (dd > 2 && dd <= simchatTorah) {
return {
parsha: ['Vezot Haberakhah'],
chag: false,
14 changes: 14 additions & 0 deletions test/getLeyningOnDate.spec.js
Original file line number Diff line number Diff line change
@@ -315,3 +315,17 @@ test('Erev Simchat Torah Israel', () => {
expect(readings.length).toBe(2);
expect(readings[1].name.en).toBe('Erev Simchat Torah');
});

test('getLeyningOnDate-weekday-search3', () => {
const hd = new HDate(5, 'Tishrei', 5785);
expect(hd.getDay()).toBe(1); // this is a Monday
const reading = getLeyningOnDate(hd, false);
expect(reading.name.en).toBe('Vezot Haberakhah');
});

test('getLeyningOnDate-weekday-search4', () => {
const hd = new HDate(6, 'Tishrei', 5787);
expect(hd.getDay()).toBe(4); // this is a Thursday
const reading = getLeyningOnDate(hd, false);
expect(reading.name.en).toBe('Ha\'azinu');
});

0 comments on commit 2951788

Please sign in to comment.