Posted by: bearc0025 | July 7, 2010

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.


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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: