Index: date.php =================================================================== RCS file: /repository/pear/HTML_QuickForm/QuickForm/date.php,v retrieving revision 1.56 diff -a -u -r1.56 date.php --- date.php 30 Aug 2005 10:45:01 -0000 1.56 +++ date.php 14 Nov 2005 13:53:29 -0000 @@ -59,6 +59,8 @@ * A => AM/PM * 'minYear': Minimum year in year select * 'maxYear': Maximum year in year select + * 'minMonth': First month in month select + * 'maxMonth': Last month in month select * 'addEmptyOption': Should an empty option be added to the top of * each select box? * 'emptyOptionValue': The value passed by the empty option. @@ -73,6 +75,8 @@ 'format' => 'dMY', 'minYear' => 2001, 'maxYear' => 2010, + 'minMonth' => 1, + 'maxMonth' => 12, 'addEmptyOption' => false, 'emptyOptionValue' => '', 'emptyOptionText' => ' ', @@ -313,14 +317,34 @@ $options = $locale['months_short']; array_unshift($options , ''); unset($options[0]); + for ($month = 0; $month <= 12; $month++) { + if ($month < min($this->_options['minMonth'], $this->_options['maxMonth']) || $month > max($this->_options['minMonth'], $this->_options['maxMonth'])) { + unset($options[$month]); + } + } + if ($this->_options['minMonth'] > $this->_options['maxMonth']) { + $options = array_reverse($options, true); + } break; case 'm': - $options = $this->_createOptionList(1, 12); + $options = $this->_createOptionList( + $this->_options['minMonth'], + $this->_options['maxMonth'], + $this->_options['minMonth'] > $this->_options['maxMonth'] ? -1 : 1 + ); break; case 'F': $options = $locale['months_long']; array_unshift($options , ''); unset($options[0]); + for ($month = 0; $month <= 12; $month++) { + if ($month < min($this->_options['minMonth'], $this->_options['maxMonth']) || $month > max($this->_options['minMonth'], $this->_options['maxMonth'])) { + unset($options[$month]); + } + } + if ($this->_options['minMonth'] > $this->_options['maxMonth']) { + $options = array_reverse($options, true); + } break; case 'Y': $options = $this->_createOptionList(