Reputation: 583
Iam working with C# and the Google Calendar API classes "CalendarService" and "Event". I want to upload an event to Google Calendar without any date (all-day). If i don't set the Event.End property, I get an exception.
How can I set my event as an all-day event ?
I've searched for a long time, without any solution...
Upvotes: 3
Views: 3067
Reputation: 175
Isn´t the marked answer Java???
He asked about c#.
Event newEvent = new Event()
{
Summary = "5ummary",
Location = "location avenue",
Description = "description",
Start = new EventDateTime()
{
Date = "2015-08-07",
},
End = new EventDateTime()
{
Date = "2015-08-07",
},
};
Upvotes: 2
Reputation: 58962
Add a new time with AllDay
set to true:
var entry = new EventEntry(title, description, "");
var time = new When();
time.StartTime = start;
time.AllDay = true;
entry.Times.Add(time);
Upvotes: 4