Fullcalendar.js 24-hour calendar

How can I change from am / pm format to 24 hours?

+3
source share
5 answers

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
});
+8
source

You must configure the property timeFormatin the calendar object.
http://arshaw.com/fullcalendar/docs/text/timeFormat/

+2
source

It works for me

timeFormat: {
   agenda: 'HH:mm{ - HH:mm}'
}
+1
source

I use this

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

You need to install axisFormat. See the following code:

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

Displayed in 24h format

0
source

Source: https://habr.com/ru/post/1777336/


All Articles