Browse Source

Fix attributes extraction for datetime selects.

ADmad 11 years ago
parent
commit
92727116a3
1 changed files with 11 additions and 1 deletions
  1. 11 1
      src/View/Helper/FormHelper.php

+ 11 - 1
src/View/Helper/FormHelper.php

@@ -65,6 +65,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.
      *
      * @var array
@@ -1887,7 +1897,7 @@ class FormHelper extends Helper
 
         $attributes = array_diff_key(
             $options,
-            ['value' => null, 'empty' => null]
+            array_flip(array_merge($this->_datetimeOptions, ['value', 'empty']))
         );
         $options = $options + $off + [$keep => $attributes];