Mercurial > p > roundup > code
changeset 3479:86d6131847e8
timezone now applied to date for pretty-format [SF#1406861]
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Fri, 20 Jan 2006 02:44:30 +0000 |
| parents | 602bb26a9485 |
| children | 63890c29a4ac |
| files | CHANGES.txt roundup/cgi/templating.py |
| diffstat | 2 files changed, 11 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/CHANGES.txt Fri Jan 20 02:42:35 2006 +0000 +++ b/CHANGES.txt Fri Jan 20 02:44:30 2006 +0000 @@ -31,6 +31,8 @@ - HTTP authorization takes precedence over session cookie (sf bug 1396134) - enforce correct encoding of PostgreSQL backend (sf bug 1374235) - grouping/sorting on link to same class fixed (sf bug 1404930) +- timezone now applied to date for pretty-format (sf bug 1406861) + 2005-10-07 0.9.0b1 Feature:
--- a/roundup/cgi/templating.py Fri Jan 20 02:42:35 2006 +0000 +++ b/roundup/cgi/templating.py Fri Jan 20 02:44:30 2006 +0000 @@ -1528,17 +1528,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.
