diff --git a/radicale/xmlutils.py b/radicale/xmlutils.py index c4c4f3e..20ea826 100644 --- a/radicale/xmlutils.py +++ b/radicale/xmlutils.py @@ -311,8 +311,7 @@ def _time_range_match(vobject_item, filter_, child_name): return True elif child_name == "VJOURNAL": - dtstart = getattr(child, "dstart", None) - + dtstart = getattr(child, "dtstart", None) if dtstart is not None: dtstart = dtstart.value if not isinstance(dtstart, datetime): @@ -322,7 +321,6 @@ 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/static/journal1.ics b/tests/static/journal1.ics index 5a1eeca..ab45833 100644 --- a/tests/static/journal1.ics +++ b/tests/static/journal1.ics @@ -8,16 +8,23 @@ BEGIN:DAYLIGHT TZOFFSETFROM:+0100 TZOFFSETTO:+0200 TZNAME:CEST -DTSTART:19700329T020000 +DTSTART:19700101T000000 RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3 END:DAYLIGHT BEGIN:STANDARD TZOFFSETFROM:+0200 TZOFFSETTO:+0100 TZNAME:CET -DTSTART:19701025T030000 +DTSTART:19700101T000000 RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10 END:STANDARD END:VTIMEZONE +BEGIN:VJOURNAL +UID:journal1 +DTSTAMP;TZID=Europe/Paris:19940817T000000 +SUMMARY:happy new year +DESCRIPTION: Happy new year 2000 ! +END:VJOURNAL + END:VCALENDAR diff --git a/tests/static/journal2.ics b/tests/static/journal2.ics index 5a1eeca..336499b 100644 --- a/tests/static/journal2.ics +++ b/tests/static/journal2.ics @@ -20,4 +20,12 @@ RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10 END:STANDARD END:VTIMEZONE +BEGIN:VJOURNAL +UID:journal2 +DTSTAMP:19950817T000000 +DTSTART;TZID=Europe/Paris:20000101T100000 +SUMMARY:happy new year +DESCRIPTION: Happy new year 2001 ! +END:VJOURNAL + END:VCALENDAR diff --git a/tests/static/journal3.ics b/tests/static/journal3.ics index 5a1eeca..a319d3a 100644 --- a/tests/static/journal3.ics +++ b/tests/static/journal3.ics @@ -20,4 +20,12 @@ RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10 END:STANDARD END:VTIMEZONE +BEGIN:VJOURNAL +UID:journal2 +DTSTAMP:19950817T000000 +DTSTART;VALUE=DATE:20000101 +SUMMARY:happy new year +DESCRIPTION: Happy new year 2001 ! +END:VJOURNAL + END:VCALENDAR diff --git a/tests/test_base.py b/tests/test_base.py index 11e84f3..61e01cf 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -370,7 +370,7 @@ class BaseRequests: assert "href>/calendar.ics/event3.ics/calendar.ics/event4.ics/calendar.ics/event5.ics @@ -401,7 +401,50 @@ class BaseRequests: #~ assert "href>/calendar.ics/todo7.ics/calendar.ics/todo8.ics + + + + """], "journal", events=3) + assert "href>/calendar.ics/journal1.ics/calendar.ics/journal2.ics/calendar.ics/journal3.ics + + + + """], "journal", events=3) + assert "href>/calendar.ics/journal1.ics/calendar.ics/journal2.ics/calendar.ics/journal3.ics + + + + """], "journal", events=3) + assert "href>/calendar.ics/journal1.ics/calendar.ics/journal2.ics/calendar.ics/journal3.ics + + + + """], "journal", events=3) + assert "href>/calendar.ics/journal1.ics/calendar.ics/journal2.ics/calendar.ics/journal3.ics