Implement date_format validation rule.
This commit is contained in:
@@ -758,6 +758,19 @@ class Validator {
|
||||
return (strtotime($value) > strtotime($parameters[0]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate the date conforms to a given format.
|
||||
*
|
||||
* @param string $attribute
|
||||
* @param mixed $value
|
||||
* @param array $parameters
|
||||
* @return bool
|
||||
*/
|
||||
protected function validate_date_format($attribute, $value, $parameters)
|
||||
{
|
||||
return date_create_from_format($parameters[0], $value) !== false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the proper error message for an attribute and rule.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user