Yii jui date picker format

I am using the following code in my _form file for yii\jui\DatePicker, on date selection it is showing the date format properly. In gridview the data rendered is OK.

But when I open the record for update the format shown is yyyy-mm-dd, I want to show the same as dd-mm-yyyy




 <?= $form->field($model, 'birth_date')->widget(DatePicker::className(),

                    

                

                    [

                        'language' => 'en',

                        //'DateRange' => '-20',

                        //'yearRange' => 'c-25:c+0',

                        'clientOptions' =>[

                        'dateFormat' => 'd-m-yy',

                        'language' => 'US',

                        'country' => 'IN',

                        'showAnim'=>'fold',

                            'yearRange' => 'c-25:c+0',

                        'changeMonth'=> true,

                        'changeYear'=> true,

                        'autoSize'=>true,

                         'showOn'=> "button",

                         //'buttonImage'=> "images/calendar.gif",

                        'htmlOptions'=>[

                        'style'=>'width:80px;',

                        'font-weight'=>'x-small',

                        ],]]) ?> 

    



Thanks.

It’s a known issue.

I somehow able to render the date in d-M-yyyy format using this code in the controller:




 $model->birth_date=Yii::$app->formatter->asDate($model->birth_date, "d-M-yyyy");



That’s an interesting snippet, when I get time, I will play around with it.