<div class="datepicker-days" style="display:none"></div>
use \kartik\form\ActiveForm;
use \kartik\date\DatePicker;
$form = ActiveForm::begin([
'id' => 'profile-form',
'options' => ['class' => 'form-horizontal'],
'fieldConfig' => [
'template' => "{label}\n<div class=\"col-lg-9\">{input}</div>\n<div class=\"col-sm-offset-3 col-lg-9\">{error}\n{hint}</div>",
'labelOptions' => ['class' => 'col-lg-3 control-label'],
],
'enableAjaxValidation' => true,
'enableClientValidation' => false,
'validateOnBlur' => false,
]);
echo $form->field($model, 'date_1')->widget(DatePicker::classname(), [
'options' => ['placeholder' => 'Enter birth date ...'],
'pluginOptions' => [
'autoclose'=>true
]
]);
ActiveForm::end();
<?= $form->field($model, 'date')->widget(DateControl::className(),
['type' => DateControl::FORMAT_DATE]
) ?>
'datecontrol' => [
'class' => '\kartik\datecontrol\Module',
'displaySettings' => [
Module::FORMAT_DATE => 'd MMMM yyyy',
Module::FORMAT_TIME => 'hh:mm',
Module::FORMAT_DATETIME => 'dd-MM-yyyy hh:mm:ss a',
],
'autoWidgetSettings' => [
Module::FORMAT_DATE => ['pluginOptions' => [
'autoclose' => true,
'todayHighlight' => true,
'startDate' => 'current',
],
'readonly' => true],
Module::FORMAT_TIME => ['readonly' => true]
],
'saveSettings' => [
Module::FORMAT_DATE => 'php:U',
// Module::FORMAT_TIME => 'php:u'
],
'ajaxConversion' => false,
]