Match time against all components
This commit is contained in:
parent
f5835cfe46
commit
f9d299fbb9
@ -289,7 +289,9 @@ def _visit_time_ranges(vobject_item, child_name, range_fn, infinity_fn):
|
||||
# if they are used.
|
||||
# TODO: Single recurrences can be overwritten by components with
|
||||
# RECURRENCE-ID (http://www.kanzaki.com/docs/ical/recurrenceId.html). They
|
||||
# are currently ignored but can change the start and end time.
|
||||
# may overwrite the start and end time. Currently these components and
|
||||
# the overwritten recurrences are both considered. The overwritten
|
||||
# recurrence should be ignored instead.
|
||||
|
||||
def getrruleset(child):
|
||||
try:
|
||||
@ -310,6 +312,7 @@ def _visit_time_ranges(vobject_item, child_name, range_fn, infinity_fn):
|
||||
|
||||
# Comments give the lines in the tables of the specification
|
||||
if child_name == "VEVENT":
|
||||
for child in vobject_item.vevent_list:
|
||||
# TODO: check if there's a timezone
|
||||
dtstart = child.dtstart.value
|
||||
|
||||
@ -360,6 +363,7 @@ def _visit_time_ranges(vobject_item, child_name, range_fn, infinity_fn):
|
||||
return
|
||||
|
||||
elif child_name == "VTODO":
|
||||
for child in vobject_item.vtodo_list:
|
||||
dtstart = getattr(child, "dtstart", None)
|
||||
duration = getattr(child, "duration", None)
|
||||
due = getattr(child, "due", None)
|
||||
@ -416,7 +420,8 @@ def _visit_time_ranges(vobject_item, child_name, range_fn, infinity_fn):
|
||||
# Line 2
|
||||
due = reference_date + timedelta(seconds=original_duration)
|
||||
if (range_fn(reference_date, due) or
|
||||
range_fn(reference_date, reference_date + SECOND) or
|
||||
range_fn(reference_date,
|
||||
reference_date + SECOND) or
|
||||
range_fn(due - SECOND, due) or
|
||||
range_fn(due - SECOND, reference_date + SECOND)):
|
||||
return
|
||||
@ -449,6 +454,7 @@ def _visit_time_ranges(vobject_item, child_name, range_fn, infinity_fn):
|
||||
return
|
||||
|
||||
elif child_name == "VJOURNAL":
|
||||
for child in vobject_item.vjournal_list:
|
||||
dtstart = getattr(child, "dtstart", None)
|
||||
|
||||
if dtstart is not None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user