【问题标题】:Fullcalendar Custom View stops me looking at past datesFullcalendar 自定义视图阻止我查看过去的日期
【发布时间】:2019-02-22 17:53:23
【问题描述】:

您好,我的职责很简单。修改一个日历,我已经查看了两周前的“议程”视图,下一个/上一个应该只是向前/向后移动一天。

看起来很简单,检查了文档 - 似乎已经添加了新功能。 我使用 nuget 将日历升级到 3.9 并插入了自定义视图。 但无论我尝试什么都无法回头。试过 3.3.1 一样。

我做错了什么——或者我做错了什么?这是一个完整的日历错误吗?

    $('#calendar').fullCalendar({
         header: {
            left: 'prev,next today',
            center: 'title',
            right: 'agendaTwoWeeks,agendaWeek,agendaDay,listWeek,listDay'
         },
         weekends: false,
         minTime: '08:00:00',
         maxTime : '17:00:00',
         buttonText: {
             listWeek: 'Weekly',
             listDay: 'Daily',
         },

         views: {

             agendaTwoWeeks: {
                 type: 'agenda',

                 dayCount: 14
                 /*visibleRange: function(currentDate) {

                     console.log("current date "+currentDate.format());

                     var ret =  {
                         start: currentDate.clone().subtract(1, 'days'),
                         end: currentDate.clone().add(3, 'days') // exclusive end, so 3
                     };
                     console.log(ret.start.format());
                     console.log(ret.end.format());


                     return ret;
                 }*/


             },

             agendaWeek: { // name of view
                 titleFormat: 'D MMM YYYY',
                 columnFormat: 'ddd D/M'
                 // other view-specific options here
             },
             agendaDay: { // name of view
                 titleFormat: 'D MMM YYYY',
                 columnFormat: 'dddd'
                 // other view-specific options here
             },
             listWeek: { // name of view
                 titleFormat: 'D MMM YYYY',
                 columnFormat: 'ddd D/M'
                 // other view-specific options here
             },
             listDay: { // name of view
                 titleFormat: 'D MMM YYYY',
                 columnFormat: 'ddd D/M'
                 // other view-specific options here
             },

         },

        defaultDate: '2018-09-21',
        /*validRange: {
            start:'2017-09-18',
            end: '2019-09-18'
        },*/
        firstDay : 1,
        defaultView: 'agendaWeek',
        editable: true,
        eventDurationEditable: false,
        allDaySlot: false,
        eventTextColor: '#000000',
        slotDuration: '00:15:00',
        slotLabelInterval : '00:15:00',

    });

});

视图是 agendaTwoWeeks 我玩过 daycount,duration, visibleRange , validRange - 似乎没有任何效果。

【问题讨论】:

    标签: jquery date twitter-bootstrap-3 fullcalendar


    【解决方案1】:

    没错,是weekends = false 导致了问题。 我会看看 visibleRange 以及如何绕过它。

    R

    更新,看了一下,没有。它似乎无法掌握当前日期不是周末,即使您可以跳过一种方式,但另一种方式不起作用。 理想情况下,会有一个功能来说明第二天点击的内容。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-06-15
      • 2019-06-10
      • 2018-04-14
      • 1970-01-01
      相关资源
      最近更新 更多