Skip to content

Commit 48dba66

Browse files
author
Richard Jones
committed
merge from HEAD
1 parent 69a7f8a commit 48dba66

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Fixed:
1515
- fix redirect after instant registration (sf bug 1381676)
1616
- fix permission checks in cgi interface (sf bug 1289557)
1717
- fix permission check on RetireAction (sf bug 1407342)
18+
- timezone now applied to date for pretty-format (sf bug 1406861)
1819

1920

2021
2005-10-07 0.8.5

roundup/cgi/templating.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1522,17 +1522,22 @@ def pretty(self, format=_marker):
15221522
The format string is a standard python strftime format string.
15231523
Note that if the day is zero, and appears at the start of the
15241524
string, then it'll be stripped from the output. This is handy
1525-
for the situatin when a date only specifies a month and a year.
1525+
for the situation when a date only specifies a month and a year.
15261526
'''
15271527
if not self.is_view_ok():
15281528
return self._('[hidden]')
1529-
1529+
1530+
if self._offset is None:
1531+
offset = self._db.getUserTimezone()
1532+
else:
1533+
offset = self._offset
1534+
15301535
if not self._value:
15311536
return ''
15321537
elif format is not self._marker:
1533-
return self._value.pretty(format)
1538+
return self._value.local(offset).pretty(format)
15341539
else:
1535-
return self._value.pretty()
1540+
return self._value.local(offset).pretty()
15361541

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

0 commit comments

Comments
 (0)