mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
"Fixing use of array('minuteInterval' => #);
Proper usage is array('interval' => #); but for backwards compatibility this fix has been added" git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6633 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
1d9a096376
commit
a138ae3d63
2 changed files with 7 additions and 1 deletions
|
@ -1347,7 +1347,7 @@ class FormHelper extends AppHelper {
|
|||
$elements = array('Day','Month','Year','Hour','Minute','Meridian');
|
||||
$attributes = array_merge(array('minYear' => null, 'maxYear' => null, 'separator' => '-'), (array)$attributes);
|
||||
if (isset($attributes['minuteInterval'])) {
|
||||
$selectMinuteAttr['interval'] = $attributes['minuteInterval'];
|
||||
$attributes['interval'] = $attributes['minuteInterval'];
|
||||
} else {
|
||||
$selectMinuteAttr['interval'] = 1;
|
||||
}
|
||||
|
|
|
@ -1170,6 +1170,12 @@ class FormHelperTest extends CakeTestCase {
|
|||
$this->assertNoPattern('/option value="59"/', $result);
|
||||
$this->assertNoPattern('/<option[^<>]+selected="selected"[^>]*>/', $result);
|
||||
|
||||
$result = $this->Form->dateTime('Contact.date', 'DMY', '12', '', array('minuteInterval' => 5));
|
||||
$this->assertPattern('/<option\s+value=""[^>]*>/', $result);
|
||||
$this->assertPattern('/option value="55"/', $result);
|
||||
$this->assertNoPattern('/option value="59"/', $result);
|
||||
$this->assertNoPattern('/<option[^<>]+selected="selected"[^>]*>/', $result);
|
||||
|
||||
$this->Form->data['Contact']['data'] = null;
|
||||
$result = $this->Form->dateTime('Contact.date', 'DMY', '12');
|
||||
$this->assertPattern('/<option\s+value=""[^>]*>/', $result);
|
||||
|
|
Loading…
Add table
Reference in a new issue