changeset 3480:be5ea4095df7 maint-0.8

merge from HEAD
author Richard Jones <richard@users.sourceforge.net>
date Fri, 20 Jan 2006 02:45:23 +0000
parents 235f1cee5cf2
children e7215bd7045d
files CHANGES.txt roundup/cgi/templating.py
diffstat 2 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES.txt	Fri Jan 20 02:13:51 2006 +0000
+++ b/CHANGES.txt	Fri Jan 20 02:45:23 2006 +0000
@@ -15,6 +15,7 @@
 - fix redirect after instant registration (sf bug 1381676)
 - fix permission checks in cgi interface (sf bug 1289557)
 - fix permission check on RetireAction (sf bug 1407342)
+- timezone now applied to date for pretty-format (sf bug 1406861)
 
 
 2005-10-07 0.8.5
--- a/roundup/cgi/templating.py	Fri Jan 20 02:13:51 2006 +0000
+++ b/roundup/cgi/templating.py	Fri Jan 20 02:45:23 2006 +0000
@@ -1522,17 +1522,22 @@
             The format string is a standard python strftime format string.
             Note that if the day is zero, and appears at the start of the
             string, then it'll be stripped from the output. This is handy
-            for the situatin when a date only specifies a month and a year.
+            for the situation when a date only specifies a month and a year.
         '''
         if not self.is_view_ok():
             return self._('[hidden]')
-
+        
+        if self._offset is None:
+            offset = self._db.getUserTimezone()
+        else:
+            offset = self._offset
+        
         if not self._value:
             return ''
         elif format is not self._marker:
-            return self._value.pretty(format)
+            return self._value.local(offset).pretty(format)
         else:
-            return self._value.pretty()
+            return self._value.local(offset).pretty()
 
     def local(self, offset):
         ''' Return the date/time as a local (timezone offset) date/time.

Roundup Issue Tracker: http://roundup-tracker.org/