Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

DatePicker in GridField SS 3


Go to End


10 Posts   3923 Views

Avatar
Andy01

Community Member, 3 Posts

12 October 2012 at 4:49am

Hi Optic Blaze,
I have found the problem. It wasn'd the datatepicker. There was a problem with misspelling in an other field.
I had copied the code from a different page without a datepicker.

Thanks a lot..

Regards Andy

Avatar
Optic Blaze

Community Member, 190 Posts

12 October 2012 at 10:22am

Hi there,

Good to hear. I worked on the code... mine looks a bit different...but i checked it and it works:

<?php
class Termin extends DataObject {
static $db = array(
'FirstDate' => 'Date',
'DateRange' => 'Varchar',
'Description' => 'HTMLVarchar'
);

function getCMSFields() {

$fields = new FieldList(
$dateField = new DateField('FirstDate', 'FirstDate'),
new HTMLEditorField('Description','Beschreibung'),
new TextField('DateRange','Termin')
);
$dateField->setConfig('showcalendar', true);
$dateField->setConfig('dateformat','dd-MM-yyyy');

return $fields;
}
}

Go to Top