GTLCalendarEvent *calEvent = [GTLCalendarEvent object];
calEvent.summary = @"This is a test";
calEvent.start = [GTLCalendarEventDateTime object];
calEvent.end = [GTLCalendarEventDateTime object];
calEvent.start.date = [GTLDateTime dateTimeWithDate:dt1 timeZone:[NSTimeZone systemTimeZone]];
calEvent.start.date.hasTime = NO;
calEvent.end.date = [GTLDateTime dateTimeWithDate:dt2 timeZone:[NSTimeZone systemTimeZone]];
calEvent.end.date.hasTime = NO;
calEvent.start.dateTime = nil;
calEvent.end.dateTime = nil;
calEvent.reminders = [GTLCalendarEventReminders object];
calEvent.reminders.useDefault = [NSNumber numberWithBool:YES];
NSDate *dt1,*dt2;
dt1 = [NSDate date];
dt2 = [dt1 dateByAddingTimeInterval:24.0 * 60 * 60];
It simply doesn't work. Here is the code:GTLCalendarEvent *calEvent = [GTLCalendarEvent object];
calEvent.summary = @"This is a test";
calEvent.start = [GTLCalendarEventDateTime object];
calEvent.end = [GTLCalendarEventDateTime object];
calEvent.start.date = [GTLDateTime dateTimeWithDate:dt1 timeZone:[NSTimeZone systemTimeZone]];
calEvent.start.date.hasTime = NO;
calEvent.end.date = [GTLDateTime dateTimeWithDate:dt2 timeZone:[NSTimeZone systemTimeZone]];
calEvent.end.date.hasTime = NO;
calEvent.start.dateTime = nil;
calEvent.end.dateTime = nil;
calEvent.reminders = [GTLCalendarEventReminders object];
calEvent.reminders.useDefault = [NSNumber numberWithBool:YES];
On Monday, July 30, 2012 3:24:36 PM UTC-4, Greg Robbins wrote:The calendar start and end objects, GTLCalendarEventDateTime, have separate fields for date-time objects with and without times. So to specify an event being all day, the fields with times should be nil:GTLDateTime *startDateTime = [GTLDateTime dateTimeWithDate:... timeZone:...];startDateTime.hasTime = NO;GTLDateTime *endDateTime = [GTLDateTime dateTimeWithDate:... timeZone:...];endDateTime.hasTime = NO;newEvent.start.dateTime = nil;newEvent.start.date = startDateTime;newEvent.end.dateTime = nil;newEvent.end.date = endDateTime;
--To view this discussion on the web visit https://groups.google.com/d/msg/gdata-objectivec-client/-/T6qySrz85VgJ.
You received this message because you are subscribed to the Google Groups "Google Data APIs Objective-C Client Library Discussion" group.
To post to this group, send email to gdata-objec...@googlegroups.com.
To unsubscribe from this group, send email to gdata-objectivec-...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gdata-objectivec-client?hl=en.
To post to this group, send email to gdata-objectivec-client@googlegroups.com.
To unsubscribe from this group, send email to gdata-objectivec-client+unsub...@googlegroups.com.
Thanks. Setting the GTLDateTime in a separate statement then setting start.date to that worked.
That doesn't make sense to me based on what I thought I knew of obj-c! Any idea why? I experimented and did start.date = [[GTLDateTime dateTimeWithDate:dt timeZone...] retain] to no effect.
To view this discussion on the web visit https://groups.google.com/d/msg/gdata-objectivec-client/-/KLGZjsn5zNwJ.
To post to this group, send email to gdata-objec...@googlegroups.com.
To unsubscribe from this group, send email to gdata-objectivec-...@googlegroups.com.