From 21e55e7c85fd9a072e6235f3169f8ce0a84bcac9 Mon Sep 17 00:00:00 2001 From: Tobias Brox Date: Sun, 7 Jun 2020 17:53:46 +0200 Subject: bugfix --- calendar-cli.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/calendar-cli.py b/calendar-cli.py index a140798..daf3866 100755 --- a/calendar-cli.py +++ b/calendar-cli.py @@ -504,11 +504,10 @@ def calendar_agenda(caldav_conn, args): dtstart = event.dtstart.value if hasattr(event, 'dtstart') else _now() if not isinstance(dtstart, datetime): dtstart = datetime(dtstart.year, dtstart.month, dtstart.day) - else: - if not dtstart.tzinfo: - dtstart = tzinfo.localize(dtstart) - ## convert into timezone given in args: - dtstart = dtstart.astimezone(_tz(args.timezone)) + if not dtstart.tzinfo: + dtstart = tzinfo.localize(dtstart) + ## convert into timezone given in args: + dtstart = dtstart.astimezone(_tz(args.timezone)) events.append({'dtstart': dtstart, 'instance': event}) ## changed to use the "key"-parameter at 2019-09-18, as needed for python3. -- cgit v1.2.3