Javascript 完整日历-选择年底前的所有星期六?
我很难用FullCalendar选择日期。通常,您可以通过添加highlight类来选择星期六:Javascript 完整日历-选择年底前的所有星期六?,javascript,jquery,select,fullcalendar,Javascript,Jquery,Select,Fullcalendar,我很难用FullCalendar选择日期。通常,您可以通过添加highlight类来选择星期六: $('.fc-sat').addClass('.fc-state-highlight'); 但这将只选择您正在查看的月份的星期六 calendar = $('#calendar').fullCalendar({}); $('button').click(function(){ // select all saturdays until end o
$('.fc-sat').addClass('.fc-state-highlight');
但这将只选择您正在查看的月份的星期六
calendar = $('#calendar').fullCalendar({});
$('button').click(function(){
// select all saturdays until end of year
calendar.fullCalendar( 'select', start, [ end ] )
});
我需要的能力,选择所有的按钮点击一年剩下的星期六。
单击按钮时,其他月份的天数不在DOM中,因此这些单元格均未被选中。尝试向fullCalendar对象添加一个方法,如果单击了该按钮,则将highlight类添加到.fc sat元素中。使用MomentJS回答了这个问题。