Fullcalendar - limit selectable to a single day

青春壹個敷衍的年華 提交于 2019-11-29 06:19:39

If you want to limit highlight to a single day in agenda week view you can use following:

  selectConstraint:{
      start: '00:01', 
      end: '23:59', 
    },

if you want to limit the event you can use

eventConstraint:{
      start: '00:00', 
      end: '24:00', 
    },

in the select callback, adding the following does the trick: (fullcalendar 2 using moment.js)

if (start.add('days', 1).date() != end.date() )
  $scope.eventCal.fullCalendar('unselect');

resources:

http://arshaw.com/fullcalendar/docs/selection/select_callback/ http://arshaw.com/fullcalendar/docs/selection/unselect_method/

S. Emmer

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).

Not at this time: the range of selectable days can not be customized without modifying the source.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!