Hi,
can you ceck why everytime i edit single occurence of a recurring event it create new event instead of updating the single occurence.
Here’s the code how i save the event, can you check please:
scheduler.attachEvent("onEventSave", function(id,e,is_new){
var ev = scheduler.getEvent(id);
var schedData = {},
starttime = String(e["start_date"]),
endtime = String(e["end_date"]);
//recurring event
if(typeof e["_end_date"] !== 'undefined'){
endtime = String(e["_end_date"]);
}
schedData["eventId"] = id;
schedData["scheduleTitle"] = e["text"];
schedData["userId"] = e["section_id"];
schedData["startDate"] = Date.parse(starttime.substring(starttime.lastIndexOf(" ("),0)).getTime()/1000;
schedData["endDate"] = Date.parse(endtime.substring(endtime.lastIndexOf(" ("),0)).getTime()/1000;
schedData["recurringPattern"] = e["rec_pattern"];
schedData["recurringType"] = e["rec_type"];
schedData["eventLength"] = 60*60*2;
schedData["eventType"] = e["schedtype"];
schedData["workOrderId"] = e["workorders"];
if (!e.text) {
alert("Event title must not be empty.");
return false;
}else if(!e["schedtype"]){
alert("Schedule type must not be empty.");
return false;
}else{
if(is_new == null){
if(ev["event_pid"] != ''){
//editing single occurence
schedData["eventPid"] = parseInt(ev["event_id"]);
$scope.postUrl = 'schedule/add';
}else{
//updating the normal event
schedData["id"] = parseInt(ev["event_id"]);
schedData["version"] = parseInt(ev["version"]);
$scope.postUrl = 'schedule/update';
}
}
$http.post($scope.postUrl, schedData).success(function(data) {
location.reload(true);
}).error(function(data) {
alert(data.message);
});
}
return true;
});
Also I attached the screenshot of output from month view and my database table.
Thanks in advance.
