summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Brox <tobias@redpill-linpro.com>2021-09-28 09:00:20 +0200
committerTobias Brox <tobias@redpill-linpro.com>2021-09-28 09:00:20 +0200
commit91836fddfaf82f854f4a9cb94e28a903eb2e0fa2 (patch)
tree037dd007b5fe46bdf8082429a73c5cac515bded4
parent301138ff8c7e76569b4f81d1f6cb94458328d41f (diff)
downloadcalendar-cli-91836fddfaf82f854f4a9cb94e28a903eb2e0fa2.zip
possible fix for https://github.com/tobixen/calendar-cli/issues/85
-rwxr-xr-xcalendar-cli.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/calendar-cli.py b/calendar-cli.py
index 72cb3a1..ec5993f 100755
--- a/calendar-cli.py
+++ b/calendar-cli.py
@@ -531,7 +531,9 @@ def calendar_agenda(caldav_conn, args):
if hasattr(event['instance'], timeattr):
event[timeattr] = getattr(event['instance'], timeattr).value
if hasattr(event[timeattr], 'strftime'):
- event[timeattr] = event[timeattr].astimezone(_tz(args.timezone)).strftime(args.timestamp_format)
+ if hasattr(event[timeattr], 'astimezone'):
+ event[timeattr] = event[timeattr].astimezone(_tz(args.timezone))
+ event[timeattr] = event[timeattr].strftime(args.timestamp_format)
else:
event[timeattr] = '-'
for textattr in vcal_txt_one: