Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #489 (closed defect: fixed)

Opened 13 years ago

Last modified 12 years ago

[PATCH] CalendarDatePicker widget not using the format to show the current value

Reported by: jpaulofarias at gmail dot com Owned by: anonymous
Priority: normal Milestone: 0.9
Component: TG Widgets Version:
Severity: normal Keywords:


Simple patch to make CalendarDatePicker? use the format attribute to show the current value when it loads the page.

Index: turbogears/widgets/base.py
--- turbogears/widgets/base.py	(revision 605)
+++ turbogears/widgets/base.py	(working copy)
@@ -534,7 +534,7 @@
                 JSLink(static, "calendar-setup.js")]
     template = """
     <div xmlns:py="http://purl.org/kid/ns#" py:strip="True">
-    <input type="text" id="${widget.name}" name="${widget.name}" value="${widget_value}"
+    <input type="text" id="${widget.name}" name="${widget.name}" value="${widget_value.strftime(widget.format)}"
         class="date_field ${' '.join(widget.css_classes)}" py:attrs="widget.attrs"/>
     <button id="${widget.name}-trigger" class="date_field_button">Choose</button>
     <script type="text/javascript">

Change History

comment:1 Changed 13 years ago by elvelind@…

  • Status changed from new to closed
  • Resolution set to fixed

fixed in r607

Note: See TracTickets for help on using tickets.