Fullcalendar - limit selectable to a single day

前端 未结 6 714
慢半拍i
慢半拍i 2020-12-10 04:31

By default if you enable the \'selectable\' attribute it will allow you to click and drag and select several days. I would like to only allow the user to select a single day

6条回答
  •  盖世英雄少女心
    2020-12-10 05:10

    You can select a single date or time by passing fullcalendar's 'select' method to the dayClick event listener:

    $('#myCalendar').fullcalendar({
        dayClick: function(date,jsEvent,view) {
            $('#myCalendar').fullcalendar('select', date);
        }
    });
    

    Note you will also need to fire the 'unselect' method on your next callback (or dayClick).

提交回复
热议问题