public function MonthJumpForm() { $this->parseURL($this->getRequest()); $dummy = sfDate::getInstance($this->startDate); $range = range($dummy->subtractYear(3)->format('Y'), $dummy->addYear(6)->format('Y')); $year_map = array_combine($range, $range); $f = new Form($this, "MonthJumpForm", new FieldList($m = new DropdownField('Month', '', CalendarUtil::get_months_map('%B')), $y = new DropdownField('Year', '', $year_map)), new FieldList(new FormAction('doMonthJump', _t('Calendar.JUMP', 'Go')))); if ($this->startDate) { $m->setValue($this->startDate->format('m')); $y->setValue($this->startDate->format('Y')); } else { $m->setValue(date('m')); $y->setValue(date('Y')); } return $f; }