Reputation: 441
How do I change from am/pm to 24 hour time format?
Upvotes: 3
Views: 11267
Reputation: 1131
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
Upvotes: 0
Reputation: 260
I use this
$('#calendar').fullCalendar({
events: [
{
//pull from my database the events
}
// other events here...
],
timeFormat: 'H(:mm)'
});
Upvotes: 1
Reputation: 46756
You have to customize the timeFormat
property on the calendar object.
http://arshaw.com/fullcalendar/docs/text/timeFormat/
Upvotes: 2
Reputation: 441
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
});
Upvotes: 9