2

I am using jQuery FullCalendar and scheduler in my website for taking appointments for physicians. Here business hours and slot duration are binding dynamically based on selected clinic branch working hours and department duration. So based on this working hours and slot duration some times, business hours ending or starting with half covered time slots. So we can not use that time slot and that department will lose an appointment for the pending time. Is there any solution for this?Here we can not use the time slot 12:00pm because the duration is 45 minutes and the working hours ends at 12.30. So there is a lose of 15 minutes

Ann
  • 121
  • 4
  • 16

1 Answers1

0

I got similar issue with calendar control, event cell not rendering properly when the slot duration is more than 60 min. I got the below solution from StackOverFlow. Please go though it might be helpful for you. Call below function in fullCalendar events handler.

function resetCalendarHeight() {
// reset height and contentHeight properties on month view
if (isNullOrEmpty($('.fc-slats')) || $('.fc-slats').length == 0) {
    $('#calendar').css('height', '530px');
    //$('.fc-row.fc-week.fc-widget-content').css('height', '76');
    $('#calendar').fullCalendar('option', 'contentHeight', 'undefined');
    return false;
}
 // day view or week view set the content height to 'auto' 
// then adjust the height  of the container
$('#calendar').fullCalendar('option', 'contentHeight', 'auto');
var bottomDifference = $('#calendar-container')[0].getBoundingClientRect().bottom - $('.fc-slats')[0].getBoundingClientRect().bottom;
var currentHeight = $(".fc-slats > table").css("height").replace('px', '');
var newHeight = parseInt(currentHeight) + bottomDifference;
$(".fc-slats > table").css("height", newHeight);
$('.fc-scroller.fc-time-grid-container').css('overflow-x', 'auto');
$('.fc-scroller.fc-time-grid-container').css('overflow-y', 'overlay');
$('.fc-scroller.fc-time-grid-container').css('height', newHeight);
return true;}



$('#calendar').fullCalendar({
slotDuration:'45',
    events: function (start, end, timezone, callback) {
            resetCalendarHeight();
    }}) 
Ravi Shankar
  • 153
  • 1
  • 5