Bug in GDataDateTime.m

6 views
Skip to first unread message

Dave

unread,
Mar 5, 2008, 6:36:01 PM3/5/08
to Google Data APIs Objective-C Client Library Discussion
Years in -RFC3339String need to be 4 digits. I.e., this statement:

NSString *dateString = [NSString stringWithFormat:@"%d-%02d-%02d%@",
[dateComponents year], [dateComponents month], [dateComponents
day],
timeString];

needs to be changed to:

NSString *dateString = [NSString stringWithFormat:@"%04d-%02d-%02d
%@",
[dateComponents year], [dateComponents month], [dateComponents
day],
timeString];

I actually had a customer with an event in AD 950, and that caused the
following invalid request and error response:

<gd:when startTime="950-03-22T16:00:00-08:00"
endTime="950-03-22T17:00:00-08:00"></gd:when>
...
<batch:interrupted error="0" unprocessed="0" reason="[Line 1,
Column 692, element gd:when] Invalid date/time value." success="0"
parsed="0"></batch:interrupted>

Greg Robbins

unread,
Mar 5, 2008, 7:11:56 PM3/5/08
to gdata-objec...@googlegroups.com
 NSString *dateString = [NSString stringWithFormat:@"%d-%02d-%02d%@",
   [dateComponents year], [dateComponents month], [dateComponents
day],
   timeString];

needs to be changed to:

 NSString *dateString = [NSString stringWithFormat:@"%04d-%02d-%02d
%@",
   [dateComponents year], [dateComponents month], [dateComponents
day],
   timeString];


That looks reasonable.
 
I actually had a customer with an event in AD 950, and that caused the
following invalid request and error response:

I apologize if the error caused your customer to be late for the event.
 

Juan Ignacio Leon

unread,
Mar 5, 2008, 7:18:43 PM3/5/08
to gdata-objec...@googlegroups.com

I apologize if the error caused your customer to be late for the event.


Well played...
JI 

 
Reply all
Reply to author
Forward
0 new messages