Skip to content

Commit

Permalink
meridian function
Browse files Browse the repository at this point in the history
  • Loading branch information
thatcode authored and markstory committed Oct 30, 2010
1 parent 6d97aed commit a876c77
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions cake/libs/view/helpers/form.php
Expand Up @@ -1711,15 +1711,14 @@ function __dateTimeSelected($select, $fieldName, $attributes) {
* that string is displayed as the empty element.
*
* @param string $fieldName Prefix name for the SELECT element
* @param string $selected Option which is selected.
* @param string $attributes Array of Attributes
* @param bool $showEmpty Show/Hide an empty option
* @return string Completed meridian select input
* @access public
* @link http://book.cakephp.org/view/1422/meridian
*/
public function meridian($fieldName, $selected = null, $attributes = array()) {
$attributes += array('empty' => true, 'value' => $selected);
public function meridian($fieldName, $attributes = array()) {
$attributes += array('empty' => true, 'value' => null);
if ((empty($attributes['value']) || $attributes['value'] === true) && $value = $this->value($fieldName)) {
if (is_array($value)) {
extract($value);
Expand Down Expand Up @@ -1907,9 +1906,10 @@ public function dateTime($fieldName, $dateFormat = 'DMY', $timeFormat = '12', $s
case '12':
$selectHourAttr['value'] = $hour;
$selectMinuteAttr['value'] = $min;
$selectMeridianAttr['value'] = $meridian;
$opt .= $this->hour($fieldName, false, $selectHourAttr) . ':' .
$this->minute($fieldName, $selectMinuteAttr) . ' ' .
$this->meridian($fieldName, $meridian, $selectMeridianAttr);
$this->meridian($fieldName, $selectMeridianAttr);
break;
default:
$opt .= '';
Expand Down
2 changes: 1 addition & 1 deletion cake/tests/cases/libs/view/helpers/form.test.php
Expand Up @@ -3901,7 +3901,7 @@ function testDateTime() {
date('a', $now),
'/option',
'*/select'
);
);
$this->assertTags($result, $expected);

$result = $this->Form->dateTime('Contact.date', 'DMY', '12');
Expand Down

0 comments on commit a876c77

Please sign in to comment.