Commit 6bef0e62 by Qiang Xue

Fixes #5169.

parent e7de579e
...@@ -105,9 +105,11 @@ This validator checks if the input value is a date, time or datetime in a proper ...@@ -105,9 +105,11 @@ This validator checks if the input value is a date, time or datetime in a proper
Optionally, it can convert the input value into a UNIX timestamp and store it in an attribute Optionally, it can convert the input value into a UNIX timestamp and store it in an attribute
specified via [[yii\validators\DateValidator::timestampAttribute|timestampAttribute]]. specified via [[yii\validators\DateValidator::timestampAttribute|timestampAttribute]].
- `format`: the date/time format that the value being validated should be in. Please refer to the - `format`: the date/time format that the value being validated should be in.
[PHP manual about date_create_from_format()](http://www.php.net/manual/en/datetime.createfromformat.php) This can be a date time pattern as described in the [ICU manual](http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax).
for details about specifying the format string. The default value is `'Y-m-d'`. Alternatively this can be a string prefixed with `php:` representing a format that can be recognized by the PHP
`Datetime` class. Please refer to <http://php.net/manual/en/datetime.createfromformat.php> on supported formats.
If this is not set, it will take the value of `Yii::$app->formatter->dateFormat`.
- `timestampAttribute`: the name of the attribute to which this validator may assign the UNIX timestamp - `timestampAttribute`: the name of the attribute to which this validator may assign the UNIX timestamp
converted from the input date/time. converted from the input date/time.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment