diff --git a/backend/src/appointment/controller/calendar.py b/backend/src/appointment/controller/calendar.py index 77ac7a451..d82c9a2fd 100644 --- a/backend/src/appointment/controller/calendar.py +++ b/backend/src/appointment/controller/calendar.py @@ -318,12 +318,19 @@ def list_events(self, start, end): # Mark tentative events tentative = status == "tentative" + title = e.vobject_instance.vevent.summary.value + start = e.vobject_instance.vevent.dtstart.value + # get_duration grabs either end or duration into a timedelta + end = start + e.get_duration() + # if start doesn't hold time information (no datetime), it's a whole day + all_day = not isinstance(start, datetime) + events.append( schemas.Event( - title=e.vobject_instance.vevent.summary.value, - start=e.vobject_instance.vevent.dtstart.value, - end=e.vobject_instance.vevent.dtend.value, - all_day=not isinstance(e.vobject_instance.vevent.dtstart.value, datetime), + title=title, + start=start, + end=end, + all_day=all_day, tentative=tentative, description=e.icalendar_component["description"] if "description" in e.icalendar_component else "", ) diff --git a/frontend/src/components/CalendarQalendar.vue b/frontend/src/components/CalendarQalendar.vue index 33a4e60a7..088d78337 100644 --- a/frontend/src/components/CalendarQalendar.vue +++ b/frontend/src/components/CalendarQalendar.vue @@ -187,7 +187,7 @@ const calendarEvents = computed(() => { ? start.format(dateFormatStrings.qalendarFullDay) : start.format(dateFormatStrings.qalendar), end: event.all_day - ? end.format(dateFormatStrings.qalendarFullDay) + ? end.subtract(1, 'minute').format(dateFormatStrings.qalendarFullDay) : end.format(dateFormatStrings.qalendar), }, description: event.description,