Fullcalendar : Duplicates on agendaWeek view

I'm trying to use FullCalendar v2.4.0 (with jQuery 1.10.2 and moment.js 2.1) in order to display events that are stored in a database. I'm using json to send events to FullCalendar.

I have some problems of duplicated events in the 'agendaWeek' view. Everything is working properly for the other views ('month', 'basicWeek', 'basicDay', 'agendaDay').

As i read on stackoverflow, I tried to remove the event source, to remove events,... but i'm still facing the problem.

Here's how the code looks like :

$('#calendar').fullCalendar({
    header: {
        left: 'prev,next,today',
        center: 'title',
        right: 'month,agendaWeek,agendaDay'
    },
    defaultDate: '<?=date("Y-m-d")?>',
    defaultView: 'agendaDay',
    timeFormat: 'HH:mm',
    displayEventEnd: true,
    events: {
        url: '/events_getlist_json.php',
        type: 'GET',
        cache: false,
        error: function() {
            alert('there was an error while fetching events!');
        },
        success: function(data) {
            $(data).each(function(index) {
                console.log( index + ": " + data[index].start );
            })
        }
    }
});

$(document).ready(function() {
    setTimeout(function(){
        $('#calendar').fullCalendar('render');
    }, 100);
});

The console log returns 2 events : "0: 2015-08-24T11:00:00" and "1: 2015-08-26T12:30:00" but i can see 4 of them on the calendar.

If you have any idea why duplicates happen in 'agendaWeek' view only, and how to remove them, it would be really nice to help. Thank you in advance.

edit : added version of the 3 scripts


This was worked out in the comment between the OP and I.

Fullcalendar 2.4.0 conflicts with momentjs 2.1 causing duplicate events to appear in the agendaWeek view. Upgrade to the latest momentsjs to fix the issue.

链接地址: http://www.djcxy.com/p/81226.html

上一篇: 如何选择列表视图以匹配Fullcalendar中的当前视图

下一篇: Fullcalendar:日程视图中的重复项