Skip to content

Commit fc5159f

Browse files
author
Richard Jones
committed
fixed args to some date templating methods
1 parent 920c4e7 commit fc5159f

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ are given with the most recent entry first.
1414
tracker name
1515
- fixed error in indexargs_url (thanks Patrick Ohly)
1616
- fixed getnode (sf bug 684531)
17+
- fixed args to some date templating methods (sf bug 689670)
1718

1819

1920
2003-01-24 0.5.5

roundup/cgi/templating.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -916,21 +916,25 @@ def reldate(self, pretty=1):
916916
return interval.pretty()
917917
return str(interval)
918918

919-
def pretty(self, format='%d %B %Y'):
919+
_marker = []
920+
def pretty(self, format=_marker):
920921
''' Render the date in a pretty format (eg. month names, spaces).
921922
922923
The format string is a standard python strftime format string.
923924
Note that if the day is zero, and appears at the start of the
924925
string, then it'll be stripped from the output. This is handy
925926
for the situatin when a date only specifies a month and a year.
926927
'''
927-
return self._value.pretty()
928+
if format is not self._marker:
929+
return self._value.pretty(format)
930+
else:
931+
return self._value.pretty()
928932

929933
def local(self, offset):
930934
''' Return the date/time as a local (timezone offset) date/time.
931935
'''
932936
return DateHTMLProperty(self._client, self._nodeid, self._prop,
933-
self._name, self._value.local())
937+
self._name, self._value.local(offset))
934938

935939
class IntervalHTMLProperty(HTMLProperty):
936940
def plain(self):

0 commit comments

Comments
 (0)