0

I am using Fullcalendar v 3.6 in Angular5.

I am getting the Rrule as shown in this image

My code is,

showEvents(events: any) {debugger
    let calendarOptions: Object;
    let newEvents = [];

    this.eventSource.map((event) => {
      event.title = event.name;
      event.start = event.startTime;
      event.end = event.endTime;
      event.status = event.eventStatus;
      event.allDay = event.isallDay;
      event.rrule = event.recurrencePattern;
      newEvents.push(event);
    });

    newEvents.forEach(element => {
     if(element.recurrencePattern === "RRULE:FREQ=MONTHLY;")
     {
      element.dom = [1];    
       newEvents.push(element);  
     }      
   });

    calendarOptions = {
      header:
      {
        left: 'prev,next, today',
        center: 'title',
        right: 'month,agendaWeek,agendaDay,listMonth'
      },
    events : newEvents
}; 

how can I add recurring events on Fullcalendar v3.6 in Angular 5? Please help

mruanova
  • 6,351
  • 6
  • 37
  • 55
Rohit Borude
  • 218
  • 1
  • 3
  • 10
  • 1
    Did you read the documentation at all? You can't use RRule directly with fullCalendar 3.x (or lower). You can if you use the 4.x branch plus a plugin (see docs: https://fullcalendar.io/docs/v4/recurring-events and https://fullcalendar.io/docs/v4/rrule-plugin), but v4 is still in beta and not finally released yet, so use with caution. – ADyson Feb 25 '19 at 13:01
  • 1
    However this answer: https://stackoverflow.com/a/29393128/5947043 provides various ways to emulate recurring events in the earlier fullCalendar versions, so perhaps you could write a bit of extra code to translate your RRule data into something which works along that pattern. – ADyson Feb 25 '19 at 13:02
  • Actually I read the documentation & I already know its not available for v3.6 but I am asking you if there is any other way to do recurrence using rrule – Rohit Borude Feb 26 '19 at 15:55
  • Ok and I've already explained that no there is no direct support, but sure, you could write some code to translate between rrule data and the various ways of representing recurrence described in the link I provided. You might not be able to support everything that rrule allows just using those techniques, so you might have to expand those techniques, or decide to only support a subset of what can be specified via rrule. Depends on your requirements. It's too much for someone to actually come here and write that library here in an answer. Quite a lot of code and careful testing is required... – ADyson Feb 26 '19 at 16:06
  • ...hence why I have marked your question as "too broad". There's always a way, you can generally do anything you want with code, you just have to put some thought into it. – ADyson Feb 26 '19 at 16:07

1 Answers1

0

You can initiate a RRule object using the RRule library. Then you call the RRule's object between function in which you insert the start and end dates of your current FullCalendar's view. This gives you an array of events which you can add to your calendar.

Dany Dhondt
  • 881
  • 9
  • 27