24 hour time format (so no AM to PM) for fullCalendar

后端 未结 13 1285
日久生厌
日久生厌 2020-12-25 12:09

I\'m trying to display the 24 hour time format in fullCalendar, I\'m trying to use these instructions: http://arshaw.com/fullcalendar/docs/text/timeFormat/

So I\'ve

13条回答
  •  感情败类
    2020-12-25 12:45

    For some reason these solutions didn’t worked for me anymore.

    So after some extensive (cmd+F) search I found this post talking about /includes/js/main.js around line 107. Line 107 lets you change the day/month/year order.

    But then! Line 113 (or around) lets you change am/pm, in week and day agenda view, into a time representation which is used by the whole world (except some English speaking countries).

    You can change more if you like, but below you'll find the piece code that was good enough for me to have it shown correctly on a Dutch website.

    TT:function(a){return a.getHours()<12?"AM":"PM"},u:function(a){return Oa(a,"yyyy-MM-dd'T'HH:mm:ss'Z'")},S:function(a){a=a.getDate();if(a>10&&a<20)return"th";return["st","nd","rd"][a%10-1]||"th"}};Aa.applyAll=$a;Ja.month=mc;Ja.basicWeek=nc;Ja.basicDay=oc;wb({weekMode:"fixed"});Ja.agendaWeek=qc;Ja.agendaDay=rc;wb({allDaySlot:true,allDayText:"hele dag",firstHour:8,slotMinutes:30,defaultEventMinutes:120,axisFormat:"HH:mm",timeFormat:{agenda:"h:mm{ - h:mm}"},dragOpacity:{agenda:0.5},minTime:0, maxTime:22})}) And for your convenience you'll find here the whole main.js fixed for Dutch: http://pastebin.com/HYGHRebZ

    I hope this solution will work also for you!

提交回复
热议问题