dungphanxuan / yii2-datetimepicker
Yii 2 widget for jQuery Timepicker Addon.
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 5
Type:yii2-extension
Requires
- php: >=5.4.0
- bower-asset/jqueryui-timepicker-addon: >=1.5.2
- yiisoft/yii2: *
- yiisoft/yii2-jui: *
Requires (Dev)
- phpunit/phpunit: 4.*
- scrutinizer/ocular: ~1.1
This package is not auto-updated.
Last update: 2024-12-25 09:34:06 UTC
README
Yii 2 widget for jQuery Timepicker Addon.
Installation
If you do not have Composer, you may install it by following the instructions at getcomposer.org.
You can then install this package using the following command:
php composer.phar require "janisto/yii2-timepicker" "*"
or add
"janisto/yii2-timepicker": "*"
to the require section of your application's composer.json
file.
Usage
See jQuery Timepicker options.
For example to use the timepicker with a yii\base\Model
:
echo TimePicker::widget([ //'language' => 'fi', 'model' => $model, 'attribute' => 'created_at', 'mode' => 'datetime', 'clientOptions'=>[ 'dateFormat' => 'yy-mm-dd', 'timeFormat' => 'HH:mm:ss', 'showSecond' => true, ] ]);
The following example will use the name property instead:
echo TimePicker::widget([ //'language' => 'fi', 'name' => 'from_time', 'value' => $value, 'mode' => 'time', ]);
You can also use this widget in an yii\widgets\ActiveForm
using the yii\widgets\ActiveField::widget()
method, for example like this:
echo $form->field($model, 'field')->widget(\janisto\timepicker\TimePicker::className(), [ //'language' => 'fi', 'mode' => 'datetime', 'clientOptions'=>[ 'dateFormat' => 'yy-mm-dd', 'timeFormat' => 'HH:mm:ss', 'showSecond' => true, ] ]);
Contributing
Please see CONTRIBUTING for details.
Credits
License
Public domain. Please see License File for more information.