FullCalendar doesn't display certain date

女生的网名这么多〃 提交于 2019-12-12 00:19:18

问题


I'm using fullCalendar and I've set the structure of visualization like this:

    $('#calendar').fullCalendar({
        'defaultView': 'agendaWeek',
        'height': BackendCalendar.getCalendarHeight(),
        'editable': true,
        'firstDay': 1,      //Lunedì
        'slotMinutes': 30,
        'snapMinutes': 15,
        'axisFormat': 'HH:mm',
        'timeFormat': 'HH:mm{ - HH:mm}',
        'allDayText': EALang['all_day'], 
        'columnFormat': 
        {
            'month': 'ddd',
            'week': 'ddd d/M',
            'day': 'dddd d/M'
        },
        'titleFormat': 
        {
            'month': 'MMMM yyyy',
            'week': "MMMM d[ yyyy]{ '—'[ MMM] d, yyyy}",
            'day': 'dddd, MMMM d, yyyy'
        },
        'header': {
            'left': 'prev,next today',
            'center': 'title',
            'right': 'agendaDay,agendaWeek,month'
        },

the problem's that when I load the page the date on the header is displayed bad:

Display for month

Display for week

Display for day

What am I doing wrong? I'm using the version 2.3.1, in the past I'm using the vesion 1.6.1 'cause easyappointment library have an old version. Now I've update the version and all is broken, why? I need perphaps to update some file, method?


回答1:


Must be capital Y:

'month': 'MMMM YYYY',

look here: http://fullcalendar.io/docs/text/titleFormat/

The time formats are according to moment.js: http://www.momentjs.com

I have compiled a working fiddle here: http://jsfiddle.net/fq7zwjq0/

Major changes:

The string "MMMM d[ yyyy]{ '—'[ MMM] d, yyyy}", is definetively disturbing moment and as the purpose isn't clear, I ave deleted the inner.

The language formatting can be easily set by 'lang': 'fr'

And make either everything uppercase or everything lowercase is way too simple, the placeholders are case sensitive tokens and mustbe set according to the moment.js documentation here: http://momentjs.com/docs/#/displaying/



来源:https://stackoverflow.com/questions/33236010/fullcalendar-doesnt-display-certain-date

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