Languages

Menu
Sites
Language
Updating or deleting recurring events in Calendar API

Hi, how to update or delete recurring events in Calendar API?

I try calendar.remove(event.id) -  no effect, delete only event with attribute id.rid==null
calendar.update(event,false) - updates all instances of the event, and creates a new one.
 
One more question:
How delete the properties of the CalendarEvent object - recurrenceRule and alarms?
I try set null or empty values event.alarms and event.recurrenceRule and then call calendar.update(event) - but it does  not work.

 

Edited by: Brock Boland on 17 Mar, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

2 Replies
Vineet Tiwari
function eventSearchSuccessCallbackForRemove(events) { console.log("-----------inside eventSearchSuccessCallbackForRemove"); if( events.length > 0) { myCalendar.remove(events[0].id); console.log("After removing event"); } } function errorCallbackForRemove(err) { console.log("error"); } function removeEvent() { myCalendar = tizen.calendar.getDefaultCalendar("EVENT"); myCalendar.find(eventSearchSuccessCallbackForRemove, errorCallbackForRemove); } This code removes First event
Gerasimenko
Yes, I know, it work fine. I mean recurring events https://developer.tizen.org/documentation/dev-guide Example of updating event, that was described in Dev Guide, does not work, and removal does not work too. var calendar = tizen.calendar.getDefaultCalendar("EVENT"); /* Get repeat event */ var event = calendar.get(evId); event.expandRecurrence(new tizen.TZDate(2012, 2, 1), new tizen.TZDate(2014, 2, 15), eventExpandSuccessCB, errorCallback); /* Success event handler */ function eventExpandSuccessCB(events) { /* Update the name of the second recurring event */ events[1].summary = 'updated summary'; calendar.update(events[1], false); /* Result: updates all instances of the event and create new */ /* Try delete second recurring event */ calendar.remove(events[1].id); /* Result: nothing happens */ } function errorCallback(err) { console.log("error"); }