Answer the question
In order to leave comments, you need to log in
What type of field should be and what formats should be registered in order for DatePicker from jui to work correctly?
It seems that I have already tried all the options that I thought myself and found on the network, but some kind of dregs are still displayed and saved.
Interested in the whole bunch of DB, rules, DatePicker
Answer the question
In order to leave comments, you need to log in
1. Store in the database as you like. Validity depends on requests. If there are samples by weeks, etc. Then to date, if not, then you can just int (unix)
2. You can convert for the widget and before entering into the database in the model, you can use Yii::$app->formater, you can connect the demos.krajee.com/datecontrol
component
3 .DatePicker supports date type customization.
To begin with, decide how you will store it in the database, then set the date type in the widget, then, if necessary, add beforeValidate, afterFind, etc. to the model.
Launched, but in picker everything is topsy-turvy
DB - date
rules - ['birth_date', 'date', 'format' => 'php:Ymd'],
DatePicker - 'dateFormat' => 'yyyy-MM-dd',
Can I somehow fix it so that the result does not depend on localization?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question