将格式时间 AM / PM 更改为 24 小时时间线日 fullcalendar

Change Format Time AM / PM to 24 hour Timeline Day fullcalendar

我有一个项目用户 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

尝试slotLabelFormat

例如

slotLabelFormat: ['H:mm']

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

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

改变这个:

timeFormat: 'H(:mm)',

作者:

slotLabelFormat:"HH:mm",

globalDefaults 中 fullcalender.js 中的 3.9.0 版本:

maxTime: "24:00:00",
slotLabelFormat: ['H:mm'],