fullcalendar incorrect event end date after eventResize

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-29 17:29:22

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

C R

My answer comes late but as said in this post, the event.start._i is used for internal logic by Moments.js.

Your event.start does contain your updated date (which i think is located at event.start_d) but you don't need to use these internal objects as FullCalendar will take them into account and will use the correct (updated) date by itself.

My issue was solved by this adding .utc().format()

moment.parseZone('2016-05-03T22:15:01+02:00').utc().format(); //"2016-05-03T20:15:01Z"

moment docs reference

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