EJuiDateTimePicker is an extension of CJuiDatePicker. It extends the datepicker with the possibility to also set the time. Time is set using two sliders. The extension uses the datetimepicker addon developed by Trent Richardson.
Yii 1.1.4 or above
Unpack the code in protected/extensions
$this->widget('application.extensions.timepicker.EJuiDateTimePicker',array( 'model'=>$model, 'attribute'=>'calev_start', 'options'=>array( 'hourGrid' => 4, 'hourMin' => 9, 'hourMax' => 17, 'timeFormat' => 'h:m', 'changeMonth' => true, 'changeYear' => false, ), ));
Total 13 comments
If you want AM/PM option instead of 24hours, just put the option "ampm" like this example:
I can confirm that the flat option works. I'm using it.
But there is a problem when using the flat option. When you're not using it, the widget takes his data from the form field when you click in the field. When the flat option is used, the widget have to be set with either default values (current date and time) or by giving a value to the attribute.
The widget sets the date with no problem, but the time is still set at the current time, and not at the ont set in the attribute value.
Why ? Because the extension don't use the attribute value to set the time.
Here is what you see, starting at line 84 :
Here is the change I made so the widget can use the time set in the attribute :
This is probably not the better version of this, but it works.
Hi I have 2 EJuiDateTimePicker in a form start and end dates they both work fine I only have an issue when I go directly from one to the other, the 2nd doesn't open when I click done that works well or outside the input as well but from input 1 to input 2 , wont work has anybody else had this ? is there a solution ? or is it just my use case ?
wow nice tool, i'm playing with it for a while.. pretty good :) hours only, minutes only, only the timepart, many variations anyone want help uv to help!
great job
you may need to install some css http://jqueryui.com/download
jerome nicholas programmer/analyst http://shalomsoftware.com.au
Seems that "flat" option doesn't work here
This extension made my day.
Thanks a lot for the plugin. I spent some time for customizing, and now, in a short time, I have a very powerful functionality. If somebody tries to find the way, how to display date and time format according to locale, here is how I made it:
in the view:
and in config/main.php:
Hi,
registerCssFile and registerScriptFile should be in the condition if we plan to use CWidgetFactory:
The date/time picker works well. Glad you chose to extend the existing DatePicker. Chose this extension over the other timepicker ext for that reason.
Cheers
This one is a nice extension...
It works. Sorry I forgot to add rules for the field date in my model object.
Now, its perfect, this extension Rulez ;)
2 srigi:
Add
js:before function not to convert it into option. And see CJavaScript.encode() source & docs.If you want to set format see additional options in official addon site: http://trentrichardson.com/examples/timepicker/
Once again posting about callbacks. @mbetel thank for link. But there is some problem I cannot go around. Lets have this code:
As you can see, I got my callback function form of string. This wrong, cos it leads to JS code, where callback is also in form of string.
What I need, is direct definition of callback function.
But I canno figure how to write this on PHP side. Direct writing of function definition leads in syntax error on PHP side. Any ideas?
Leave a comment
Please login to leave your comment.