mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
parent
07f6803540
commit
6a05cad69f
2 changed files with 3 additions and 1 deletions
|
@ -429,7 +429,7 @@ class Validation extends Object {
|
|||
$_this =& Validation::getInstance();
|
||||
$_this->__reset();
|
||||
$_this->check = $check;
|
||||
$_this->regex = '%^((0?[1-9]|1[012])(:[0-5]\d){0,2}([AP]M|[ap]m))$|^([01]\d|2[0-3])(:[0-5]\d){0,2}$%';
|
||||
$_this->regex = '%^((0?[1-9]|1[012])(:[0-5]\d){0,2} ?([AP]M|[ap]m))$|^([01]\d|2[0-3])(:[0-5]\d){0,2}$%';
|
||||
return $_this->_check();
|
||||
}
|
||||
|
||||
|
|
|
@ -1509,6 +1509,8 @@ class ValidationTest extends CakeTestCase {
|
|||
$this->assertTrue(Validation::time('12:01am'));
|
||||
$this->assertTrue(Validation::time('12:01pm'));
|
||||
$this->assertTrue(Validation::time('1pm'));
|
||||
$this->assertTrue(Validation::time('1 pm'));
|
||||
$this->assertTrue(Validation::time('1 PM'));
|
||||
$this->assertTrue(Validation::time('01:00'));
|
||||
$this->assertFalse(Validation::time('1:00'));
|
||||
$this->assertTrue(Validation::time('1:00pm'));
|
||||
|
|
Loading…
Add table
Reference in a new issue