Skip to content

Commit

Permalink
Calendar: Include חנוכה and פורים in calendar lists
Browse files Browse the repository at this point in the history
  • Loading branch information
SLaks committed Oct 22, 2024
1 parent 943e5e3 commit 05360be
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/calendar-model/generator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ test('generates leinings surrounding חנוכה', (t) => {
)
})

test('generates leinings surrounding פורים', (t) => {
const results = generator.aroundDate(new Date(2025, 2, 13))
t.snapshot(results.map((ld) => `${ld.id}: ${ld.title}`))
})

/** Prints the information in a `LeiningDate`, to be easily readable in the Markdown snapshot. */
function dumpLeiningDate(date: HDate) {
const ld = generator.createLeiningDate(date)
Expand Down
17 changes: 17 additions & 0 deletions src/calendar-model/generator.test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -443,11 +443,28 @@ Generated by [AVA](https://avajs.dev).
[
'2025-12-13: פרשת וישב',
'2025-12-15: חנוכה יום א׳',
'2025-12-16: חנוכה יום ב׳',
'2025-12-17: חנוכה יום ג׳',
'2025-12-18: חנוכה יום ד׳',
'2025-12-19: חנוכה יום ה׳',
'2025-12-20: פרשת מקץ',
'2025-12-21: חנוכה יום ז׳ (ראש חודש)',
'2025-12-22: חנוכה יום ח׳',
'2025-12-27: פרשת ויגש',
]

## generates leinings surrounding פורים

> Snapshot 1
[
'2025-03-08: פרשת תצוה',
'2025-03-13: תענית אסתר',
'2025-03-14: פורים',
'2025-03-15: פרשת כי תשא',
]

## generates the full LeiningDate object for יום כיפור

> This test verified the full structure of the LeiningDate interface
Expand Down
Binary file modified src/calendar-model/generator.test.ts.snap
Binary file not shown.
1 change: 1 addition & 0 deletions src/calendar-model/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export class LeiningGenerator {
flags.CHAG |
flags.MINOR_FAST |
flags.MAJOR_FAST |
flags.MINOR_HOLIDAY |
flags.ROSH_CHODESH |
flags.CHOL_HAMOED |
flags.PARSHA_HASHAVUA,
Expand Down

0 comments on commit 05360be

Please sign in to comment.