Work time in fullcalendar [Solution]

亡梦爱人 提交于 2019-12-04 11:34:48

Cure for shifting - replace function into this:

function selectCell(startRowNo, endRowNo, collClass, cellClass, closeGap, showAtHolidays){
$('.fc-content').find('.fc-view-agendaWeek').find('.fc-agenda-body')
.children('.'+cellClass+''+startRowNo+''+collClass).remove();
$('.fc-content').find('.fc-view-agendaDay')
.find('.fc-work-time-day').removeClass('fc-work-time-day');

if($('.fc-content').find('.fc-view-agendaWeek').find('.'+collClass).attr('class').search('fc-holiday') == -1 || showAtHolidays){
    var width = $('.fc-content').find('.fc-view-agendaWeek')
    .find('.'+collClass+':last').width();
    var height = 0;
    if(closeGap && (startRowNo != endRowNo)){
        height = $('.fc-content').find('.fc-view-agendaWeek')
        .find('.fc-slot'+ startRowNo).height();
    }
    $('.fc-view-agendaWeek').find('.fc-agenda-body').prepend('<div class="'+cellClass+' '
        + ''+cellClass+''+startRowNo+''+collClass+'"></div>');
    $('.'+cellClass).width(width);
    height += $('.fc-content').find('.fc-view-agendaWeek')
    .find('.fc-slot'+ endRowNo).position().top
    - $('.fc-content').find('.fc-view-agendaWeek')
    .find('.fc-slot'+ startRowNo).position().top;
    $('.'+cellClass+''+startRowNo+''+collClass).height(height);
    $('.'+cellClass+''+startRowNo+''+collClass)
    .css('margin-top',
        $('.fc-content').find('.fc-view-agendaWeek')
        .find('.fc-slot'+ startRowNo).position().top);
    var dayname = collClass.slice(3);
    var dayNo;
    switch(dayname){
        case 'mon': dayNo=0; break;
        case 'tue': dayNo=1; break;
        case 'wed': dayNo=2; break;
        case 'thu': dayNo=3; break;
        case 'fri': dayNo=4; break;
        case 'sat': dayNo=5; break;
        case 'sun': dayNo=6; break;
    }
    $('.'+cellClass+''+startRowNo+''+collClass)
    .css('margin-left',
        $('.fc-content').find('.fc-view-agendaWeek')
        .find('.fc-slot'+ startRowNo).position().left + (width + 1) * dayNo);
}

}

Not-continuous daily work time is not supported yet. You must use only one period of work time per day.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!