Skip to content

Commit e8709f2

Browse files
author
Richard Jones
committed
better handling of format param
1 parent d997fa1 commit e8709f2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

roundup/cgi/templating.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -988,15 +988,19 @@ def reldate(self, pretty=1):
988988
return interval.pretty()
989989
return str(interval)
990990

991-
def pretty(self, format='%d %B %Y'):
991+
_marker = []
992+
def pretty(self, format=_marker):
992993
''' Render the date in a pretty format (eg. month names, spaces).
993994
994995
The format string is a standard python strftime format string.
995996
Note that if the day is zero, and appears at the start of the
996997
string, then it'll be stripped from the output. This is handy
997998
for the situatin when a date only specifies a month and a year.
998999
'''
999-
return self._value.pretty()
1000+
if format is not self._marker:
1001+
return self._value.pretty(format)
1002+
else:
1003+
return self._value.pretty()
10001004

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

0 commit comments

Comments
 (0)