diff --git a/radicale/xmlutils.py b/radicale/xmlutils.py
index 20ea826b..c4c4f3e8 100644
--- a/radicale/xmlutils.py
+++ b/radicale/xmlutils.py
@@ -311,7 +311,8 @@ def _time_range_match(vobject_item, filter_, child_name):
return True
elif child_name == "VJOURNAL":
- dtstart = getattr(child, "dtstart", None)
+ dtstart = getattr(child, "dstart", None)
+
if dtstart is not None:
dtstart = dtstart.value
if not isinstance(dtstart, datetime):
@@ -321,6 +322,7 @@ def _time_range_match(vobject_item, filter_, child_name):
.replace(tzinfo=timezone.utc))
else:
dtstart_is_datetime = True
+
if dtstart_is_datetime:
# Line 1
return start <= dtstart and end > dtstart
diff --git a/tests/test_base.py b/tests/test_base.py
index c79398dc..b5b3170c 100644
--- a/tests/test_base.py
+++ b/tests/test_base.py
@@ -407,7 +407,7 @@ class BaseRequests:
- """],"todo", events=1)
+ """],"todo", events=8)
assert "href>/calendar.ics/todo2.ics" not in answer
answer = self._test_filter(["""
@@ -415,7 +415,7 @@ class BaseRequests:
- """],"todo", events=1)
+ """],"todo", events=8)
assert "href>/calendar.ics/todo2.ics" not in answer
answer = self._test_filter(["""
@@ -423,16 +423,27 @@ class BaseRequests:
- """],"todo", events=1)
+ """],"todo", events=8)
assert "href>/calendar.ics/todo3.ics" not in answer
answer = self._test_filter(["""
-
+
- """],"todo", events=1)
- assert "href>/calendar.ics/todo3.ics" not in answer
+ """],"todo", events=8)
+ assert "href>/calendar.ics/todo7.ics" in answer
+
+
+ answer = self._test_filter(["""
+
+
+
+
+ """], "journal", events=3)
+ assert "href>/calendar.ics/journal1.ics" not in answer
+ assert "href>/calendar.ics/journal2.ics" in answer
+ assert "href>/calendar.ics/journal3.ics" in answer
answer = self._test_filter(["""