Search code examples
angularfullcalendarrrulefullcalendar-5

Overnight bi-weekly recurring events using rrule in fullcalendar angular


Looking to create an overnight event that repeats every 2 weeks in fullcalendar using rrule plugin in angular 10

  • Event starts Monday 8PM ends Wednesday 11AM that repeats every other week.
  • I used the following for the rrule:
rrule: {
  freq: RRule.WEEKLY,
  interval: 2,
},

I have not been able to create the overnight event using fullcalendar and rrule plugin.

I was able to create a simple recurring one day event that repeats every other week.

Currently using

  1. angular 10.1.0
  2. fullcalendar/angular 5.3.1
  3. fullcalendar/rrule 5.3.1

Thanks for your feedback and input.


Solution

  • Your event object would need to look like this:

    {
      title: 'my recurring event',
      duration: '39:00',
      rrule: {
        freq: 'weekly',
        interval: 2,
        byweekday: [ 'mo'],
        dtstart: '2020-09-01T20:00:00'
      }
    }
    

    Let's break that down according to the different requirements:

    • starts Monday 8PM: this is fulfilled by the time in the dtstart. (Of course you can specify any start date you wish.)
    • ends Wednesday 11AM - an event which start at 8pm on Monday and ends 11am on Wednesday is 39 hours long. Therefore we can set the duration of the event itself (not in the rrule) to make this work
    • repeats every other week - this is fulfilled by the freq and interval settings which you had already figured out.

    Live demo: https://codepen.io/ADyson82/pen/abNMoZK