Preselected values ββin DateControl yii 2
I have the following code:
$form->field($model, 'start_time')->widget(DateControl::classname(), [
'type'=>DateControl::FORMAT_DATETIME,
'displayFormat' => 'php:d-M-Y H:i:s',
'ajaxConversion'=>true,
'options' => [
'pluginOptions' => [
'autoclose' => true
]
]
]);
works great. we can select the date and time and send the data to the controller to save it.
Problem
When I write this same code in the update form, the values ββthat come from the database are not shown in the datecontrol field. Its empty .. I tried to provide a unix type date and time and a regular string (24-Jul-2015), but that doesn't show anything. Does anyone know how to do this?
other fields like the following seem to work fine and populate with values ββfrom the database
<?= $form->field($model, 'price')->textInput() ?>
+3
source to share