开发者

fullcalendar.js 24 hour calendar

How do I change from am/pm to 24 hou开发者_如何学编程r time format?


Change h(:mm)tt and /h:mm{ - h:mm} to H in fullcalendar.js

setDefaults({
    allDaySlot: true,
    allDayText: 'all-day',
    firstHour: 6,
    slotMinutes: 30,
    defaultEventMinutes: 120,
    axisFormat: 'H', //,'h(:mm)tt',
    timeFormat: {
        agenda: 'H' //h:mm{ - h:mm}'
    },
    dragOpacity: {
        agenda: .5
    },
    minTime: 0,
    maxTime: 24
});


You have to customize the timeFormat property on the calendar object.
http://arshaw.com/fullcalendar/docs/text/timeFormat/


It works for me

timeFormat: {
   agenda: 'HH:mm{ - HH:mm}'
}


I use this

$('#calendar').fullCalendar({
events: [
    {
        //pull from my database the events
    }
    // other events here...
],
timeFormat: 'H(:mm)'
});


You need to set axisFormat. See the following code:

<p:schedule value="#{scheduleView.lazyEventModel}" timeFormat="HH:mm" axisFormat="HH:mm"/>

It displays in 24h format

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜