Skip to content

Commit

Permalink
fix: Keep day and move to LocalTime.MAX instead of adding 1.
Browse files Browse the repository at this point in the history
  • Loading branch information
sprevilla committed Dec 10, 2021
1 parent 9f2c08c commit fe5e2a4
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import com.vaadin.ui.themes.ValoTheme;
import org.jpos.qi.QI;

import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.ZoneId;
import java.util.Date;

Expand Down Expand Up @@ -77,7 +79,8 @@ public DateRange getValue() {
dr.setStart(startDate);
}
if (datePickerTo.getValue() != null) {
Date endDate = Date.from(datePickerTo.getValue().plusDays(1).atStartOfDay(ZoneId.systemDefault()).toInstant());
LocalDateTime endOfDay = LocalDateTime.of(datePickerTo.getValue(), LocalTime.MAX);
Date endDate = Date.from(endOfDay.atZone(ZoneId.systemDefault()).toInstant());
dr.setEnd(endDate);
}
} else {
Expand Down

0 comments on commit fe5e2a4

Please sign in to comment.