After spending a few hours debugging, I’ve narrowed this down to the dates I am passing to the addEvent method. The rec_type, event_length or PID have no impact.
For example, using hard-coded strings, the event is created successfully using this code:
[code] var newEvent = {
start_date: “23-08-2010”,
end_date: “24-08-2010”,
text: evs[0].text,
id: newEventId,
rec_type: evs[0].rec_type,
shift_type: evs[0].shift_type,
event_length: evs[0].event_length,
event_pid: evs[0].event_pid,
section_id: evs[0].section_id,
color: evs[0].color,
};
// Create the new event
scheduler.addEvent(newEvent);
[/code]
However, when using the values taken from the entered event, I receive the error:
[code] var newEvent = {
start_date: ev.end_date,
end_date: evs[0].end_date,
text: evs[0].text,
id: newEventId,
rec_type: evs[0].rec_type,
shift_type: evs[0].shift_type,
event_length: evs[0].event_length,
event_pid: evs[0].event_pid,
section_id: evs[0].section_id,
color: evs[0].color,
};
// Create the new event
scheduler.addEvent(newEvent);
[/code]
I therefore decided to check what format the events were being transmitted in, and I have the following in my init:
function init() {
scheduler.config.api_date = "%Y-%m-%d %H:%i";
scheduler.config.xml_date="%Y-%m-%d %H:%i";
scheduler.config.repeat_date = "%Y-%m-%d";
scheduler.config.edit_on_create = true;
scheduler.config.first_hour = 7;
scheduler.config.last_hour = 24;
scheduler.config.details_on_create = true;
scheduler.config.details_on_dblclick = true;
scheduler.config.time_step = 30;
// Values are stored in UTC on the server
scheduler.config.server_utc = true;
I hope this can help!