FullCalendar, how do I change the date format?

好久不见. 提交于 2019-12-05 16:51:59

Check out this link

http://arshaw.com/fullcalendar/docs/text/titleFormat/

You can specify which view you want to edit through this (in your case the day view)

http://arshaw.com/fullcalendar/docs/views/View_Option_Hash/

So you would probably have something along the lines of

titleFormat: {

day: 'dddd, d MMM, yyyy'   //whatever date format you want here
} 

Sure, you can play with the titleFormat jsFiddle

$('#calendar').fullCalendar({
    titleFormat: {
        month: 'MMMM yyyy',
        week: "MMM d[ yyyy]{ '—'[ MMM] d yyyy}",
        day: 'MM/dd'
    },
nzn

As I have written elsewhere on SO you can use this undocumented config variable to make a general change for all appearances of date/month so you don't have to specify it per view:

dayOfMonthFormat: 'ddd DD/MM',

Fullcalender has a few utilities functions you can use. You can get at these after the calender has been loaded through the $.fullCalendar.formatDate(, 'dd/mm'). There are also a few others that are work a look.. http://arshaw.com/fullcalendar/docs/utilities/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!