Skip to content

3 0 modernization#257

Merged
KosherJava merged 22 commits intoKosherJava:3-0-modernizationfrom
dickermoshe:3-0-modernization
Mar 22, 2026
Merged

3 0 modernization#257
KosherJava merged 22 commits intoKosherJava:3-0-modernizationfrom
dickermoshe:3-0-modernization

Conversation

@dickermoshe
Copy link
Contributor

@dickermoshe dickermoshe commented Mar 18, 2026

This pull request migrates the Jewish date and Jewish calendar to the new java.time classes.

Changes made:

Other than migrating to the new classes, these are the breaking changes which have been added.

  • The equals check now ensures that two classes are only identical if they are of the exact same type. Previously, this kind of strict equality checking was done in the hashCode function. However, this is incorrect.
  • The Gregorian date fields have been completely removed from the JewishDate class.
  • Validating a Jewish date takes into account the length of the month for that year.
  • In the past, creating a date on day 30, for a month with 29 days, would have its day set to 29. Now we throw an error instead.
  • Remove the ability to create a Jewish date and Jewish calendar from an instant. This would have used the system's default time zone, which is a fairly big footgun in my opinion.
  • Subtracting and adding days/month/years now clamp the resulting date to a valid values. For instance, skipping from day 30 on a month with 30 days to a month with only 29 days will have its day set to 29.
  • Cloning a Jewish date will now have the molad fields set as well.
  • This pull request also migrates ZonedDateTime to LocalDate in the Zmanim classes.
  • We have also fixed a bug/documentation issue surrounding getting sunrise and sunset. Previously, getSunrise would always return elevation-adjusted sunrise. We have renamed the method names to more clearly indicate what time is being returned.
  • Simplified getInstantFromTime function.
  • Remove tests for code which no longer exists.
  • Added local.properties to gitignore.

Testing

All the Zmanim methods have been tested against the Rust implementation, which matches a fork of KosherJava that used the ICU calendar classes instead of Java that you tell calendar classes. The exception to this is getFixedLocalChatzos which utilizes the getLocalMeanTime method.
As far as the Jewish calendar methods go, testing is not as thorough.
The getYomTovIndex function is completely tested, as well as some of the other methods on the class.

I would recommend having an LLM create a very thorough regression test between our final version and 2.6 before any release.

Future work:

  • Testing Daf Yomi and Daf Yomi Yerushalmi has not been done. I strongly suspect that there are bugs here that predate this pull request.
  • getLocalMeanTime also has not been fixed.
  • getSunriseWithElevation may not be a good name for this function.

Copy link
Owner

@KosherJava KosherJava left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much. I will be testing this over the next few days

@KosherJava KosherJava merged commit 52506a7 into KosherJava:3-0-modernization Mar 22, 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