Skip to content

Fix Daf Yomi Yerushalmi cycle boundaries and skipped-day drift#268

Merged
KosherJava merged 1 commit intoKosherJava:3-0-modernizationfrom
dickermoshe:daf
May 3, 2026
Merged

Fix Daf Yomi Yerushalmi cycle boundaries and skipped-day drift#268
KosherJava merged 1 commit intoKosherJava:3-0-modernizationfrom
dickermoshe:daf

Conversation

@dickermoshe
Copy link
Copy Markdown
Contributor

@dickermoshe dickermoshe commented May 3, 2026

Summary

This fixes Daf Yomi Yerushalmi calculation bugs around cycle boundaries and skipped days. The previous implementation could return null on the first day of a new cycle, and could drift by one daf in later cycles because cycle lengths and skipped days were handled inconsistently.

Bugs Fixed

The first issue was an exact cycle-boundary bug. For example, 1984-05-13 should be the first day of the next Yerushalmi cycle, returning Berachos 1. Instead, the calculator treated it as still belonging to the previous cycle. Since the offset was exactly one past the final daf, no masechta matched and the method returned null.

The second issue was that we were not taking into account the fact that Tisha B'Av can sometimes be on the tenth of Av.

## Summary
This fixes Daf Yomi Yerushalmi calculation bugs around cycle boundaries and skipped days.
The previous implementation could return `null` on the first day of a new cycle, and could drift by one daf in later cycles because cycle lengths and skipped days were handled inconsistently.
## Bugs Fixed
The first issue was an exact cycle-boundary bug. For example, `1984-05-13` should be the first day of the next Yerushalmi cycle, returning `Berachos 1`. Instead, the calculator treated it as still belonging to the previous cycle. Since the offset was exactly one past the final daf, no masechta matched and the method returned `null`.
The second issue was skipped-day drift. The calculator counted special days using a strictly-between range and used the nominal `9 Av` date rather than the observed fast date when Tisha B’Av is delayed. Over many cycles, this could shift the computed daf by a day.
@KosherJava KosherJava merged commit a8b1cc4 into KosherJava:3-0-modernization May 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants