Hi,
I'm having trouble getting the "all day" checkbox to show as checked
for single all day events.
Repeat events are not a problem, and by defining all day events as
00:00 until 00:00 the next day, Google Calendars displays the events
the same as other all day events (ie, as an "all day" bar at the top
of the day) but the checkbox "All Day" remains unchecked... which is a
problem when you want to then sync Google with other Calendar
software...
I found an old thread here (now closed for replies, relevant text
copied below) where Ronnotel wrote that he "modified When.Save
(XmlWriter writer)" to define dates as startTime.ToString("yyyy-MM-
dd") - but I'm unsure how to do this, or if it is safe - I don't want
that happening for non--all day events too.
Thanks for any help,
Neil
**********
from
http://groups.google.com/group/google-calendar-help-dataapi/browse_thread/thread/41129360d788fa74/7afd9a668063dedc?lnk=gst&q=all+day+flag#7afd9a668063dedc
:
I believe the problem is in the method:
When.Save(XmlWriter writer)
The logic will only write a UTC-type date string into the Xml string,
whereas dates need to be in the format yyyy-MM-dd for the event to be
interpreted as 'All-day'. I made the following mods to
When.Save(XmlWriter writer):
//string date = Utilities.LocalDateTimeInUTC(startTime);
string date = startTime.ToString("yyyy-MM-dd");
and
//string date = Utilities.LocalDateTimeInUTC(endTime);
string date = endTime.ToString("yyyy-MM-dd");
and then used the following code to define my event:
EventEntry appt = new EventEntry();
appt.Title.Text = "Test";
appt.Content.Content = "test";
When when = new When();
when.StartTime = new DateTime(2006, 5, 9);
when.EndTime = new DateTime(2006, 5, 10);
appt.Times.Add(when);
service.Insert(query.Uri, appt);
Result was a one-day event properly marked as 'All-Day'
--
You received this message because you are subscribed to the Google Groups
"Google Calendar Data API" group.
To post to this group, send email to
[email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-calendar-help-dataapi?hl=.