Merge branch 'master' of github.com:Kozea/Radicale

This commit is contained in:
Cedric Boscher 2016-06-15 09:56:16 +02:00
commit 21ea648a44

View File

@ -250,7 +250,7 @@ def _time_range_match(vobject_item, filter_, child_name):
else: else:
# Line 5 # Line 5
return start < dtstart + timedelta(days=1) and end > dtstart return start < dtstart + timedelta(days=1) and end > dtstart
elif child_name == "VTODO": elif child_name == "VTODO":
# TODO: implement this # TODO: implement this
dtstart = getattr(child, "dtstart", None) dtstart = getattr(child, "dtstart", None)
duration = getattr(child, "duration", None) duration = getattr(child, "duration", None)
@ -307,8 +307,30 @@ def _time_range_match(vobject_item, filter_, child_name):
return True return True
elif child_name == "VJOURNAL": elif child_name == "VJOURNAL":
# TODO: implement this dtstart = getattr(child, "dstart", None)
pass
if dtstart is not None:
dtstart = dtstart.value
if not isinstance(dtstart, datetime):
dtstart_is_datetime = False
# TODO: changing dates to datetimes may be wrong because of tz
dtstart = datetime.combine(dtstart, datetime.min.time()).replace(
tzinfo=timezone.utc)
else:
dtstart_is_datetime = True
if dtstart_is_datetime:
# Line 1
return start <= dtstart and end > dtstart
else:
# Line 2
return start < dtstart + timedelta(days=1) and end > dtstart
else:
# Line 3
return False
return True return True