fullcalendar incorrect event end date after eventResize

后端 未结 3 1584
无人及你
无人及你 2020-12-21 19:34

After resize an event, it returns an incorrect end date.. I don\'t understand why..

I\'m using this code:

$(\'#calendar\').fullCalendar({
    header:         


        
3条回答
  •  囚心锁ツ
    2020-12-21 20:05

    I've create a Plunker where you can see how the update is made.

    It's important that, when you modify an event, the object you are modifying is the object that comes from fullCalendar('clientEvents');

    Something like this will fail:

        myEvent = {
            id: 1, title : "myTitle", start: moment()
        }
        .fullCalendar('renderEvent', myEvent );
        mySlot.myTitle = "anotherTitle";
        .fullCalendar('updateEvent', myEvent );
    

    But this will work:

        myEvent = {
            id: 1, title : "myTitle", start: moment()
        }
        .fullCalendar('renderEvent', myEvent );
        myFCEvent = .fullCalendar('clientEvents', 1);
        myFCEvent.title = "Another title";
        .fullCalendar('updateEvent', myFCEvent);
    

    Demo Plunker

提交回复
热议问题