summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Brox <tobias@redpill-linpro.com>2020-06-07 17:53:46 +0200
committerTobias Brox <tobias@redpill-linpro.com>2020-06-07 17:53:46 +0200
commit21e55e7c85fd9a072e6235f3169f8ce0a84bcac9 (patch)
tree142587af11886501b6b0e2044fea157140c04c5f
parentc044055375ee75fede2c391ed753f13f3c7e829b (diff)
downloadcalendar-cli-21e55e7c85fd9a072e6235f3169f8ce0a84bcac9.zip
bugfix
-rwxr-xr-xcalendar-cli.py9
1 files 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.