【问题标题】:Silverstripe TimeField - Hide SecondsSilverstripe TimeField - 隐藏秒数
【发布时间】:2012-11-15 03:31:54
【问题描述】:

有没有办法在 silverstripe CMS 中的 TimeField 中隐藏秒数?

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

【问题讨论】:

    标签: silverstripe


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-01
      • 1970-01-01
      • 2020-07-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多