Migrate to LocalDate, Fix some bugs#253
Migrate to LocalDate, Fix some bugs#253KosherJava merged 2 commits intoKosherJava:3-0-modernizationfrom
Conversation
…e correct SUNRISE enum in getInstantFromTime
KosherJava
left a comment
There was a problem hiding this comment.
Thank you for the extensive set of changes. It is interesting that we still need a ZonedDateTime in a few instances (not surprising), but it is not in the publicly facing API.
|
Thanks, I will now create a set of tests which will compare the results of the old and new api. Keep in mind that it is impossible to do extensive testing comparing the two becuase:
I'll see what I can do |
|
Thank you @dickermoshe . While edge cases were fixed by ICU, the main focus is on day-to-day minor changes in old vs. the new, and I appreciate your testing. Try current year for a number of cities with all zmanim compared. |
|
Testing java against java is something that I do not know how to do. |
This PR will replace
ZonedDateTimewithLocalDate.The benefit of this change is that the time zone is only in a single location. It is impossible for the timezone in the geolocation class to differ from the timezone in the
ZonedDateTime. It also generally makes the entire API more user-friendly. In the past, I've been confused about what time of day theZonedDateTimeshould use.Additionally, this PR fixes a small error in the
getSunriseOffsetByDegreesfunction, WhereSolarEvent.SUNSETwas being passed togetInstantFromTime.This PR fixes a bug in
getInstantFromTime, which simplifies the calculation by offloading the math to the Java Duration class. There was also an issue where the Instant being returned was incorrectly converting to the local timezone.