diff roundup/cgi/templating.py @ 1453:b72f422d1e5e

better handling of format param
author Richard Jones <richard@users.sourceforge.net>
date Wed, 19 Feb 2003 23:32:50 +0000
parents d0c8bc8534ba
children a11e27d80737
line wrap: on
line diff
--- a/roundup/cgi/templating.py	Wed Feb 19 03:59:44 2003 +0000
+++ b/roundup/cgi/templating.py	Wed Feb 19 23:32:50 2003 +0000
@@ -988,7 +988,8 @@
             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 @@
             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.

Roundup Issue Tracker: http://roundup-tracker.org/