jquery - 完整日历 jquery 中的 eventDrop

标签 jquery fullcalendar

在fullcalendar插件的evendrop中,我想要被拖动的事件,但是如果我编写下面的代码,它会给出它被拖动的位置的事件,而不是它原来的位置的事件拖拽。

eventDrop: function( event, dayDelta, minuteDelta, allDay, revertFunc, jsEvent, ui, view )
{
    console.log(event)
}

例如,假设 3 月 22 日上午 9 点有一个事件,我将其拖到 3 月 23 日上午 9 点。因此,如果我写上面的文章,我会得到 3 月 23 日的事件,但我不确定如何得到 3 月 22 日的事件。

请帮帮我。
谢谢。

最佳答案

来自specification :

event is an Event Object that hold the event's information (date, title, etc).

dayDelta holds the number of days the event was moved forward (a positive number) or backwards (a negative number).

minuteDelta holds the number of minutes the event was moved forward (a positive number) or backwards (a negative number). Only useful for the agenda views. In other views, 0 is passed in.

您已拥有在拖动之前获取事件日期所需的所有信息

例如 事件日期现为 2012 年 7 月 26 日 14:00:00 dayDelta = 1 & 分钟Delta = -60 那么事件的原始日期为 2010 年 7 月 25 日 15:00:00

关于jquery - 完整日历 jquery 中的 eventDrop,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9812227/

相关文章:

Jquery UI 可拖动/可排序,无需按住鼠标按钮

php - AJAX 提交的结果未显示

javascript - 有什么方法可以使时间间隔在全日历中不可点击?

jquery - eventDragStop 不显示新时间 - FullCalendar

javascript - FullCalendar v5.x 中 eventAfterAllRender 的替代选项

jquery - fullCalendar UNIX 时间戳转换问题与选择事件

javascript - 一个链接到多个容器 anchor

javascript - jquery ui 可在容器内拖动滚动

jquery - 如何覆盖 jQuery Fullcalendar 中的默认值

javascript - 如何将 FullCalendar 事件文本旋转 90 度以垂直