Permalink
Browse files

Fix up some limits that go funny when FormHelper starts using DateTime.

  • Loading branch information...
1 parent ab591ab commit 83a2b7dbda03e2183de1b199c20834eab1c0ff32 @markstory markstory committed Feb 22, 2014
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/View/Widget/DateTime.php
@@ -261,9 +261,10 @@ protected function _yearSelect($options = []) {
'options' => []
];
- $options['start'] = min($options['val'], $options['start']);
- $options['end'] = max($options['val'], $options['end']);
-
+ if (!empty($options['val'])) {
+ $options['start'] = min($options['val'], $options['start']);
+ $options['end'] = max($options['val'], $options['end']);
+ }
if (empty($options['options'])) {
$options['options'] = $this->_generateNumbers($options['start'], $options['end']);
}
@@ -382,6 +383,7 @@ protected function _minuteSelect($options = []) {
'leadingZeroKey' => true,
'leadingZeroValue' => true,
];
+ $options['interval'] = max($options['interval'], 1);
if (empty($options['options'])) {
$options['options'] = $this->_generateNumbers(0, 59, $options);
}

0 comments on commit 83a2b7d

Please sign in to comment.