0

Is it possible that the function: predicateForEventsWithStartDate(startDate: NSDate, endDate: NSDate, calendars:[EKCalendar]) is not working as described in the documentation!? The enddate seems to work as expected, taking into account the day and the time of the date. But when retrieving the events for the predicate, events being on the startdate X (and later than the time of the start date) are never fetched. As soon as I set the startdate to 23:59 the previous day of X, all events of day X are fetched as expected.

Has anybody experienced this behaviour? Or is the documentation not correct and this is the expected behavoir?

Note: Tried on Iphone 6(iOS8) / Ipad mini 3(iOS8) / iPhone 5 (iOS 9)

EDIT: here is the documentiation of the method:

func predicateForEventsWithStartDate(_ startDate: NSDate,
                         endDate endDate: NSDate,
                       calendars calendars: [EKCalendar]?) -> NSPredicate

Creates and returns a predicate for finding events in the event store that fall within a given date range.

startDate
The start date of the range of events fetched.

endDate The end date of the range of events fetched.

calendars
The calendars to search, as an array of EKCalendar objects. Passing nil indicates to search all calendars.

Tine
  • 1
  • 1
  • Please do not expect us to consult the documentation and add the text or a link to it. – Dirk Horsten Sep 23 '15 at 07:20
  • I use it and found that the end-date seems to need a tweak for an hour (might be some limit problem and not very relevant in my case). Else I get what I need. – qwerty_so Sep 23 '15 at 13:04
  • So if you lets say have startdate= 2015-01-01 00:00 and enddate= 2015-01-02 23:59 , do you actualle get events for the first day ? because for me, i only get events for the second day... – Tine Sep 23 '15 at 14:33

0 Answers0