Skip to content

Commit 3ebea96

Browse files
authored
Adjust calendar logic for noon and midnight events (#245)
* Adjust calendar logic for noon and midnight events * Fix noon condition to check for hours greater than 24
1 parent 7365377 commit 3ebea96

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/java/com/kosherjava/zmanim/AstronomicalCalendar.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,8 @@ protected Date getDateFromTime(double time, SolarEvent solarEvent) {
650650
cal.add(Calendar.DAY_OF_MONTH, 1);
651651
} else if (solarEvent == SolarEvent.MIDNIGHT && localTimeHours + hours < 12) {
652652
cal.add(Calendar.DAY_OF_MONTH, 1);
653+
} else if (solarEvent == SolarEvent.NOON && localTimeHours + hours > 24) {
654+
cal.add(Calendar.DAY_OF_MONTH, -1);
653655
}
654656

655657
cal.set(Calendar.HOUR_OF_DAY, hours);

0 commit comments

Comments
 (0)