mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 19:38:26 +00:00
Adding fix for Ticket #2326
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4835 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
aed74550fb
commit
f1678686a4
1 changed files with 10 additions and 8 deletions
|
@ -471,13 +471,13 @@ class FormHelper extends AppHelper {
|
||||||
$out = $before . $out . $between . $this->select($tagName, $list, $selected, $options, $empty);
|
$out = $before . $out . $between . $this->select($tagName, $list, $selected, $options, $empty);
|
||||||
break;
|
break;
|
||||||
case 'time':
|
case 'time':
|
||||||
$out = $before . $out . $between . $this->dateTime($tagName, null, '12', $selected, array(), $empty);
|
$out = $before . $out . $between . $this->dateTime($tagName, null, '12', $selected, $options, $empty);
|
||||||
break;
|
break;
|
||||||
case 'date':
|
case 'date':
|
||||||
$out = $before . $out . $between . $this->dateTime($tagName, 'MDY', null, $selected, array(), $empty);
|
$out = $before . $out . $between . $this->dateTime($tagName, 'MDY', null, $selected, $options, $empty);
|
||||||
break;
|
break;
|
||||||
case 'datetime':
|
case 'datetime':
|
||||||
$out = $before . $out . $between . $this->dateTime($tagName, 'MDY', '12', $selected, array(), $empty);
|
$out = $before . $out . $between . $this->dateTime($tagName, 'MDY', '12', $selected, $options, $empty);
|
||||||
break;
|
break;
|
||||||
case 'textarea':
|
case 'textarea':
|
||||||
default:
|
default:
|
||||||
|
@ -894,22 +894,24 @@ class FormHelper extends AppHelper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$attributes = am(array('minYear' => null, 'maxYear' => null), $attributes);
|
||||||
|
|
||||||
switch($dateFormat) {
|
switch($dateFormat) {
|
||||||
case 'DMY': // so uses the new selex
|
case 'DMY': // so uses the new selex
|
||||||
$opt = $this->day($tagName, $day, $selectDayAttr, $showEmpty) . '-' .
|
$opt = $this->day($tagName, $day, $selectDayAttr, $showEmpty) . '-' .
|
||||||
$this->month($tagName, $month, $selectMonthAttr, $showEmpty) . '-' . $this->year($tagName, null, null, $year, $selectYearAttr, $showEmpty);
|
$this->month($tagName, $month, $selectMonthAttr, $showEmpty) . '-' . $this->year($tagName, $attributes['minYear'], $attributes['maxYear'], $year, $selectYearAttr, $showEmpty);
|
||||||
break;
|
break;
|
||||||
case 'MDY':
|
case 'MDY':
|
||||||
$opt = $this->month($tagName, $month, $selectMonthAttr, $showEmpty) . '-' .
|
$opt = $this->month($tagName, $month, $selectMonthAttr, $showEmpty) . '-' .
|
||||||
$this->day($tagName, $day, $selectDayAttr, $showEmpty) . '-' . $this->year($tagName, null, null, $year, $selectYearAttr, $showEmpty);
|
$this->day($tagName, $day, $selectDayAttr, $showEmpty) . '-' . $this->year($tagName, $attributes['minYear'], $attributes['maxYear'], $year, $selectYearAttr, $showEmpty);
|
||||||
break;
|
break;
|
||||||
case 'YMD':
|
case 'YMD':
|
||||||
$opt = $this->year($tagName, null, null, $year, $selectYearAttr, $showEmpty) . '-' .
|
$opt = $this->year($tagName, $attributes['minYear'], $attributes['maxYear'], $year, $selectYearAttr, $showEmpty) . '-' .
|
||||||
$this->month($tagName, $month, $selectMonthAttr, $showEmpty) . '-' .
|
$this->month($tagName, $month, $selectMonthAttr, $showEmpty) . '-' .
|
||||||
$this->day($tagName, $day, $selectDayAttr, $showEmpty);
|
$this->day($tagName, $day, $selectDayAttr, $showEmpty);
|
||||||
break;
|
break;
|
||||||
case 'Y':
|
case 'Y':
|
||||||
$opt = $this->year($tagName, null, null, $selected, $selectYearAttr, $showEmpty);
|
$opt = $this->year($tagName, $attributes['minYear'], $attributes['maxYear'], $selected, $selectYearAttr, $showEmpty);
|
||||||
break;
|
break;
|
||||||
case 'NONE':
|
case 'NONE':
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue