Yii2 DatePicker jquery ui with style like bootstrap.
The preferred way to install this extension is through composer.
Either add
"require": {
"keygenqt/yii2-datepicker": "*"
},
of your composer.json
file.
View:
use keygenqt\datePicker\DatePicker;
<?= DatePicker::widget([
'model' => $model,
'attribute' => 'updated',
'language' => 'en-US',
'dateFormat' => 'php:d-M-Y',
'clientOptions' => [
'showOtherMonths' => true,
'selectOtherMonths' => true,
'dayNamesMin' => array('S', 'M', 'T', 'W', 'T', 'F', 'S')
]
]) ?>
View:
use keygenqt\datePicker\DatePicker;
<?= $form->field($model, 'date')->widget(DatePicker::className(), [
'placeholder' => 'Date',
'icon' => false,
'selectDay' => false,
'dateFormat' => 'php:F, Y'
]); ?>