yii2 dateFormat in datepicker option not working

I tried to format the date when I select date on datepicker

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

         ['clientOptions' => ['dateFormat' => 'yy-mm-dd',]



but it did not format it always show like this

I don’t know what’s wrong on this,but I followed what the guides says on how to format.

Thank you in advance.

It’s a known issue, see this post.

Thank you for the quick reply.

CEBE said.

where I will put this code

['myDate', 'date', 'timestampAttribute' => 'myDate']

I think it works now.

I tried @qiang suggested.

Thank you.