brussens/yii2-datetimepicker-widget Bootstrap 3 DateTimePicker widget for Yii2.

extensionwidgetdatetimepickerdatepickertimepicker

Bootstrap 3 DateTime Picker widget for Yii2

Latest Stable Version Total Downloads License

Install

Either run

php composer.phar require --prefer-dist brussens/yii2-datetimepicker-widget "*"

or add

"brussens/yii2-datetimepicker-widget": "*"

to the require section of your composer.json file.

Options

Base usage:

use brussens\datetimepicker\Widget as DateTimePicker;

echo $form->field($model, 'attribute')->widget(DateTimePicker::className());

Advanced usage

use brussens\datetimepicker\Widget as DateTimePicker;

echo $form->field($model, 'attribute')->widget(DateTimePicker::className(), [
    'format'=>'DD-MM-YYYY HH:mm:ss',
    'clientOptions' => [
        'locale' => 'ru', //If you do not want to use auto-detection
        'icons' => [
            'time' => 'el-icon-time',
            'date' => 'el-icon-calendar',
            'up' => 'el-icon-chevron-up',
            'down' => 'el-icon-chevron-down',
        ],
        'useSeconds' => true,
        'useCurrent' => true,
        'sideBySide' => true
    ],
]);

Range usage (experimentally)

use yii\grid\GridView;
use brussens\datetimepicker\RangeWidget;

GridView::widget([
    'dataProvider' => $dataProvider,
    'filterModel' => $model,
    'columns' => [
        //... some columns
        [
            'filter' => RangeWidget::widget([
                'model' => $model,
                'attribute' => 'date_from',
                'attributeTo' => 'date_to'
            ]),
            'attribute' => 'created_at',
            'format' => 'datetime',
        ],
        ['class' => 'yii\grid\ActionColumn'],
    ],
]);

Profit

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



1.2.0 is the latest of 3 releases



MIT license
Stats
0 github stars & 2 github forks
9 downloads in the last day
111 downloads in the last 30 days
2453 total downloads