Disable highlight of an external event in fullcalendar
I am using the fullcalendar jquery plugin v2.6.1. Actually, I want to prevent the highlighted option of an external events while dragging to the calendar.
Is there any possible way to disable the fc-highlight
from the event or any option to show the highlight on the basis of event size. I mean to say that I have an external event with start and end time eg the event starts from 10:00 and ends at 11:00 but when I'm dragging that event to the calendar, the fc-highlight
always covered the two hours slot.
Picture attached below
So in the picture, the grayish highlighted box in red stroke Event 2 which is only available for one hour slot but the highlighted background covers two hours which I want to disable it or just make it one hour. Please help.
Thanks in advance!
您可以通过在FullCalendar选项中添加defaultTimedEventDuration: 01:00:00
或在外部事件中添加duration
来实现该解决方案,如下所示:
<div class="external fc-event" duration="04:00">Event</div>
I'm not sure but if you will set end time in drop function for the external event then you don't need to disable the highlight. Try this:
var eventsArray = [];
$('#calendar').fullCalendar({
drop: function(date) {
var eventObject = $(this).data('eventObject');
var eventObjectDuplicate = $.extend({}, eventObject);
eventObjectDuplicate.start = date;
eventObjectDuplicate.end = (date.getTime() + 1800000)/1000;
eventObjectDuplicate.allDay = false;
eventsArray.push(eventObjectDuplicate);
}
)};
链接地址: http://www.djcxy.com/p/39422.html