Fullcalendar limit the display of available months?

前端 未结 9 1638
伪装坚强ぢ
伪装坚强ぢ 2020-12-11 04:11

I would like to find out how can I limit the fullcalendar to show a three months period and deselectable for the rest of the months like within a datepicker?

E.g. T

9条回答
  •  不思量自难忘°
    2020-12-11 04:52

                var academicYearStartDate = new Date('2013/4/10');
                var academicYearEndDate = new Date('2014/4/10');
    
                viewDisplay: function (view) {
                    //========= Hide Next/ Prev Buttons based on academic year date range
                    if (view.end > academicYearEndDate) {
                        $("#SchoolCalender .fc-button-next").hide();
                        return false;
                    }
                    else {
                        $("#SchoolCalender .fc-button-next").show();
                    }
    
                    if (view.start < academicYearStartDate) {
                        $("#SchoolCalender .fc-button-prev").hide();
                        return false;
                    }
                    else {
                        $("#SchoolCalender .fc-button-prev").show();
                    }
    
                }
    

提交回复
热议问题