FullCalendar规则“直到”不包含在内

时间:2019-10-31 03:36:19

标签: javascript calendar fullcalendar fullcalendar-4 rrule

rrule插件的规范指出,直到日期都是包含在内的。我没看到我看错了吗?

https://github.com/jakubroztocil/rrule

  

如果给出,则它必须是Date实例,它将指定重复发生的限制。如果重复发生的实例恰好与〜参数中指定的Date实例相同,则这将是最后一次出现。

我有这个测试:

calendaring.testRecur = function(dayOrWeek){
var rruleDataWeekly = {
    freq: 'WEEKLY',
    interval: 1,
    byweekday: [ 'MO', 'WE', 'FR' ],
    dtstart: '2019-11-01T10:30:00',
    until: '2019-11-15'
};
var rruleDataDaily = {
    freq: 'DAILY',
    interval: 1,
    count: 5,
    dtstart: '2019-11-04T09:30:00',
};

var rruleData = dayOrWeek === "day" ? rruleDataDaily :  rruleDataWeekly;
var title = dayOrWeek === "day" ? "Test Daily" :  "Test Weekly";

var newEvent = {
    title: title,
    duration: "00:45",
    rrule: rruleData
};
calendaring.calendar.addEvent(newEvent);};

这是我的日历配置:

 calendaring.calendar = new Calendar(calendarEl, {
    events: '/myurl',
    plugins: ['rrule', 'interaction', 'dayGrid', 'timeGrid', 'bootstrap', 'list'],
    header: {
        left: 'prev,next today',
        center: 'title',
        right: 'dayGridMonth,timeGridWeek,timeGridDay, listDay',
    },
    defaultView: 'timeGridWeek',

    slotDuration: '00:15',
    slotLabelInterval: '01:00',
    minTime: '06:00',
    maxTime: '21:00',
    allDaySlot: false,
    slotEventOverlap: false,
    buttonText: {
        today: 'Today',
        month: 'Month',
        week: 'Week',
        day: 'Day',
        list: 'List',
    },
    themeSystem: 'bootstrap',
    editable: true,
    selectable: true,
    droppable: true,
    fixedWeekCount: false,
    hiddenDays: [ 0, 6 ],
    eventLimit: 6,

});
calendaring.calendar.render();};

1 个答案:

答案 0 :(得分:1)

问题是我没有时间与UNTIL相关联。因此,它假设是午夜,而不是23:59:59。 ew感谢@ADyson的帮助。