Silverstripe TimeField - Hide seconds

Is there a way to hide seconds from TimeField in 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; } 
+4
source share
1 answer

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

+6
source

Source: https://habr.com/ru/post/1446128/


All Articles