Merge remote-tracking branch 'leo-naeka/master'

pull/86/merge
Johannes Raggam 2013-02-20 18:11:39 +01:00
commit 2ceffaa1ab
2 zmienionych plików z 7 dodań i 2 usunięć

Wyświetl plik

@ -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):

Wyświetl plik

@ -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')