kopia lustrzana https://github.com/collective/icalendar
Merge remote-tracking branch 'leo-naeka/master'
commit
2ceffaa1ab
|
@ -433,8 +433,9 @@ class vDDDTypes:
|
|||
tzinfo = dt.tzinfo
|
||||
if tzinfo is not pytz.utc and not isinstance(tzinfo, tzutc):
|
||||
# set the timezone as a parameter to the property
|
||||
tzid = dt.tzinfo.zone
|
||||
self.params.update({'TZID': tzid})
|
||||
tzid = tzinfo_from_dt(dt)
|
||||
if tzid:
|
||||
self.params.update({'TZID': tzid})
|
||||
self.dt = dt
|
||||
|
||||
def to_ical(self):
|
||||
|
|
|
@ -109,8 +109,12 @@ class TestTimezoned(unittest.TestCase):
|
|||
# references: #73,7430b66862346fe3a6a100ab25e35a8711446717
|
||||
|
||||
date = dateutil.parser.parse('2012-08-30T22:41:00Z')
|
||||
date2 = dateutil.parser.parse('2012-08-30T22:41:00 +02:00')
|
||||
self.assertTrue(date.tzinfo.__module__ == 'dateutil.tz')
|
||||
self.assertTrue(date2.tzinfo.__module__ == 'dateutil.tz')
|
||||
|
||||
# make sure, it's parsed properly and doesn't throw an error
|
||||
self.assertTrue(icalendar.vDDDTypes(date).to_ical()
|
||||
== '20120830T224100Z')
|
||||
self.assertTrue(icalendar.vDDDTypes(date2).to_ical()
|
||||
== '20120830T224100')
|
||||
|
|
Ładowanie…
Reference in New Issue