0
저는 최근에 예약 시스템을 위해 FullCalendar로 작업했습니다. 문제는 내가 시간 범위를 선택할 때마다 모든 것이 eventData 객체에 추가된다는 것입니다. 내가 뭘하려고 하나의 시간 범위를 선택하는 것입니다.FullCalendar가 이전 선택을 선택 취소하지 않습니다
$('#btn-reserve')
단추를 클릭하면 일정에 이벤트가 렌더링됩니다.
내 이전 선택 사항이 캘린더에서 렌더링되는 경우가 발생합니다. 나는 마지막으로 선택한 것을 렌더링하고 싶습니다.
여기 내 코드
$('.calendar').fullCalendar({
selectable: true,
select: function(start, end) {
$('#end_time').val(end);
$('#start_time').val(start);
$('#newScheduleModal').modal({
show : true,
backdrop: 'static',
keyboard: false
});
$('#btn-reserve').click(function(){
eventData = {
title: 'Lesson Schedule',
start: start,
end: end
};
$('.calendar').fullCalendar('renderEvent', eventData, true); // stick? = true
$('#newScheduleModal').modal('hide');
});
$('#btn-cancel-reserve').click(function(){
$('.calendar').fullCalendar('unselect');
eventData = {};
})
},
})