Jump to:

23471 Posts in 18937 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » DatePicker in GridField SS 3

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

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

Page: 1 2
Go to End
Author Topic: 1722 Views
  • Andy01
    Avatar
    Community Member
    3 Posts

    Re: DatePicker in GridField SS 3 Link to this post

    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

  • Optic Blaze
    Avatar
    Community Member
    162 Posts

    Re: DatePicker in GridField SS 3 Link to this post

    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;
       }
    }

    1722 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.