You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calculators now cache sunrise, sunset, noon and midnight results, which significantly speeds up generating many zmanim. For example, a day’s calendar needs sunrise several times (for sunrise itself, sof zman krias shema GRA, and others); it is now calculated once. Cached results are only reused for identical inputs, so results are exactly the same as without caching. Caching is on by default and can be turned off with setUseResultCache(false).
The SPA and Meeus calculators are faster, because they now reuse the parts of each day’s calculation that are the same for every zman. The SPA calculator was also brought in line with the reference implementation, and now matches it to within about 2 ms. It also now correctly reports no event on polar days where it previously could return an incorrect time. In addition, SPA no longer evaluates its full, expensive solar-position series at every step of a calculation. It evaluates the series at a few points per day, interpolates between them, and verifies every result against the full calculation, falling back to it when needed. This makes it several times faster than the reference implementation, with no loss of accuracy.
ComprehensiveZmanimCalendar: Return null for zmanim that fall outside the day on very short polar days, instead of an invalid time:
getMinchaGedola30Minutes() and getMinchaGedolaGRAFixedLocalChatzos30Minutes() when the result is after sunset (also avoids a NullPointerException during polar night).
getSofZmanShma3HoursBeforeChatzos() and getSofZmanTfila2HoursBeforeChatzos() when the result is before sunrise.
getFixedLocalChatzosHayom() when fixed local chatzos is before sunrise or after sunset, along with the half-day zmanim based on it.
getBainHashmashosYereim18Minutes(), getBainHashmashosYereim16Point875Minutes() and getBainHashmashosYereim13Point5Minutes() when the result is before plag hamincha GRA.
getMinchaKetanaAteretTorah(), getPlagHaminchaAteretTorah(), getMinchaKetanaAhavatShalom() and getPlagAhavatShalom() when the result is after sunset.
ComprehensiveZmanimCalendar: getMinchaGedolaGreaterThan30() and getMinchaGedolaAhavatShalom() fall back to the regular mincha gedola when 30 minutes after chatzos is after sunset.
ZmanimCalendar
getCandleLighting() returns null when candle lighting would be before plag hamincha GRA (very short winter days).
isAssurBemelacha() now throws a descriptive IllegalStateException when a day boundary it needs (sunset on erev Shabbos/Yom Tov, tzais on Shabbos/Yom Tov) can't be determined, such as in polar regions, instead of a NullPointerException. Results are unchanged wherever the boundaries exist.
ZmanimFormatter: Fix a thread-safety issue in duration formatting (shared static DecimalFormat instances are now per-instance).