Hi Guys. I see the jui DatePicker widget was updated recently:
[color="#213F4D"][font="Helvetica, arial, freesans, clean, sans-serif,"][size="5"]chanded jui DatePicker widget to use ICU date format[/size][/font][/color]
[color="#333333"][font="Helvetica, arial, freesans, clean, sans-serif,"]- use default application formatting for the date value[/font][/color]
[color="#333333"][font="Helvetica, arial, freesans, clean, sans-serif,"]- auto adjust to application language and format setting changes[/font][/color]
[color="#333333"][font="Helvetica, arial, freesans, clean, sans-serif,"]- be consistent with formatter and date validator
[/font][/color]
[size="2"]So the problem is the widget seems to be reverting to defalut behavior, where the dateformat is set to:[/size]
[size="2"]MMM-d-y[/size]
[size="2"]which formats like this: Sep 20, 2012[/size]
[size="2"]I think it is MMM-d-y because I looked it up on[/size]
What I had before in my form:
<?php echo $form->field($model,'birthdate')->widget(DatePicker::className(),['clientOptions' => ['dateFormat' => 'yy-mm-dd']]); ?>
[size="2"]And this is what I had in my model in the rules method:[/size]
[size="2"]
[['birthdate'], 'date', 'format'=>'Y-m-d'],
[/size]
[size=“2”]That no longer works. Instead I get the MMM-d-y format in the form, no matter what I put in the widget. I tried adjusting my model rules to MMM-d-y, but that didn’t work either. I actually like that [/size][size=“2”]MMM-d-y [/size][size=“2”]format better. [/size]
[size=“2”]So I think I have 2 problems. I don’t know the correct syntax for formatting the date in the DatePicker widget and I don’t know the matching rule validation syntax. The DatePicker is really cool and was working great and I would love to continue to use it. Any help here would be appreciated, thanks.[/size]
[color="#213F4D"][font="Helvetica, arial, freesans, clean, sans-serif,"][size="5"][b]
[/b][/size][/font][/color]