A
A
Alexander Sinitsyn2016-11-09 10:23:02
Yii
Alexander Sinitsyn, 2016-11-09 10:23:02

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

2 answer(s)
M
Maxim Timofeev, 2016-11-09
@a_u_sinitsin

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.

A
Alexander Sinitsyn, 2016-11-09
@a_u_sinitsin

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 question

Ask a Question

731 491 924 answers to any question