FullCalendar在周末和周末之间切换 [英] FullCalendar switch between weekends and no weekends

查看:258
本文介绍了FullCalendar在周末和周末之间切换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道Arshaw的FullCalendar中是否有一种方法:
1-将周末显示为不显示周末,反之亦然。
2-动态地将时间间隔从30分钟改变为60分钟。



换句话说,我想要做的是:

  //点击显示周六和周日的按钮
$('#weekend-yes')。click(function( ){
$('#weekend-yes')。hide();
$('#weekend-no')。fadeIn();
// HYPOTHETICALLY do this
$('#calendar')。fullCalendar('option','weekends',true / false);
});

如果这样的事情是不可能的,那么最好的解决方法是什么?我想我可以有第二个日历,它是第一个日历的复制品,但这会是太复制。



感谢任何帮助,我可以得到..

解决方案

根据这个插件的作者,所有FullCalendar选项都没有setter(不幸的是 weekends 就是其中之一)。因此,我认为您有几个选择


  1. reinit(销毁并初始化)周末设置为true / false的日历

  2. 编辑插件的源代码,为此选项添加setter。我已经看到了围绕这个问题记录的问题,但我不认为这个插件是积极开发了。

一切顺利!

I was wondering if there was a way in Arshaw's FullCalendar to: 1- Change the calendar from showing weekends to not show weekends and vice versa. 2- To dynamically change the timeslot interval from say 30 minutes to 60 minutes.

In other words, what I am trying to do is:

//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);
    });

If something like that is not possible, what would be the best workaround? I guess I could have a second calendar which is a replica of the first, but that would be too much replication.

Appreciate any help I can get..

解决方案

Per the author of this plugin, all the FullCalendar options don't have setters (unfortunately weekends is one of them). So I think you have a couple of options

  1. reinit (destroy and init) the calendar with weekends set to true/false
  2. edit the source for the plugin to add a setter for this option. I have seen issues logged around this, but I don't think this plugin is actively developed anymore.

All the best!

这篇关于FullCalendar在周末和周末之间切换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆