summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Brox <tobias@redpill-linpro.com>2020-06-07 17:45:11 +0200
committerTobias Brox <tobias@redpill-linpro.com>2020-06-07 17:45:11 +0200
commit8bbb76a658f700dee3c28118e4a2f19057657380 (patch)
treed97a4213ba7a34deda0bf4d290950a26ceaf7e31
parentebc1bdf866561c8626a012792fef13e4a23187d7 (diff)
downloadcalendar-cli-8bbb76a658f700dee3c28118e4a2f19057657380.zip
workaround to get time zones in accordance with the RFC, ref https://github.com/collective/icalendar/issues/272#issuecomment-640204031, resolves https://github.com/tobixen/calendar-cli/issues/11
-rwxr-xr-xcalendar-cli.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/calendar-cli.py b/calendar-cli.py
index 37b6a32..ae5105c 100755
--- a/calendar-cli.py
+++ b/calendar-cli.py
@@ -371,7 +371,10 @@ def calendar_add(caldav_conn, args):
event.add(attr, val)
event.add('summary', ' '.join(args.summary))
cal.add_component(event)
- _calendar_addics(caldav_conn, cal.to_ical(), uid, args)
+ ## workaround for getting RFC-compliant ical data,
+ ## ref https://github.com/collective/icalendar/issues/272#issuecomment-640204031
+ ical_data = vobject.readOne(cal.to_ical().decode('utf-8')).serialize()
+ _calendar_addics(caldav_conn, ical_data, uid, args)
print("Added event with uid=%s" % uid)
def calendar_delete(caldav_conn, args):