Hi all,
I am new to Yii framework and found something very strange so I came here for some help!
[b]Installed Version: Yii2
Environment: XAMPP with MAC OSX[/b]
I was developing a form with datepicker, and I installed the yii\jui\DatePicker trying to make a birthday field with datepicker.
The code I am using is like this:
$form->field($model,'birthday')->widget(DatePicker::className(),['clientOptions' => ['dateFormat' => 'yy-mm-dd', 'defaultDate' => '2014-01-01']]);
There is no error or exception occured but it looks wrong, the dateFormat and the defaultDate is totally different from what I expected.
Attachment 1: when I use form to update a record, the dateformat is incorrect
Attachment 2: and when I use form to create a record, the defaultdate is also incorrect
I tried to add a datepicker without using ActiveForm, then the dateFormat showed correctly.
I really don’t know why, is there anything incompatible between ActiveForm and DatePicker?
PS there is also a slight difference (the left padding/margin) between the default datepicker and my generated one. I don’t know why that happens.
Attachment 3: a default standard datepicker I found from the internet
Please, any one help me, this bug drives me crazy!