From fe5e2a48714c9730546d6b91e48c4fada6bfd360 Mon Sep 17 00:00:00 2001 From: Santiago Revilla Date: Fri, 10 Dec 2021 20:06:19 -0300 Subject: [PATCH] fix: Keep day and move to LocalTime.MAX instead of adding 1. --- .../main/java/org/jpos/qi/components/DateRangeComponent.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/qi-core/src/main/java/org/jpos/qi/components/DateRangeComponent.java b/modules/qi-core/src/main/java/org/jpos/qi/components/DateRangeComponent.java index 00896c9f28..61749c3d8c 100644 --- a/modules/qi-core/src/main/java/org/jpos/qi/components/DateRangeComponent.java +++ b/modules/qi-core/src/main/java/org/jpos/qi/components/DateRangeComponent.java @@ -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; @@ -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 {