mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
parent
205bfb506f
commit
8bb6f8803c
2 changed files with 5 additions and 10 deletions
|
@ -5624,6 +5624,9 @@ class FormHelperTest extends CakeTestCase {
|
||||||
'/select',
|
'/select',
|
||||||
);
|
);
|
||||||
$this->assertTags($result, $expected);
|
$this->assertTags($result, $expected);
|
||||||
|
|
||||||
|
$result = $this->Form->year('published', array(), array(), array('empty' => false));
|
||||||
|
$this->assertContains('data[Contact][published][year]', $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2461,17 +2461,9 @@ class FormHelper extends AppHelper {
|
||||||
case 'year':
|
case 'year':
|
||||||
$current = intval(date('Y'));
|
$current = intval(date('Y'));
|
||||||
|
|
||||||
if (!isset($options['min'])) {
|
$min = !isset($options['min']) ? $current - 20 : (int)$options['min'];
|
||||||
$min = $current - 20;
|
$max = !isset($options['max']) ? $current + 20 : (int)$options['max'];
|
||||||
} else {
|
|
||||||
$min = $options['min'];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($options['max'])) {
|
|
||||||
$max = $current + 20;
|
|
||||||
} else {
|
|
||||||
$max = $options['max'];
|
|
||||||
}
|
|
||||||
if ($min > $max) {
|
if ($min > $max) {
|
||||||
list($min, $max) = array($max, $min);
|
list($min, $max) = array($max, $min);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue