admin管理员组文章数量:1303640
I have a project user jQuery fullcalendar-scheduler, I want to format time to use 24 hour. I have config as below, but it didn't work. Is there something wrong with my code ??
{
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 }
},
});
}
}
And the result still use AM / PM, like this :
enter image description here
I have a project user jQuery fullcalendar-scheduler, I want to format time to use 24 hour. I have config as below, but it didn't work. Is there something wrong with my code ??
{
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 }
},
});
}
}
And the result still use AM / PM, like this :
enter image description here
Share Improve this question edited Feb 22, 2018 at 5:20 Jon P 19.8k8 gold badges51 silver badges76 bronze badges asked Feb 22, 2018 at 2:58 Aep SaepudinAep Saepudin 1111 silver badge7 bronze badges 1- 1 If an answer below has solved your question, please accept it by clicking the green arrow. If not, feel free to create your own answer to your question. Your question, however, should not also contain your resolution. – K.Dᴀᴠɪs Commented Feb 22, 2018 at 5:03
4 Answers
Reset to default 6SOLUTION: Just add views
option like this :
views: {
timelineDay: {
slotLabelFormat: ['H:mm'],
},
timelineMonth: {
slotLabelFormat: ['DD'],
},
},
Try slotLabelFormat
.
e.g.
slotLabelFormat: ['H:mm']
Change this :
timeFormat: 'H(:mm)',
by :
slotLabelFormat:"HH:mm",
version for 3.9.0 in fullcalender.js inside to globalDefaults :
maxTime: "24:00:00",
slotLabelFormat: ['H:mm'],
本文标签: javascriptChange Format Time AMPM to 24 hour Timeline Day fullcalendarStack Overflow
版权声明:本文标题:javascript - Change Format Time AMPM to 24 hour Timeline Day fullcalendar - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741771494a2396778.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论