【问题标题】:Jquery Fullcalendar hide some hours in Today viewJquery Fullcalendar 在今天视图中隐藏了几个小时
【发布时间】:2015-08-04 20:29:12
【问题描述】:

我想在“今天”视图中隐藏或删除几个小时,现在使用 minTime 和 maxTime 选项。

预期输出是小时范围 (7 至 12) (隐藏 13-14-16 小时行) (16 到 22)

      $('#calendar').fullCalendar({
                header: hdr,
                buttonText: {
                    prev: '<i class="fa fa-chevron-left"></i>',
                    next: '<i class="fa fa-chevron-right"></i>'
                },

                minTime: "7:00",
                maxTime: "23:00",

                editable: true,
                droppable: true

有什么想学的请...

【问题讨论】:

    标签: javascript jquery html time fullcalendar


    【解决方案1】:

    这可能是一个旧帖子,但它仍然可以帮助某人

    使用 viewRender 选项,您可以搜索表格并根据您使用的范围删除所述小时

    viewRender: function(view, element) {
          $(element).find('div.fc-slats table tr[data-time]').filter(function() {
            var _t = jQuery(this).data('time');
            /* Searches for the times that we don't want */
            return ((_t >= '07:00' && _t <= '12:00') || (_t >= '16:00' && _t <= '22:00')) === false;
          }).each(function() {
            $(this).remove(); /* hide the unnecessary rows */
          });
      }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多