EKEventStore: all day events are created for the wrong day after changing the time zone

Originator:robotspacer
Number:rdar://19274432 Date Originated:16-Dec-2014 10:49 PM
Status:Open Resolved:
Product:OS X Product Version:10.10.1 (14B25)
Classification:Serious Bug Reproducible:Always
 
Summary:
EKEventStore seems to have some issues creating all day events correctly if the time zone changes while the app is running. If the time zone changes to just an hour earlier (say from EST to CST) then an all day event creating using the current date will appear on the previous day in the calendar app. I have not been able to find a workaround for this issue aside from quitting and reopening the app.

Steps to Reproduce:
1. Launch the attached sample project.
2. Open Calendar so you can see what's happening.
3. Build and run the sample app.
4. Open the File menu and choose "Add Event".
5. Note that an all day event named "Test event" has been created using the current date. The app logs the start and end times of the event: midnight in the current time zone, on the current day, until midnight on the next day.
6. Open System Preferences and select a time zone where the time is an hour earlier (or more).
7. Open the File menu and choose "Add Event".

Expected Results:
Another "Test event" should be created on the same day.

Actual Results:
The "Test event" is created for the previous day, even if the date is still the same in the new time zone. Note that the app logs the event with the exact same start and end time. If you quit and relaunch the app that will NOT be the case—it will create the event based on the current time zone, and in Calendar it will appear on the correct day.

Version:
10.10.1 (14B25)

Notes:
I have not been able to find any workaround for this. Calling reset on the event store and/or creating a new one don't seem to have any effect. Adjusting the time NSDate object used for startDate and endDate doesn't help—the time is ignored anyway.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!