diff --git a/Calendar/CalendarInterface.py b/Calendar/CalendarInterface.py index 6f42cec..90dc030 100644 --- a/Calendar/CalendarInterface.py +++ b/Calendar/CalendarInterface.py @@ -135,10 +135,10 @@ class CalendarInterface (DataSourceInterface): until_index = rrule.index("UNTIL") tz_index = until_index + len(until_template) - if tz_index < 0 or tz_index >= len(rrule): + if until_index < 0 or (tz_index < len(rrule) and rrule[tz_index] is "T"): return rrule - if rrule[tz_index] is "T": - return rrule - - return rrule[:tz_index] + timezone_str + rrule[tz_index:] \ No newline at end of file + if tz_index == len(rrule): + return rrule + timezone_str + else: + return rrule[:tz_index] + timezone_str + rrule[tz_index:] \ No newline at end of file