From 009d8e4e17429e239731468b7371d42d94fbb72c Mon Sep 17 00:00:00 2001 From: Peter Bieringer Date: Mon, 21 Jul 2025 19:41:04 +0200 Subject: [PATCH 1/3] fix for Expanded event with dates are missing VALUE=DATE --- radicale/app/report.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/radicale/app/report.py b/radicale/app/report.py index 8cb1e9b2..45828fd0 100644 --- a/radicale/app/report.py +++ b/radicale/app/report.py @@ -43,6 +43,9 @@ from radicale.app.base import Access, ApplicationBase from radicale.item import filter as radicale_filter from radicale.log import logger +DT_FORMAT_TIMESTAMP: str = '%Y%m%dT%H%M%SZ' +DT_FORMAT_DATE: str = '%Y%m%d' + def free_busy_report(base_prefix: str, path: str, xml_request: Optional[ET.Element], collection: storage.BaseCollection, encoding: str, @@ -362,13 +365,13 @@ def _expand( # override instances. vevent_recurrence, vevents_overridden = _split_overridden_vevents(vevent_component) - dt_format = '%Y%m%dT%H%M%SZ' + dt_format = DT_FORMAT_TIMESTAMP all_day_event = False if type(vevent_recurrence.dtstart.value) is datetime.date: # If an event comes to us with a dtstart specified as a date # then in the response we return the date, not datetime - dt_format = '%Y%m%d' + dt_format = DT_FORMAT_DATE all_day_event = True # In case of dates, we need to remove timezone information since # rruleset.between computes with datetimes without timezone information @@ -475,14 +478,19 @@ def _expand( value=recurrence_id, params={} ) _convert_to_utc(vevent, 'recurrence_id', dt_format) + suffix = '' + if (dt_format == DT_FORMAT_DATE): + suffix = ';VALUE=DATE' + else: + suffix = '' vevent.dtstart = ContentLine( - name='DTSTART', + name='DTSTART' + suffix, value=recurrence_id.strftime(dt_format), params={} ) # if there is a DTEND, override it. Duration does not need changing if hasattr(vevent, "dtend"): vevent.dtend = ContentLine( - name='DTEND', + name='DTEND' + suffix, value=(recurrence_id + duration).strftime(dt_format), params={} ) From 03bbc61e6e6760142be42ede9489a06b6450ef11 Mon Sep 17 00:00:00 2001 From: Peter Bieringer Date: Mon, 21 Jul 2025 19:41:54 +0200 Subject: [PATCH 2/3] changelog for https://github.com/Kozea/Radicale/issues/1827 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59e13e28..dad307e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ * Improve: add options [logging] trace_on_debug and trace_filter for supporting trace logging * Fix: catch case where getpwuid is not returning a username * Fix: add support for query without comp-type +* Fix: expanded event with dates are missing VALUE=DATE ## 3.5.4 * Improve: item filter enhanced for 3rd level supporting VALARM and honoring TRIGGER (offset or absolute) From 407d33b6231f5a07743ad1f45c94abeaa0ca3bde Mon Sep 17 00:00:00 2001 From: Peter Bieringer Date: Mon, 21 Jul 2025 19:43:38 +0200 Subject: [PATCH 3/3] replace 2x with DT_FORMAT_TIMESTAMP --- radicale/app/report.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radicale/app/report.py b/radicale/app/report.py index 45828fd0..fb54b5aa 100644 --- a/radicale/app/report.py +++ b/radicale/app/report.py @@ -298,10 +298,10 @@ def xml_report(base_prefix: str, path: str, xml_request: Optional[ET.Element], xmlutils.webdav_error("C:expand") start = datetime.datetime.strptime( - starts, '%Y%m%dT%H%M%SZ' + starts, DT_FORMAT_TIMESTAMP ).replace(tzinfo=datetime.timezone.utc) end = datetime.datetime.strptime( - ends, '%Y%m%dT%H%M%SZ' + ends, DT_FORMAT_TIMESTAMP ).replace(tzinfo=datetime.timezone.utc) time_range_start = None