1

我创建了一个外部事件面板,以允许用户将事件拖动到完整的日历 - 调度程序视图。但是我希望当用户在日历上释放事件时,可拖动事件是固定的开始时间和结束时间。我怎样才能做到这一点?我已经尝试过每个事件并为其提供开始时间。

我的代码:

$('#external-events .fc-event').each(function () {

            // store data so the calendar knows to render an event upon drop
            $(this).data('event', {
                title: $.trim($(this).text()), // use the element's text as the event title
                stick: true, // maintain when user navigates (see docs on the renderEvent method)
                start: "09:00",
                time: "09:00",
                durationEditable: false,
                duration: "09:00"
            });

            // make the event draggable using jQuery UI
            $(this).draggable({
                zIndex: 999,
                revert: true,      // will cause the event to go back to its
                revertDuration: 0,  //  original position after the drag

            });

        });
4

0 回答 0