1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39:
<?php
class FormFieldConstraintDate extends FormFieldConstraintRegex
{
private static $regex = '`^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$`u';
public function __construct($error_message = '')
{
if (empty($error_message))
{
$error_message = LangLoader::get_message('form.doesnt_match_date_regex', 'status-messages-common');
}
$this->set_validation_error_message($error_message);
parent::__construct(
self::$regex,
self::$regex,
$error_message
);
}
public function get_url_checking_regex()
{
return self::$regex;
}
}
?>