1.1 --- a/imiptools/period.py Tue Apr 07 22:28:52 2015 +0200
1.2 +++ b/imiptools/period.py Tue Apr 07 22:30:06 2015 +0200
1.3 @@ -157,22 +157,23 @@
1.4 else:
1.5 i += 1
1.6
1.7 -def remove_affected_period(freebusy, uid, recurrenceid):
1.8 +def remove_affected_period(freebusy, uid, start):
1.9
1.10 """
1.11 Remove from 'freebusy' a period associated with 'uid' that provides an
1.12 - occurrence starting at the given 'recurrenceid', where the recurrence
1.13 - identifier is used to provide an alternative time period whilst also acting
1.14 - as a reference to the originally-defined occurrence.
1.15 + occurrence starting at the given 'start' (provided by a recurrence
1.16 + identifier, converted to a datetime). A recurrence identifier is used to
1.17 + provide an alternative time period whilst also acting as a reference to the
1.18 + originally-defined occurrence.
1.19 """
1.20
1.21 - found = bisect_left(freebusy, Period(recurrenceid))
1.22 + found = bisect_left(freebusy, Period(start))
1.23 while found < len(freebusy):
1.24 fb = freebusy[found]
1.25
1.26 # Stop looking if the start no longer matches the recurrence identifier.
1.27
1.28 - if fb.start != recurrenceid:
1.29 + if fb.start != start:
1.30 return
1.31
1.32 # If the period belongs to the parent object, remove it and return.