extends abstract class Phalcon\Validation\Validator
implements Phalcon\Validation\ValidatorInterface
Source on GitHub
Checks if a value is a valid date
use Phalcon\Validation\Validator\Date as DateValidator;
$validator->add('date', new DateValidator([
'format' => 'd-m-Y',
'message' => 'The date is invalid'
]));
$validator->add(['date','anotherDate'], new DateValidator([
'format' => [
'date' => 'd-m-Y',
'anotherDate' => 'Y-m-d'
],