diff --git a/code/model/formfields/EditableDateField.php b/code/model/formfields/EditableDateField.php index 78400b9..a83e1e1 100755 --- a/code/model/formfields/EditableDateField.php +++ b/code/model/formfields/EditableDateField.php @@ -33,33 +33,14 @@ class EditableDateField extends EditableFormField { } /** - * Return the form field. + * Return the form field * - * @todo Make a jQuery safe form field. The current CalendarDropDown - * breaks on the front end. */ public function getFormField() { - // scripts for jquery date picker - Requirements::javascript(THIRDPARTY_DIR .'/jquery-ui/jquery.ui.core.js'); - Requirements::javascript(THIRDPARTY_DIR .'/jquery-ui/jquery.ui.datepicker.js'); - - $dateFormat = DateField_View_JQuery::convert_iso_to_jquery_format(i18n::get_date_format()); - - Requirements::customScript(<<getSetting('DefaultToToday')) ? date('d/m/Y') : $this->Default; - - return new DateField( $this->Name, $this->Title, $default); + $defaultValue = ($this->getSetting('DefaultToToday')) ? date('Y-m-d') : $this->Default; + $field = new DateField( $this->Name, $this->Title, $defaultValue); + $field->setConfig('showcalendar', true); + return $field; } /**