user3202086
user3202086

Reputation: 17

fullcalender.js Recurring events on alternate weeks

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

Upvotes: 1

Views: 560

Answers (1)

Andrew
Andrew

Reputation: 1621

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.

Upvotes: 2

Related Questions