rabib
(Rabib Sust)
January 11, 2015, 7:19am
1
Hello everyone, I am creating a form and using kartik-v date picker.
But facing this error.
Calling unknown method: kartik\widgets\DatePicker::set Language()
Here is my code:
echo '<label class="col-xs-4 col-sm-4 col-md-3 col-lg-3 control-label">Date Monitoring Performed:</label>';
echo DatePicker::widget([
'name' => 'date_sdv_performed',
'value' => date('d-M-Y'),
'options' => ['placeholder' => ' '],
'pluginOptions' => [
'format' => 'dd-M-yyyy',
'todayHighlight' => true
]
]);
Please help me.Thanks in advance.
ajberri
(Alex)
January 12, 2015, 3:04am
2
Do you have the following at the top of your script?
use kartik\date\DatePicker;
rabib
(Rabib Sust)
January 12, 2015, 12:36pm
3
Yes I have used
kartik\date\DatePicker;
but the problem may be with the vendor.I have updated my files through composer.json and now it is working.But I need a small help.Where can I modify the date picker size?As my date picker is getting this type of width.I have attached the screenshot.
Thanks again.
This is my code:
use kartik\widgets\DatePicker;
<?= $form->field($model, 'date_sdv_performed', [
'template' => "<label class='col-xs-4 col-sm-4 col-md-3 col-lg-3 control-label'>{label}</label><div class='col-xs-6 col-sm-7 col-md-5 col-lg-5'>{input}</div>\n{hint}\n{error}"
])->widget(DatePicker::classname(),[
'options' => ['placeholder' => ''],
'value' => date('d-M-Y'),
'type' => DatePicker::TYPE_COMPONENT_APPEND,
'readonly' => true,
'pluginOptions' => [
'autoclose'=>true,
'format' => 'mm/dd/yyyy',
'todayHighlight' => TRUE,
]
]);
?>