Skip to content

Commit

Permalink
Fix non-handling of caldav duration
Browse files Browse the repository at this point in the history
  • Loading branch information
MelissaAutumn committed May 13, 2024
1 parent 40db42b commit 080f39a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions backend/src/appointment/controller/calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 "",
)
Expand Down

0 comments on commit 080f39a

Please sign in to comment.