This is a wrapper of the excellent JQuery timepicker widget by Frank Galinas
Should work in V1.1 and above, only tested in 1.1.7.
See the note below regarding jui themes.
Just like the date picker widget, include this in your view file where time input is required.
Unpack the attached zip file into your extensions directory.
$this->widget('application.extensions.jui_timepicker.JTimePicker', array( 'model'=>$model, 'attribute'=>'start_time', // additional javascript options for the date picker plugin 'options'=>array( 'showPeriod'=>true, ), 'htmlOptions'=>array('size'=>8,'maxlength'=>8 ), ));
It is very important that you are theming other widgets then you must theme this widget also. I suggest that you set this up in your config file. example:
'widgetFactory'=>array( 'widgets'=>array( 'CJuiAccordion'=>array( 'options'=>array( 'animated'=>'bounceslide', ), 'theme'=>'le-frog', 'themeUrl'=>'/themes/nfa/jui', ), 'CJuiButton'=>array( 'theme'=>'le-frog', 'themeUrl'=>'/themes/nfa/jui', ), 'CJuiDatePicker'=>array( 'theme'=>'le-frog', 'themeUrl'=>'/themes/nfa/jui', ), 'JTimePicker'=>array( 'theme'=>'le-frog', 'themeUrl'=>'/themes/nfa/jui', ), 'CGridView'=>array( 'cssFile'=>'/themes/nfa/gridview/styles.css', ), /* end of widgets */ ), ), //
Total 3 comments
There seems to be a bug in version 0.2.2 of the original JQuery component.
To solve, I've downloaded the latest version and replaced jquery.ui.timepicker.js with the latest.
To test, I've tried the following and it works:
Hope this helps someone.
Unfortunally this extension doesn't support multiple languages. You have to add a code like below:
Replace $js = "jQuery('#{$id}').timepicker($options);"; (line 146) in the function run() with the result of the new function.
I've see the demo from the demo site. It's really cool..
Leave a comment
Please login to leave your comment.