我想知道 Arshaw 的 FullCalendar 是否有办法: 1- 将日历从显示周末更改为不显示周末,反之亦然。 2- 动态更改时隙间隔,从 30 分钟更改为 60 分钟。
换句话说,我想做的是:
//Clicking the button that shows Saturday and Sunday too
$('#weekend-yes').click(function(){
$('#weekend-yes').hide();
$('#weekend-no').fadeIn();
//HYPOTHETICALLY DO THIS
$('#calendar').fullCalendar('option', 'weekends', true/false);
});
如果类似的事情不可能实现,那么最好的解决方法是什么?我想我可以有第二个日历,它是第一个日历的复制品,但复制太多了。
感谢我能得到的任何帮助..
最佳答案
试试这个:
$('#values').click(function(){
var weekend = $('#calendar').fullCalendar('option', 'weekends');
if (weekend){
$('#values').text('Show weekend');
$('.fc-header').remove();
$('.fc-content').remove();
$('#calendar').fullCalendar({ firstDay:1, height:650,
weekMode:'liquid', weekends:false,
header: {left: 'prev,next today',
center: 'title',
right: 'month,
agendaWeek,agendaDay'}});
} else {
$('#values').text('Hide weekend');
$('.fc-header').remove();
$('.fc-content').remove();
$('#calendar').fullCalendar({ firstDay:1, height:650,
weekMode:'liquid', weekends:true,
header: {left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'}});
};
});
关于jquery - FullCalendar 在周末和无周末之间切换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11958479/