mirror of
https://github.com/Respect/Validation.git
synced 2024-06-29 02:30:06 +02:00
Merge branch '1.0'
This commit is contained in:
commit
f3ad53dd14
|
@ -41,9 +41,8 @@ class Date extends AbstractRule
|
|||
$this->format = $exceptionalFormats[ $this->format ];
|
||||
}
|
||||
|
||||
$dateFromFormat = DateTime::createFromFormat($this->format, $input);
|
||||
$info = date_parse_from_format($this->format, $input);
|
||||
|
||||
return $dateFromFormat
|
||||
&& $input === $dateFromFormat->format($this->format);
|
||||
return ($info['error_count'] === 0 && $info['warning_count'] === 0);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -122,6 +122,11 @@ class DateTest extends \PHPUnit_Framework_TestCase
|
|||
public function providerForDateTimeTimezoneStrings()
|
||||
{
|
||||
return [
|
||||
['UTC', 'Ym', '202302'],
|
||||
['UTC', 'Ym', '202304'],
|
||||
['UTC', 'Ym', '202306'],
|
||||
['UTC', 'Ym', '202309'],
|
||||
['UTC', 'Ym', '202311'],
|
||||
['UTC', 'c', '2005-12-30T01:02:03+01:00'],
|
||||
['UTC', 'c', '2004-02-12T15:19:21+00:00'],
|
||||
['UTC', 'r', 'Thu, 29 Dec 2005 01:02:03 +0000'],
|
||||
|
|
Loading…
Reference in a new issue