Simple datetimepicker, updated. Based on http://trentrichardson.com/examples/timepicker/
See the following code example in view:
$this->widget('widgets.timepicker.timepicker', array( 'model'=>$model, 'name'=>'publicated', ));
default options
$default = array( 'dateFormat'=>'yy-mm-dd', 'timeFormat'=>'hh:mm:ss', 'showOn'=>'button', 'showSecond'=>false, 'changeMonth'=>false, 'changeYear'=>false, 'tabularLevel'=>null, );
Total 20 comments
Is is possible to use the widget with parameter "name" set to array? Or without $model?
I would like to generate dynamically a set of timepickers of unknown quantity.
or
Please update example code.
Thanks ianare
i changed it like this , to meet my need.. attribute as an array
class timepicker, add
default view,
change the name :
init like so :
in a for loop with $i
This is a great extension, however Trent Richardson's time picker has been updated several times since the version in the extension and has now reached version 1.0.1 This may fix many of the minor interface bugs from the original version 0.95-dev (iirc). Here is a related thread.
Any chance that Tigo might read this and be able to release an update?
How can I set htmlOptions for the form input? Such as size?
Like GSTAR said in his comment (No 'class="error"'?), the timepicker doesn't populate 'error' class when related field/attribute is invalid. This means timepicker textfield's color won't turn red when it is invalid. To solve this without modifying the extension itself, I just change form.css file a little:
Note: This approach only works if you have label that is adjacent to the timepicker like:
If you include multiple instances you will run into javascript errors complaining about a stack overflow. Fix is mensioned here but not in the GIT repo yet: http://trentrichardson.com/2011/07/29/many-updates-to-timepicker/comment-page-1/#comment-33005
@plugin: It does the job, but should be updated to be used for CForm ($attribute property missing) and lacks commmenting. Author, maybe take a look at the CJuiDatePicker and extend that one?
When I use this wiget, on bottom of page exist empty rectangle. After open timepicker he is disappear. How do I fix it?
i use gii crud to genereate form.
i want to replace text field for date field with your calendar.
so you need to do (my model is Activiy)
Ok, it's done.
The problem was a "non-refreshing asset". My script wasn't published. Now it's working well.
It's possible to contact with the creator of that extension via email?
Thank you.
Hi,
I've downloaded jquery.ui.datepicker-es.js form http://jquery-ui.googlecode.com/svn/trunk/ui/i18n/ but it's imposible. Well, I have done some changes: *in my /protected/config/main.php
*in timepicker/timepicker.php i've tried a lot of thing (with language variable, and so), finally i have this line:
Just before
(By the way, I traced Yii::App()->language and it's setted correctly)
What am i doing bad? If I do the next changes in timepicker.php
It works fine (in russian, obviously) Similar results with
or
But it doesn't work with
(to do this test I've tried to rename jquery.ui.datepicker-es.js to jquery.ui.datepicker.es.js, and nothing.
I'm stuck, any idea?
Thx so much
Got this problem trying to use it ( extracted in extrension folder ):
Alias "widgets.timepicker.timepicker" is invalid. Make sure it points to an existing directory or file.
What have I to do?
I have a problem when I want to use 'timepicker' as 'datepicker' only.
When I add showTimepicker=>false to the options, the display is ok, but the input field is not filled with date.
It works, when I add a long list to the options. Is there a simple solution for this problem?
If not, it would be nice to add a 'dateOnly' public property.
This works for me. Maybe the list can be shorter ;-)
Using your extension and it works great, but I needed tabular form support.
Here are the modifications :
class timepicker, add
default view, change the name :
init like so :
Thanks for the extension, saved me the burden of doing it ;-)
I have tested your updated timepicker. It works better with language support.
It would be nice to add direct language support in the widget too. Please add the following code to your extension:
Here is the code for jquery.ui.timepicker.de.js:
I got it... Thanks man! Keep posting valuable extensions... Maybe next time I can create mine! :)
Try to change publish func, like this (change path to yours)
or clean assets folder in webapp
Actually.. I did it already and still the same..
I'm just thinking that it is because of the cache in yii or my browser? Do you know how to clear the cache in yii..
I'm so stupid..
You may replace ui.datepicker-ru.js by http://jquery-ui.googlecode.com/svn/trunk/ui/i18n/jquery.ui.datepicker-en-GB.js and
and in assets/js/timepicker.js
Leave a comment
Please login to leave your comment.