How can I set Fullcalendar options dynamically

后端 未结 7 721
广开言路
广开言路 2020-12-17 16:22

How can I set the minTime and maxTime options after the calendar is created?

I tried the following, which doesn\'t work:

$(         


        
7条回答
  •  情书的邮戳
    2020-12-17 16:28

    This way you can change as many calendar options you like:

    // save the calendar options in a variable
    var calendarOptions = $('#calendar')
         .fullCalendar('getView')
         .options;
    
    // make your changes to the calendar options
    // I wanted to change the slotDuration
    calendarOptions.slotDuration = '00:20:00';
    
    // destroy the calendar
    $('#calendar')
         .fullCalendar('destroy');
    
    //Lets load the calendar with the new options
    $('#calendar')
         .fullCalendar(calendarOptions);
    

    Hope this helps. Thanks.

提交回复
热议问题