From 8bbb76a658f700dee3c28118e4a2f19057657380 Mon Sep 17 00:00:00 2001 From: Tobias Brox Date: Sun, 7 Jun 2020 17:45:11 +0200 Subject: 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 --- calendar-cli.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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): -- cgit v1.2.3