[FIX]: caldav: Importing calendar with timezone works perfect now
authorrpa (Open ERP) <rpa@tinyerp.com>
Fri, 6 Aug 2010 12:27:02 +0000 (17:57 +0530)
committerrpa (Open ERP) <rpa@tinyerp.com>
Fri, 6 Aug 2010 12:27:02 +0000 (17:57 +0530)
bzr revid: rpa@tinyerp.com-20100806122702-dy4t0atc6jnggrmt

addons/caldav/calendar.py

index 61dd3c2..42f7e83 100644 (file)
@@ -255,8 +255,10 @@ class CalDAV(object):
                 continue
             if cal_data.name.lower() == 'exdate':
                 exdates += cal_data.value
-                exval = map(lambda x: x.strftime('%Y%m%dT%H%M%S'), exdates)
-                self.ical_set(cal_data.name.lower(), ','.join(exval), 'value')
+                exvals = []
+                for exdate in exdates:
+                    exvals.append(datetime.fromtimestamp(time.mktime(exdate.utctimetuple())).strftime('%Y%m%dT%H%M%S'))
+                self.ical_set(cal_data.name.lower(), ','.join(exvals), 'value')
                 continue
             if cal_data.name.lower() in self.__attribute__:
                 if cal_data.params.get('X-VOBJ-ORIGINAL-TZID'):