How to make past date unselectable in fullcalendar?

前端 未结 15 1226
暗喜
暗喜 2020-12-08 07:46

Problem is, how to disable selectable on PAST DATES in fullcalendar\'s month/week view.

I want to user not allowed to click/select the on past dates.

15条回答
  •  时光说笑
    2020-12-08 08:31

    This is what I am currently using

    Also added the .add() function so the user cannot add an event at the same hour

    select: function(start, end, jsEvent, view) {
                   if(end.isBefore(moment().add(1,'hour').format())) {
                   $('#calendar').fullCalendar('unselect');
                   return false;
                 }
    

提交回复
热议问题