diff --git a/backend/src/appointment/controller/calendar.py b/backend/src/appointment/controller/calendar.py index 4b981ed64..5cbce6521 100644 --- a/backend/src/appointment/controller/calendar.py +++ b/backend/src/appointment/controller/calendar.py @@ -319,12 +319,17 @@ 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() + 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=not isinstance(start, datetime), tentative=tentative, description=e.icalendar_component["description"] if "description" in e.icalendar_component else "", )