function __construct($name, $title, $value = null, $yearRange = null) { $exploded = explode('-', $value); $year = isset($exploded[0]) ? $exploded[0] : null; $month = isset($exploded[1]) ? $exploded[1] : null; $date = isset($exploded[2]) ? $exploded[2] : null; $this->dateDropdown = new DropdownField($name . "[date]", "", array('NotSet' => '(' . _t('CompositeDateField.DAY', 'Day') . ')', '01' => '01', '02' => '02', '03' => '03', '04' => '04', '05' => '05', '06' => '06', '07' => '07', '08' => '08', '09' => '09', '10' => '10', '11' => '11', '12' => '12', '13' => '13', '14' => '14', '15' => '15', '16' => '16', '17' => '17', '18' => '18', '19' => '19', '20' => '20', '21' => '21', '22' => '22', '23' => '23', '24' => '24', '25' => '25', '26' => '26', '27' => '27', '28' => '28', '29' => '29', '30' => '30', '31' => '31'), $date); $this->monthDropdown = new DropdownField($name . "[month]", "", array('NotSet' => '(' . _t('CompositeDateField.MONTH', 'Month') . ')', '01' => '01', '02' => '02', '03' => '03', '04' => '04', '05' => '05', '06' => '06', '07' => '07', '08' => '08', '09' => '09', '10' => '10', '11' => '11', '12' => '12'), $month); if ($yearRange == null) { $this->customiseYearDropDown($name, "1995-2012", $year); } else { $this->customiseYearDropDown($name, $yearRange, $year); } parent::__construct($name, $title); }
function __construct($name, $title = null, $value = null, $form = null, $config = array()) { parent::__construct($name, $title, $value, $form); $this->setConfig("dmyfields", false); $this->setConfig("showcalendar", false); }
public function __construct($name, $title = null, $value = null) { $this->setFieldHolderTemplate('forms/BirthDateField'); parent::__construct($name, $title, $value); }
public function __construct($name, $title = null, $value = "") { $this->setConfig('dateformat', 'mm-dd-yyyy'); parent::__construct($name, $title, $value); }
public function __construct($name, $title = null, $value = null) { Config::inst()->update('DateField', 'default_config', self::$default_config); parent::__construct($name, $title, $value); }