From feb3daf25104f55e2a0f7b3e7a085fd381356f60 Mon Sep 17 00:00:00 2001 From: David Greaves Date: Thu, 3 Jul 2025 18:49:55 +0100 Subject: [PATCH] Find events which are in progress at the start of an expand range Signed-off-by: David Greaves --- radicale/app/report.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/radicale/app/report.py b/radicale/app/report.py index 334b6533..f1bfe73b 100644 --- a/radicale/app/report.py +++ b/radicale/app/report.py @@ -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)