From 6bda730c617d51b427da8e505a36b18267fba45a Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 7 Jul 2019 18:16:52 +0200 Subject: [PATCH] Fixed timezone awareness adder --- Calendar/CalendarInterface.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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