【问题标题】:Jquery Full Calendar Slot duration and business hours issueJquery Full Calendar Slot 持续时间和营业时间问题
【发布时间】:2017-06-07 06:52:00
【问题描述】:

我在我的网站上使用 jQuery FullCalendar 和调度程序来为医生预约。在这里,营业时间和时段持续时间根据所选诊所分支机构的工作时间和部门持续时间动态绑定。因此,有时根据此工作时间和时段持续时间,营业时间以半覆盖时段结束或开始。所以我们不能使用那个时间段,那个部门将失去一个等待时间的约会。有什么解决办法吗?

【问题讨论】:

    标签: jquery fullcalendar-scheduler


    【解决方案1】:

    我遇到了与日历控件类似的问题,当插槽持续时间超过 60 分钟时,事件单元格无法正确呈现。我从 StackOverFlow 获得了以下解决方案。请尽管它可能对你有帮助。在 fullCalendar 事件处理程序中调用以下函数。

    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();
        }}) 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-01-13
      • 1970-01-01
      • 1970-01-01
      • 2023-04-01
      • 1970-01-01
      • 2018-01-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多