4

Is there a way to hide seconds from the TimeField in the silverstripe CMS?

static $db = array (        

        'StartTime' => 'Time',
        'EndTime' => 'Time',

    );

public function getCMSFields() {
        $f = new FieldList(
            new TimeField('StartTime', _t('CalendarDateTime.STARTTIME','Start time')),
            new TimeField('EndTime', _t('CalendarDateTime.ENDTIME','End time')),
        return $f;
    }
Fraser
  • 14,036
  • 22
  • 73
  • 118

1 Answers1

6

$myTimeField->setConfig('timeformat', 'HH:mm'); - see TimeField API docs.

Ingo Schommer
  • 716
  • 4
  • 5