JSON Format For Adding A Recurring Event

Can someone please give me an example of adding a recurring event using addEvent passing in a JSON event object?

scheduler.addEvent( JSON )

For some reason when I add the rec_type and rec_pattern properties, the event does not appear in my calendar. If I remove those fields, it does, but it is not a recurring event (just a single event).

This does not work:

scheduler.addEvent({ event_id: 14, start_date: new Date(2013,0,17,2,0), end_date: new Date(2013,0,17,3,0), text: "Play Legend of Zelda", rec_type: 'day_1___#no', rec_pattern: "day_1___", event_length: 1358406000000, event_pid: 0 });

Also, if anyone has any sample JSON files to feed into scheduler to load events, that would be cool too.

Thanks in advance.

you don’t need to specify rec_pattern, it will be generated by the scheduler. As for other properties, here is an example:scheduler.addEvent({ event_id: 14, start_date: new Date(2013,0,17,2,0),//start date of the series end_date: new Date(2013,1,17,3,0),//end date of the series text: "Play Legend of Zelda", rec_type: 'day_1___#no', event_length: 2*60*60,//duration of the single event, is seconds event_pid: 0 });

Thanks for the response.

One more related question:

What are the possible values that can go after the number sign (#) at the end of rec_type?


Values after “#” doesn’t affect real recurring pattern, they are used to set state of recurring editor form.

It may take next values

  • “no” - event without end date ( infinite recurring )
  • {number} - count of occurences