I want to know how to delete a single occurrence of recurring calendar event programmatically.
Using eventList.removeEvent(event) deletes the whole series from the calendar.
I have also tried getting enumeration from eventList.items(BlackberryEventList.OCCURRING, startDate, endDate, true) and then deleting the event whose start date and end date is matched but still it deletes the whole series. According to the api this function should return me the first instance of recurring event when I specify true in the last parameter.
Instead of removing event try to update repeat rule of the particular event.
Take a look at the following methods/classes:
setRepeat() method of Event class
RepeatRule class
addExceptDate() method of RepeatRule class
Related
I'm struggling with deleting a single event of a recurring event series.
In this case I set up a weekly recurring event and tried to delete one event with the following code:
let event = self.eventStore.event(withIdentifier: eventID)
try! self.eventStore.remove(event, span: EKSpan.thisEvent)
The result was that the first event of the occurrence has been deleted (not the third occurrence I selected). Am I missing something?
Currently I'm using Eventstore (by Greg Young) for my company project. In my read model, I store the processed event ids, not the event name. How can I find the event in Eventstore using its Id?
I don't think this is possible currently. I think you have two choices:
in your read model store the stream and index, or the commit/prepare position of the event and then read the event from either the $all stream using the commit/prepare position or from the stream it was written to using the stream and index. This is probably the simplest.
Or create a projection in event store which indexes the events by their id and reprojects into a stream called, say, eventid-{event.id} then you can read directly from this stream.
The second is backwards compatible with your current read model, but I'm not sure is the right thing to do, as projections cause write amplification, and you probably need to make sure you exclude system events from being projected.
You can query the event using the following URL path. This will return the event and the last 20 events before it
{youreventstoredomain}:2113/web/index.html#/streams/$ce-{streamname}/{eventnumber}/backward/20
I'm inserting events into my Calendar, and just saw that not every event gets saved.
One day I should have 3 events saved, but only the first and the last shows up in the calendar. I've printed the results, no error occurs when I save the events in the eventStore.
Steps:
Have a loop creating EKEvents and saving them in the EventStore with commit:false, then after finished call commit() on the EventStore.
I get no errors, but missing some events in the Calendar, any ideas how to find the source of this problem?
Thank you in advance!
I would like to decline one instance of recurring meeting. I only have masterSerieId, iCalId, time of that instance.
Do you know how I could cancel that instance?
Do I have to query using masterId and time of the instance to find event id or there is a way I would just find eventId using iCalId?
You can use OData query options to filter on just the event that has that particular iCalUId.
For instance:
GET https://graph.microsoft.com/v1.0/me/events?$filter=iCalUId eq '<your iCalUId>'
Sadly the calendar view endpoint does not include events which are part of an event series if you match against a given iCalUId.
So if an event has a seriesMasterId which is not null, you wont find it by filtering for the iCalUId.
I fetched a list of all events and try to match it with my current events about to be added, but it never matches and just add duplicates.
The code I used to fetch is from apple's document. Can anyone help?
http://developer.apple.com/library/ios/#documentation/DataManagement/Conceptual/EventKitProgGuide/ReadingAndWritingEvents.html#//apple_ref/doc/uid/TP40004775-SW1
Code from another tutorial (I scourged the net but couldn't find how to match events. the fetch predicates results title string comparison did not work)
http://neilang.com/entries/using-eventkit-in-ios/
I found out that one can save the eventstore event unique identifier immediately after saving. And with this identifier one can get the events back.