Skip to content

Commit

Permalink
Fix attributes extraction for datetime selects.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Feb 8, 2015
1 parent 40a6634 commit 9272711
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/View/Helper/FormHelper.php
Expand Up @@ -64,6 +64,16 @@ class FormHelper extends Helper
*/
protected $_datetimeParts = ['year', 'month', 'day', 'hour', 'minute', 'second', 'meridian'];

/**
* Special options used for datetime inputs.
*
* @var array
*/
protected $_datetimeOptions = [
'interval', 'round', 'monthNames', 'minYear', 'maxYear',
'orderYear', 'timeFormat', 'second'
];

/**
* Default config for the helper.
*
Expand Down Expand Up @@ -1887,7 +1897,7 @@ protected function _singleDatetime($options, $keep)

$attributes = array_diff_key(
$options,
['value' => null, 'empty' => null]
array_flip(array_merge($this->_datetimeOptions, ['value', 'empty']))
);
$options = $options + $off + [$keep => $attributes];

Expand Down

0 comments on commit 9272711

Please sign in to comment.