UTC timezone should not be explicitly set in timestamp attributes

Quickfix for https://github.com/collective/icalendar/issues/335
pull/339/head
Tobias Brox 2021-11-17 16:30:11 +01:00
rodzic d6de71b828
commit 97e361309a
1 zmienionych plików z 3 dodań i 6 usunięć

Wyświetl plik

@ -305,12 +305,9 @@ class vDDDTypes(object):
if (isinstance(dt, datetime) or isinstance(dt, time))\
and getattr(dt, 'tzinfo', False):
tzinfo = dt.tzinfo
if tzinfo is not pytz.utc and\
(tzutc is None or not isinstance(tzinfo, tzutc)):
# set the timezone as a parameter to the property
tzid = tzid_from_dt(dt)
if tzid:
self.params.update({'TZID': tzid})
tzid = tzid_from_dt(dt)
if tzid != 'UTC':
self.params.update({'TZID': tzid})
self.dt = dt
def to_ical(self):