Time Range Error

2,069 views
Skip to first unread message

Jeff

unread,
Feb 13, 2012, 11:06:06 AM2/13/12
to google-ca...@googlegroups.com
Hello,
 
I am creating calendar events using the Calendar API v3 (.NET).  I can use the events QuickAdd method but receive an errror when using the events Insert method (see below).  I am not seeing much on the time max parameter..  Here is my code (from the sample).  I have played with the dates and timezones but have not been successful.  Thanks.
 
ERROR:
 
Google.Apis.Requests.RequestError
The specified time range is empty. [400]
Errors [
 Message[The specified time range is empty.] Location[timeMax - parameter] Reason[timeRangeEmpty] Domain[calendar]
 
CODE:
            Event aEvent = new Event()     
            {
                Description = "Test API",
                Summary = "Appointment",   
                Location = "Nowhere",
                Start = new EventDateTime() 
                { 
                    DateTime = "2012-04-03T10:00:00.000"
                },       
                End = new EventDateTime() 
                { 
                    DateTime = "2011-04-03T11:00:00.000" 
                },       
            };
            try
            {
                Event createdEvent = service.Events.Insert(aEvent, "primary").Fetch();
                Console.WriteLine(createdEvent.Id);
            }
            catch (Exception e)
            {
                string x = e.Message;
            }

Jeff

unread,
Feb 13, 2012, 12:21:39 PM2/13/12
to google-ca...@googlegroups.com
Resolved by fixing the end date (oops) and adding time zone.  The error was on the .Fetch with the newly created event ID.
Reply all
Reply to author
Forward
0 new messages