| Issue 772: | Possible bug in event eventDrop and eventDragStop | |
| 3 people starred this issue and may be notified of changes. | Back to list |
I have a project that I finally have working pretty smoothly except I am getting an error in the eventDrop function when trying to move an event.
For some reason, eventDrop is not returning an end property. It is only returning null.
I can add an event and save it correctly to the db. I can edit or delete this event.
I can resize the event with no problems.
But if I move it to another date, it throws calEvent.end is null.
However, if I resize the event first and then move it, it works correctly.
I can reproduce it 100% of the time, including the examples in the 1.4.9 package.
All of my events are allday in month view.
What could I be doing wrong?
Here is a snippet of my code:
function eventDrop(calEvent, dayDelta, minuteDelta, allDay, revertFunc, jsEvent,ui, view) {
calEvent.start = calEvent.start.getTime() / 1000;
calEvent.end = calEvent.end.getTime() / 1000;
}
calEvent.end returns null.
Thanks,
Scott
Dec 31, 2010
this is probably happening because the original event, before it was dragged, never had an end time. fullcalendar tries to preserve this even after an event has been dragged and dropped. if you make sure the event has an explicit end time (by ensuring your eventSource(s) output an end time), this problem should be solved.
Status:
Done
Nov 19, 2011
hy why problem is ended ? i have same situation - i move loaded event - and have error : event.end is null fullcalendar-1.5.2
Dec 1, 2012
aye, same issue here!
May 8, 2013
Hello to all,
i do this:
function normalizeEvent(event) {
// some code
event.end = parseDate(event.end, ignoreTimezone);
if (event.end && event.end <= event.start) {
event.end.setMinutes(event.end.getMinutes()+1)
// event.end = null
}
// some code
fullcalendar-1.6.1.zip
Oct 5, 2013
@luis.kau...@gmail.com; that works great! Thank you!!!
In fact, I changed it a little.
let's use "options.defaultEventMinutes" variable instead of "event.end.getMinutes()+1"
My code is,
if (event.end && event.end <= event.start) {
event.end.setMinutes(event.end.getMinutes() + options.defaultEventMinutes)
//event.end = null;
}
Hope that it helps someone else.
ilter
Nov 24, 2014
I have this problem with version 2.2.2. I have multiday events and the event object the eventDrop(event) gets has event.end == null and this means that there is no easy way to update the record in the database. |
|
| ► Sign in to add a comment |
I have narrowed the problem to lines 1099-1103 in the fullcalendar source. The lines are: event.end = parseDate(event.end, options.ignoreTimezone); if (event.end && event.end <= event.start) { event.end = null; } event._end = event.end ? cloneDate(event.end) : null; If I comment out the null lines, it works perfectly. Everything else seems to work. I can't really trace what is going on here yet, but I don't want it to break anything else down the road. Again, commenting out the null lines, seems to have fixed my issue but at what cost? Any help would be appreciated.