When extracting the date from FullCalendar
and attempting to edit it, I noticed that moment.js
seems to overwrite all previously saved dates. Here is an example of what's happening:
var date_start = $calendar.fullCalendar('getView').start.toDate();
date_start.setHours(0);
var date_end = $calendar.fullCalendar('getView').start.toDate();
date_end.add(1, "days");
console.log("start => " , date_start);
console.log("end => " , date_end)
The result returned shows:
start => Sat Oct 24 2015 00:00:00 GMT+0200 (Central Europe Standard Time)
end => Sat Oct 24 2015 00:00:00 GMT+0200 (Central Europe Standard Time)
However, the correct end date should be:
end => Sun Oct 25 2015 00:00:00 GMT+0200 (Central Europe Standard Time)
It should be noted that I am saving the end date as the start date because of a bug in this extension, which causes the resource to be split across multiple days within a single day.
My issue is specifically related to the line date_end.add(1, "days");
as it appears to replace all dates with the value of the date_start
variable.