Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Correcting FormHelper::minute() to fix issues with extracting values …

…from array formatted data. Fixes #107
  • Loading branch information...
commit 3eaff3e0212746278be372b6d9c168546977d043 1 parent 1e7e650
@markstory markstory authored
View
2  cake/libs/view/helpers/form.php
@@ -1507,7 +1507,7 @@ function hour($fieldName, $format24Hours = false, $selected = null, $attributes
*/
function minute($fieldName, $selected = null, $attributes = array()) {
$attributes += array('empty' => true);
- $selected = $this->__dateTimeSelected('minute', $fieldName, $selected, $attributes);
+ $selected = $this->__dateTimeSelected('min', $fieldName, $selected, $attributes);
if (strlen($selected) > 2) {
$selected = date('i', strtotime($selected));
View
13 cake/tests/cases/libs/view/helpers/form.test.php
@@ -3978,6 +3978,19 @@ function testDateTime() {
$this->assertPattern('/<option[^<>]+value="03"[^<>]+selected="selected"[^>]*>3<\/option>/', $result);
$this->assertPattern('/<option[^<>]+value="13"[^<>]+selected="selected"[^>]*>13<\/option>/', $result);
$this->assertPattern('/<option[^<>]+value="35"[^<>]+selected="selected"[^>]*>35<\/option>/', $result);
+
+ $this->assertNoErrors();
+ $this->Form->data['Contact'] = array(
+ 'date' => array(
+ 'day' => '',
+ 'month' => '',
+ 'year' => '',
+ 'hour' => '',
+ 'min' => '',
+ 'meridian' => ''
+ )
+ );
+ $result = $this->Form->dateTime('Contact.date', 'DMY', '12', null, array('empty' => false));
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.