Which field type should be and what format should be written to work correctly from the jui DatePicker?

Seems to have tried all the options that he thought of and found online, but it's still be displayed and stored some turbidity.

Interested in the whole bunch of DB rules, DatePicker
July 2nd 19 at 18:19
2 answers
July 2nd 19 at 18:21
Solution
1. Our database store as You wish. The justification depends on the requests. If there is selection on weeks, etc. in date, if not, you can simply int (unix)
2. To convert to a widget before making the base in the photo above, it is possible through Yii::$app->formater, you can connect the component demos.krajee.com/datecontrol
3. DatePicker supports setting a date type.

Total to get started, decide how you will store in the database, then set the type of date in the widget, then if necessary add to the model beforeValidate, afterFind, etc.
July 2nd 19 at 18:23
Launched, but we've all the neck eversion
DB - date
rules ['birth_date', 'date', 'format' => 'php:Y-m-d'],
DatePicker - 'dateFormat' => 'yyyy-MM-dd',

Can somehow correct, and that the result did not depend on localization?

Find more questions by tags Yii