1

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

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.

I have this test:

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

And this is my config for the calendar:

 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();};
ADyson
  • 57,178
  • 14
  • 51
  • 63
Lee Hinde
  • 1,043
  • 12
  • 13
  • 1
    I don't have time to test it now, but fullCalendar regards end dates as exclusive...so maybe there's a conflicting rule there. I don't know how fullCalendar handles that internally. – ADyson Oct 31 '19 at 10:06
  • Thanks. That was a first guess, but all the rrule docs hand off to the doc referenced here. That's why I was looking for some clarification. – Lee Hinde Oct 31 '19 at 13:28
  • 1
    You can test your rule at https://jakubroztocil.github.io/rrule/ and it will give you the output. That, I think, should tell you whether your assumption is correct, and whether it's rrule or fullCalendar which is giving you a problem. – ADyson Oct 31 '19 at 13:38
  • thanks for the link, I've been testing there. It appears to be a FullCalendar issue. This rule ends on the until date: new RRule({ freq: RRule.WEEKLY, dtstart: new Date(Date.UTC(2019, 10, 1, 15, 0, 0)), until: new Date(Date.UTC(2019, 10, 15, 15, 0, 0)), interval: 1, byweekday: [RRule.MO, RRule.WE, RRule.FR] }) – Lee Hinde Oct 31 '19 at 15:58
  • 1
    FTR, as far as it concerns RFC 5545, your rule would be invalid because the `UNTIL` component MUST have a time component if `DTSTART` has one. – Marten Oct 31 '19 at 20:51

2 Answers2

1

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.

Lee Hinde
  • 1,043
  • 12
  • 13
0

You can use the code below to show a day, daily, weekly, every two weeks and monthly events with a tooltip on mouse hover event.

In this example you can see how we can set up rrule in FullCalendar.

Visit here- https://stackoverflow.com/a/68770685/9673996