GoogleカレンダーAPIで終日の予定を登録する
2009年12月8日
1件のコメント
NSDateComponentsを使って年月日のみを有効にします。
GDataEntryCalendarEvent *newEvent = [GDataEntryCalendarEvent calendarEvent]; GDataDateTime *startDateTime = [GDataDateTime dateTimeWithDate:salesDate timeZone:[NSTimeZone systemTimeZone]]; unsigned unitFlags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit; NSDateComponents *comps = [[NSCalendar currentCalendar] components:unitFlags fromDate:salesDate]; [startDateTime setDateComponents:comps]; GDataWhen *when = [GDataWhen whenWithStartTime:startDateTime endTime:nil]; [newEvent addTime:when];
カテゴリー:programming
calendar, google, iphone, objective-c, programming
最近のコメント