From d9d7ba61b6fb7bd8bf223dd91b9d57ad6ac2ae22 Mon Sep 17 00:00:00 2001 From: richard Date: Wed, 19 Feb 2003 23:32:50 +0000 Subject: [PATCH] better handling of format param git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1531 57a73879-2fb5-44c3-a270-3262357dd7e2 --- roundup/cgi/templating.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/roundup/cgi/templating.py b/roundup/cgi/templating.py index ffb5fc1..c2ec5d0 100644 --- a/roundup/cgi/templating.py +++ b/roundup/cgi/templating.py @@ -988,7 +988,8 @@ class DateHTMLProperty(HTMLProperty): return interval.pretty() return str(interval) - def pretty(self, format='%d %B %Y'): + _marker = [] + def pretty(self, format=_marker): ''' Render the date in a pretty format (eg. month names, spaces). The format string is a standard python strftime format string. @@ -996,7 +997,10 @@ class DateHTMLProperty(HTMLProperty): 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. ''' - return self._value.pretty() + if format is not self._marker: + return self._value.pretty(format) + else: + return self._value.pretty() def local(self, offset): ''' Return the date/time as a local (timezone offset) date/time. -- 2.30.2