I have a datagrid allowing the user to add events to an event page.
On it, I have 2 date fields so they can specify a start and end date. These fields do not show the date picker unless I comment out a line from DateField.js in Sapphire/javascript (line 12 - if(!config.showcalendar) return;).
Is there anyway to get the date picker to show without tampering with the core?
<?php
class Event extends DataObject{
public static $db = array(
'Title' => 'Varchar(255)',
'StartDate' => 'Date',
'EndDate' => 'Date',
'Summary' => 'Text',
'Content' => 'HTMLText'
);
static $has_one = array(
'WhatsOnCategory' => 'WhatsOnCategory',
'EventImage' => 'Image'
);
public static $summary_fields = array(
'Title' => 'Title'
);
public static $default_sort='StartDate';
public function getCMSFields() {
return new FieldList(
new TextField('Title', 'Title'),
new DateField('StartDate', 'StartDate'),
new DateField('EndDate', 'EndDate'),
new TextField('Summary', 'Summary'),
new HTMLEditorField('Content', 'Content'),
new UploadField('EventImage','Image')
);
}
}