1

I am able to create recurring events using fullCalender.js using the below code

$('#calendar').fullCalendar({
    defaultDate: moment(),
    header: {
        left: 'prev,next today',
        center: 'title',
        right: 'month,agendaWeek,agendaDay'
    },
    defaultView: 'month',

    events: [{
        title:"My repeating event",
        start: '10:00', // a start time (10am in this example)
        end: '14:00', // an end time (6pm in this example)

        dow: [ 1, 4 ] // Repeat monday and thursday
    }],
});

recurrent events on every week image

But I need some control on this, my requirement is to repeat the events on alternate weeks not everyweek, where I need to modify/add code, please help me

  • if you follow this: https://stackoverflow.com/a/29393128/5947043 and set a series of ranges to cover alternate weeks it could work. – ADyson May 04 '18 at 08:29

1 Answers1

2

I ran into this problem not too long ago. If I recall correctly, in FullCalendar, you can specify multiple events with the same ID. In each instance of the duplicate ID, you can specify a different start and end date. FullCalendar will recognize all of these event objects as 1 event. So what you could do is create an event for week 1, week 3, week 5, etc. and make sure they all have the same ID. I know that is not ideal but when I researched this before, this is the best answer I could find.

Andrew
  • 1,581
  • 3
  • 18
  • 31
  • Thanks for suggestion, any reference code or jsfiddle example?? – user3202086 May 04 '18 at 06:43
  • 1
    I don't, but basically what it would involve is running a loop of some sort that creates an event for Tuesday/Thursday of the current week, then you could use a library like moment.js to easily move forward in time. Add 2 weeks from Tuesday to get the next Tuesday. Repeat these actions until you get to an end date (say 5 years in the future or however long). Again, it's not ideal but I'm afraid FullCalendar.io doesn't support what you're looking for out of the box. – Andrew May 04 '18 at 06:48