How to block out dates in the Fullcalendar beyond a certain date

后端 未结 7 1155
心在旅途
心在旅途 2020-12-08 16:51

I have a date in the future which is always 30 days ahead of the current date. It\'s stored in a Date object. I worked this out using:

var currentDate = new          


        
7条回答
  •  佛祖请我去吃肉
    2020-12-08 17:31

    In new version V4 of Full Calendar, there are lot of updates and you can find the settings for your need

    Limits which dates the user can navigate to and where events can go.

    // constrain to a discrete range
    var calendar = new Calendar(calendarEl, {
      defaultView: 'dayGridMonth',
      validRange: {
        start: '2017-05-01',
        end: '2017-06-01'
      }
    });
    
    // constrain to an open-ended range
    var calendar = new Calendar(calendarEl, {
      defaultView: 'dayGridMonth',
      validRange: {
        start: '2017-05-01'
      }
    });
    

提交回复
热议问题