From 8e6aeb2e2ec93f877cd1bcecc29b749663611b2d Mon Sep 17 00:00:00 2001 From: Jan Cortiel Date: Tue, 3 Dec 2024 09:10:33 +0100 Subject: [PATCH] #418: Fix event end time in CalendarService Updated the event end time to set the datetime to 23:59 on the planned end date, ensuring that the full day is accounted for. The change also switches the boolean to 'true' for dateEnd to reflect this update, potentially impacting how end times are processed in the calendar. This adjustment should improve the accuracy of calendar entries for studies. --- src/main/java/io/redlink/more/data/service/CalendarService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/redlink/more/data/service/CalendarService.java b/src/main/java/io/redlink/more/data/service/CalendarService.java index d9acc22..0c358c6 100644 --- a/src/main/java/io/redlink/more/data/service/CalendarService.java +++ b/src/main/java/io/redlink/more/data/service/CalendarService.java @@ -36,7 +36,7 @@ public Optional getICalendarString(Long studyId) { iCalEvent.addCategories("General"); iCalEvent.setSummary("Study: " + study.title()); iCalEvent.setDateStart(Date.from(study.plannedStartDate().atStartOfDay(TimeZone.getDefault().toZoneId()).toInstant()), false); - iCalEvent.setDateEnd(Date.from(study.endDate().atStartOfDay(TimeZone.getDefault().toZoneId()).toInstant()), false); + iCalEvent.setDateEnd(Date.from(study.endDate().atTime(23, 59).atZone(TimeZone.getDefault().toZoneId()).toInstant()), true); ical.addEvent(iCalEvent); final Instant start = shiftStartIfObservationAlreadyEnded(