Author: chrisz
Date: Sun Jan 20 19:38:58 2008
New Revision: 4004
URL: http://trac.turbogears.org/changeset/4004

Log:
CalendarDatePicker did not use the default format.

Modified:
   branches/1.0/turbogears/widgets/big_widgets.py

Modified: branches/1.0/turbogears/widgets/big_widgets.py
==============================================================================
--- branches/1.0/turbogears/widgets/big_widgets.py      (original)
+++ branches/1.0/turbogears/widgets/big_widgets.py      Sun Jan 20 19:38:58 2008
@@ -41,25 +41,22 @@
     _default = None
 
     def __init__(self, name=None, default=None, not_empty=True,
-                 calendar_lang=None, validator=None, **kw):
+                 calendar_lang=None, validator=None, format=None, **kw):
         """
         Use a javascript calendar system to allow picking of calendar dates.
         The format is in mm/dd/yyyy unless otherwise specified
         """
-        # DBR start
-        format = kw.get('format')
-
         super(CalendarDatePicker, self).__init__(name, **kw)
         self.not_empty = not_empty
         if default is not None or not self.not_empty:
             self._default = default
+        if format is not None:
+            self.format = format
         if validator is None:
             self.validator = validators.DateTimeConverter(
-                format=format, not_empty=self.not_empty)
+                format=self.format, not_empty=self.not_empty)
         else:
             self.validator = validator
-
-        # DBR end
         lang_file_link = self.get_calendar_lang_file_link(calendar_lang)
         self.javascript=[JSLink(static, "calendar/calendar.js"),
                          JSLink(static, "calendar/calendar-setup.js"),

Reply via email to