"Adding fixes for Ticket #1785 hourOptionTag can never be empty

and Ticket #1792 dateTimeOptionTag hour is always set to 12 even if selected is null"

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4197 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2006-12-25 08:03:33 +00:00
parent 6776cc2e10
commit 14438cb151

View file

@ -898,7 +898,7 @@ class HtmlHelper extends AppHelper {
$hourValue = empty($selected) ? ($showEmpty ? NULL : date('H')) : $selected;
} else {
$hourValue = empty($selected) ? ($showEmpty ? NULL : date('g')) : $selected;
if (intval($hourValue) == 0 && !$showEmpty) {
if (isset($selected) && intval($hourValue) == 0 && !$showEmpty) {
$hourValue = 12;
}
}