[widget] allow to specify hour/minute separator on the JQueryTimePicker (vgodard patch) stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 09 Mar 2010 11:27:41 +0100
branchstable
changeset 4846 a2fb82770fa6
parent 4842 3653e09024a1
child 4852 1693d6174251
child 4854 b06d2a3b27d9
[widget] allow to specify hour/minute separator on the JQueryTimePicker (vgodard patch)
web/formwidgets.py
--- a/web/formwidgets.py	Tue Mar 09 10:59:50 2010 +0100
+++ b/web/formwidgets.py	Tue Mar 09 11:27:41 2010 +0100
@@ -456,16 +456,17 @@
     needs_js = ('jquery.timePicker.js',)
     needs_css = ('jquery.timepicker.css',)
 
-    def __init__(self, timestr=None, timesteps=30, **kwargs):
+    def __init__(self, timestr=None, timesteps=30, separator=u':', **kwargs):
         super(JQueryTimePicker, self).__init__(**kwargs)
         self.timestr = timestr
         self.timesteps = timesteps
+        self.separator = separator
 
     def _render(self, form, field, renderer):
         req = form._cw
         domid = field.dom_id(form, self.suffix)
-        req.add_onload(u'jqNode("%s").timePicker({selectedTime: "%s", step: %s})' % (
-            domid, self.timestr, self.timesteps))
+        req.add_onload(u'jqNode("%s").timePicker({selectedTime: "%s", step: %s, separator: "%s"}})' % (
+            domid, self.timestr, self.timesteps, self.separator))
         if self.timestr is None:
             value = self.values(form, field)[0]
         else: