From 9909454761cf1b0f2ecaac25c421b539a211c395 Mon Sep 17 00:00:00 2001 From: Unrud Date: Mon, 5 Oct 2020 15:33:32 +0200 Subject: [PATCH] Fix matching of date property --- radicale/item/filter.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/radicale/item/filter.py b/radicale/item/filter.py index 2d1d179..c3143db 100644 --- a/radicale/item/filter.py +++ b/radicale/item/filter.py @@ -410,9 +410,12 @@ def visit_time_ranges(vobject_item, child_name, range_fn, infinity_fn): # Match a property child = getattr(vobject_item, child_name.lower()) if isinstance(child, date): - range_fn(child, child + DAY, False) - elif isinstance(child, datetime): - range_fn(child, child + SECOND, False) + child_is_datetime = isinstance(child, datetime) + child = date_to_datetime(child) + if child_is_datetime: + range_fn(child, child + SECOND, False) + else: + range_fn(child, child + DAY, False) def text_match(vobject_item, filter_, child_name, ns, attrib_name=None):