我有一个项目用户jQuery fullcalendar-scheduler,我希望格式化时间以使用24小时。我有如下配置,但是没有用。我的代码有问题吗?

{
        now: moment().format('YYYY-MM-DD'),
        contentHeight: setUpHeight(),
        aspectRatio: 1.8,
        header: {
            left: 'today prev,next',
            center: 'title',
            right: 'timelineDay,timelineMonth'
        },
        timeFormat: 'H(:mm)',
        defaultView: 'timelineDay',
        resourceLabelText: 'Devices',
        resources: resources,
        events: schedules,
        eventRender: function (event, el) {
            el.qtip({
                content: {
                    delay: 1e3,
                    text: function () {
                        return $('#qtip-content-custom').html(event.description);
                    },
                },
                style: { classes: 'qtip__clases' },
                position: {
                    target: 'mouse',
                    adjust: { x: 7, y: 5 }
                },
            });
        }
}


结果仍然使用AM / PM,如下所示:

enter image description here

最佳答案

解决方案:只需添加views选项,如下所示:

views: {
  timelineDay: {
    slotLabelFormat: ['H:mm'],
  },
  timelineMonth: {
    slotLabelFormat: ['DD'],
  },
},

09-11 19:59