Class CDateValidator
CDateValidator verifies if the attribute represents a date, time or datetime.
By setting the CDateValidator::$format
property, one can specify what format the date
value must be in. If the given date value doesn't follow the format, the
attribute is considered as invalid.
- CComponent
- CValidator
- CDateValidator
Copyright: 2008-2013 Yii Software LLC
License: http://www.yiiframework.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Version: $Id: CDateValidator.php 2799 2011-01-01 19:31:13Z qiang.xue $
Since: 1.1.7
Located at x2engine/framework/validators/CDateValidator.php
protected
|
#
validateAttribute(
Validates the attribute of the object. If there is any error, the error message is added to the object. |
addError(),
applyTo(),
clientValidateAttribute(),
createValidator(),
isEmpty(),
validate()
|
public
mixed
|
$format | 'MM/dd/yyyy' |
#
the format pattern that the date value should follow. This can be either a
string or an array representing multiple formats. Defaults to 'MM/dd/yyyy'.
Please see |
public
boolean
|
$allowEmpty | true |
#
whether the attribute value can be null or empty. Defaults to true, meaning that if the attribute is empty, it is considered valid. |
public
string
|
$timestampAttribute |
|
#
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. |
$attributes,
$builtInValidators,
$enableClientValidation,
$except,
$message,
$on,
$safe,
$skipOnError
|