FullCalendar规则“直到"不包容 [英] FullCalendar rrule "Until" not being inclusive

查看:82
本文介绍了FullCalendar规则“直到"不包容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

The spec for the rrule plugin says that Until dates are Inclusive. I'm not seeing that. Am I mis-reading?

https://github.com/jakubroztocil/rrule

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

If given, this must be a Date instance, that will specify the limit of the recurrence. If a recurrence instance happens to be the same as the Date instance given in the until argument, this will be the last occurrence.

我有这个测试:

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

推荐答案

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

The issue was I didn't have a time associated with my UNTIL. So, it assumes midnight, not 23:59:59. Phew. Thanks @ADyson for the help.

这篇关于FullCalendar规则“直到"不包容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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