public function getCMSFields() { $fields = parent::getCMSFields(); $eventTypeSource = EventType::get()->map()->toArray(); $countrySource = Country::get()->map()->toArray(); $fields->addFieldsToTab('Root.Main', array(TextField::create('LocationName', 'Location Name'), TextareaField::create('LocationAddress', 'Location Address'), $startDate = DatetimeField::create('StartTime', 'Start'), $endDate = DatetimeField::create('EndTime', 'End'), TextareaField::create('Price', 'Price'), DropdownField::create('EventTypeID', 'Type', $eventTypeSource), DropdownField::create('CountryID', 'Country', $countrySource), UploadField::create('Image', 'Image'))); $date = Date('Y-m-d', time()); $time = Date('H:i:s', time()); $startDate->getDateField()->setConfig('showcalendar', true); $startDate->getDateField()->setValue($date); $startDate->getTimeField()->setValue($time); $endDate->getDateField()->setConfig('showcalendar', true); $endDate->getDateField()->setValue($date); $endDate->getTimeField()->setValue($time); return $fields; }