Skip to content

Commit 0b1a998

Browse files
author
Richard Jones
committed
timezone now applied to date for pretty-format [SF#1406861]
1 parent b2008c2 commit 0b1a998

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ Fixed:
3131
- HTTP authorization takes precedence over session cookie (sf bug 1396134)
3232
- enforce correct encoding of PostgreSQL backend (sf bug 1374235)
3333
- grouping/sorting on link to same class fixed (sf bug 1404930)
34+
- timezone now applied to date for pretty-format (sf bug 1406861)
35+
3436

3537
2005-10-07 0.9.0b1
3638
Feature:

roundup/cgi/templating.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,17 +1528,22 @@ def pretty(self, format=_marker):
15281528
The format string is a standard python strftime format string.
15291529
Note that if the day is zero, and appears at the start of the
15301530
string, then it'll be stripped from the output. This is handy
1531-
for the situatin when a date only specifies a month and a year.
1531+
for the situation when a date only specifies a month and a year.
15321532
'''
15331533
if not self.is_view_ok():
15341534
return self._('[hidden]')
1535-
1535+
1536+
if self._offset is None:
1537+
offset = self._db.getUserTimezone()
1538+
else:
1539+
offset = self._offset
1540+
15361541
if not self._value:
15371542
return ''
15381543
elif format is not self._marker:
1539-
return self._value.pretty(format)
1544+
return self._value.local(offset).pretty(format)
15401545
else:
1541-
return self._value.pretty()
1546+
return self._value.local(offset).pretty()
15421547

15431548
def local(self, offset):
15441549
''' Return the date/time as a local (timezone offset) date/time.

0 commit comments

Comments
 (0)