我想知道在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);
});如果这样的事情是不可能的,那么最好的解决方法是什么?我想我可以有第二个日历,它是第一个日历的复制品,但那将是太多的复制。
感谢我能得到的任何帮助..
发布于 2012-08-15 04:51:45
根据这个插件的作者,所有的FullCalendar选项都没有setter(不幸的是weekends是其中之一)。所以我想你有几个选择
使用设置为true/false
万事如意!
发布于 2012-10-09 18:19:09
试试这个:
$('#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'}});
};
});发布于 2016-11-02 06:35:42
这是一个古老的话题,但目前的fullCalendar (2 & 3)实现仍然没有解决这个问题。fullCalendar具有'changeView‘功能。你必须自定义视图。您可以通过扩展现有的。
$('#calendar').fullCalendar({
views: {
workWeek: {
type: 'agendaWeek',
hiddenDays: [0, 6]
}
}});现在,您可以随时根据需要更改视图。
$('#calendar').fullCalendar( 'changeView', 'workWeek' )或
$('#calendar').fullCalendar( 'changeView', 'agendaWeek' )https://stackoverflow.com/questions/11958479
复制相似问题