I'm currently creating a booking system utilising Full Calendar with React.
When Dragging a lesson (event), I have all the unavailable booking times appear as grey, but for some reason, I am still able to drag events on those slots, But for the white areas, I am unable to drag.
How would I reverse this?
Image of my timetable
Some of my code:
My array of available lessons:
let avail = [
{
groupId: "lesson-available",
start: "2021-01-13T10:00:00",
end: "2021-01-13T16:00:00",
color: "#ccc",
display: "inverse-background",
},
{
groupId: "lesson-available",
start: "2021-01-14T16:00:00",
end: "2021-01-14T19:00:00",
color: "#ccc",
display: "inverse-background",
},
{
groupId: "lesson-available",
start: "2021-01-15T16:00:00",
end: "2021-01-15T19:00:00",
display: "inverse-background",
color: "#ccc",
},
{
groupId: "lesson-available",
start: "2021-01-16T16:00:00",
end: "2021-01-17T19:00:00",
display: "inverse-background",
color: "#ccc",
},
];
-------------------------------------------------------
<FullCalendar
plugins={[dayGridPlugin, timeGridPlugin, interactionPlugin]}
headerToolbar={{
left: "prev,next today",
center: "title",
right: "dayGridMonth,timeGridWeek,timeGridDay",
}}
initialView="timeGridWeek"
editable={true}
eventColor="#6DCBCA"
selectable={false} // Allows a user to highlight multiple days or timeslots by clicking and dragging.
selectMirror={true}
dayMaxEvents={true}
weekends={true}
events={currentEvents}
select={handleDateSelect}
eventContent={renderEventContent}
eventClick={handleEventClick}
eventDrop={handleEventDrop}
eventDragStart={handleEventDragStart}
eventDragStop={handleEventDragStop}
eventOverlap={false}
/>
question from:
https://stackoverflow.com/questions/65662260/full-calendar-react-js-how-to-disable-dragging-to-inverse-background-events 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…