From 080f39ab98a7bdb52804a7167c959747bb1a8393 Mon Sep 17 00:00:00 2001 From: Melissa Autumn Date: Mon, 13 May 2024 09:00:54 -0700 Subject: [PATCH] Fix non-handling of caldav duration --- backend/src/appointment/controller/calendar.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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 "", )