From c34f9bffcb87950c3a54e4f3b2238d6d27ae5a67 Mon Sep 17 00:00:00 2001 From: Alexandre Boeglin <alex@nexedi.com> Date: Mon, 17 Dec 2007 14:27:14 +0000 Subject: [PATCH] Convert the date to the user provided timezone, also change the test to use another timezone than UTC. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18358 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/Document/Alarm.py | 3 +++ product/ERP5/tests/testAlarm.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/product/ERP5/Document/Alarm.py b/product/ERP5/Document/Alarm.py index 91ada0070b..410a47d52f 100644 --- a/product/ERP5/Document/Alarm.py +++ b/product/ERP5/Document/Alarm.py @@ -415,4 +415,7 @@ class Alarm(XMLObject, PeriodicityMixin): periodicity_start_date = self.getPeriodicityStartDate() if alarm_date < periodicity_start_date: alarm_date = periodicity_start_date + # convert the date to the user provided timezone + alarm_zone = periodicity_start_date.timezone() + alarm_date = alarm_date.toZone(alarm_zone) return alarm_date diff --git a/product/ERP5/tests/testAlarm.py b/product/ERP5/tests/testAlarm.py index e256c4eebf..e15c493782 100644 --- a/product/ERP5/tests/testAlarm.py +++ b/product/ERP5/tests/testAlarm.py @@ -58,7 +58,7 @@ class TestAlarm(ERP5TypeTestCase): quantity = 10 base_price = 0.7832 # year/month/day hour:minute:second - date_format = '%i/%i/%i %i:%i:%d UTC' + date_format = '%i/%i/%i %i:%i:%d GMT+0100' def getTitle(self): return "Alarm" -- 2.30.9