Google Calendar All Day Events

Common Elements: “Kinds” – Google Data Protocol – Google Code.

All day events coming down from the Google Calendar have dates, but don’t have a time. If you convert that directly to a time, you might wind up applying the GMT offset and get a date/time that’s several hours before the day of the event.

And as this entry states…

Keep in mind that reminders for “All Day” events are based on 5:00 pm the day before the event (according to your current time zone). So, if you choose to receive your reminder 10 minutes before your “All Day” event on August 24th, you’ll be reminded on August 23rd at 4:50 pm.

So, there’s a check on the GDataWhen class for hasTime. If that’s false, you can set the start/end times as the beginning/end of the date.

[sourcecode]

NSDate *date = [[when startTime] date];
if (![[when startTime] hasTime])
date = [Constants dateStartOfNextDay:date];
[/sourcecode]