1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-08-07 18:30:54 +00:00

Find events which are in progress at the start of an expand range

Signed-off-by: David Greaves <david@dgreaves.com>
This commit is contained in:
David Greaves 2025-07-03 18:49:55 +01:00
parent 24b91e9569
commit feb3daf251

View file

@ -375,7 +375,19 @@ def _expand(
filtered_vevents = []
if rruleset:
# This function uses datetimes internally without timezone info for dates
recurrences = rruleset.between(start, end, inc=True)
# A vobject rruleset is for the event dtstart.
# Expanded over a given time range this will not include
# events which started before the time range but are still
# ongoing at the start of the range
# To accomodate this, reduce the start time by the duration of
# the event. If this introduces an extra reccurence point then
# that event should be included as it is still ongoing. If no
# extra point is generated then it was a no-op.
rstart = start - duration if duration else start
recurrences = rruleset.between(rstart, end, inc=True)
_strip_component(vevent_component)
_strip_single_event(vevent_recurrence, dt_format)