# HG changeset patch # User Paul Boddie # Date 1439155469 -7200 # Node ID 806c54989b5672a344b061713474505bf0ab1736 # Parent cb98880e024feda4c52dfa282d332cbb8b449657 Fixed the recognition of objects providing periods beyond a specified datetime. diff -r cb98880e024f -r 806c54989b56 imiptools/data.py --- a/imiptools/data.py Sun Aug 09 22:57:29 2015 +0200 +++ b/imiptools/data.py Sun Aug 09 23:24:29 2015 +0200 @@ -332,16 +332,20 @@ rrule = self.get_value("RRULE") parameters = rrule and get_parameters(rrule) until = parameters and parameters.get("UNTIL") + count = parameters and parameters.get("COUNT") - if not rrule: + # Non-recurring periods or constrained recurrences that are not found to + # lie beyond the specified datetime. + + if not rrule or until or count: return False - elif not until: + + # Unconstrained recurring periods will always lie beyond the specified + # datetime. + + else: return True - dtstart, dtstart_attr = self.get_datetime_item("DTSTART") - until = get_datetime(until, dtstart_attr) - return until > dt - # Modification methods. def set_datetime(self, name, dt, tzid=None):