Fix Daf Yomi Yerushalmi cycle boundaries and skipped-day drift#268
Merged
KosherJava merged 1 commit intoKosherJava:3-0-modernizationfrom May 3, 2026
Merged
Fix Daf Yomi Yerushalmi cycle boundaries and skipped-day drift#268KosherJava merged 1 commit intoKosherJava:3-0-modernizationfrom
KosherJava merged 1 commit intoKosherJava:3-0-modernizationfrom
Conversation
## 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This fixes Daf Yomi Yerushalmi calculation bugs around cycle boundaries and skipped days. The previous implementation could return
nullon 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-13should be the first day of the next Yerushalmi cycle, returningBerachos 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 returnednull.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.