php - preselected values in DateControl yii 2 -


i have 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                         ]                     ]                 ]); 

that works perfectly. can select date , time , send data controller save it.

the problem

when write same code in update form, values comming database not show in datecontrol field. empty.. have tried provide unix type datetime , normal string(24-jul-2015) doesn't show thing. 1 know how ?

other fields following seems working , being populated values database

<?= $form->field($model, 'price')->textinput() ?> 

i found answer kartik.

just add

saveformat=>'d-m-y' 

under displayformat or other formate of choice , display saved value.. simple :)


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -