Answer the question
In order to leave comments, you need to log in
Why can't the days be displayed in the kartik\date\DatePicker widget?
Can you please tell me why the calendar may not be displayed in the kartik\date\DatePicker widget? It looks like this on the page:
In the console:
<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();
Answer the question
In order to leave comments, you need to log in
Good evening.
Did you set up the widget, read about all kinds of settings on the official website?
Set better DateControl
In View:
<?= $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,
]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question