validators\DateValidator parseDateValue()

parseDateValue() protected method Parses date string into UNIX timestamp protected integer|false parseDateValue ( $value )$value string String representing date return integer|false A UNIX timestamp or false on failure.

validators\DateValidator init()

init() public method Initializes the object. This method is invoked at the end of the constructor after the object is initialized with the given configuration. public void init ( )

validators\DateValidator $type

$type public property (available since version 2.0.8) The type of the validator. Indicates, whether a date, time or datetime value should be validated. This property influences the default value of $format and also sets the correct behavior when $format is one of the intl short formats, short, medium, long, or full. This is only effective when the PHP intl extension is installed. This property can be set to the following values: TYPE_DATE - (default) for validating date values only, that m

validators\DateValidator $tooSmall

$tooSmall public property (available since version 2.0.4) User-defined error message used when the value is smaller than $min. public string $tooSmall = null

validators\DateValidator $tooBig

$tooBig public property (available since version 2.0.4) User-defined error message used when the value is bigger than $max. public string $tooBig = null

validators\DateValidator $timeZone

$timeZone public property The timezone to use for parsing date and time values. This can be any value that may be passed to date_default_timezone_set() e.g. UTC, Europe/Berlin or America/Chicago. Refer to the php manual for available timezones. If this property is not set, yii\base\Application::$timeZone will be used. public string $timeZone = null

validators\DateValidator $timestampAttributeTimeZone

$timestampAttributeTimeZone public property (available since version 2.0.4) The timezone to use when populating the $timestampAttribute. Defaults to UTC. This can be any value that may be passed to date_default_timezone_set() e.g. UTC, Europe/Berlin or America/Chicago. Refer to the php manual for available timezones. If $timestampAttributeFormat is not set, this property will be ignored. See also $timestampAttributeFormat. public string $timestampAttributeTimeZone = 'UTC'

validators\DateValidator $timestampAttributeFormat

$timestampAttributeFormat public property (available since version 2.0.4) The format to use when populating the $timestampAttribute. The format can be specified in the same way as for $format. If not set, $timestampAttribute will receive a UNIX timestamp. If $timestampAttribute is not set, this property will be ignored. See also: $format $timestampAttribute public string $timestampAttributeFormat = null

validators\DateValidator $timestampAttribute

$timestampAttribute public property The name of the attribute to receive the parsing result. When this property is not null and the validation is successful, the named attribute will receive the parsing result. This can be the same attribute as the one being validated. If this is the case, the original value will be overwritten with the timestamp value after successful validation. Note, that when using this property, the input value will be converted to a unix timestamp, which by definition

validators\DateValidator $minString

$minString public property (available since version 2.0.4) User friendly value of lower limit to display in the error message. If this property is null, the value of $min will be used (before parsing). public string $minString = null