raphaeloliveira / google-api-objectivec-client

Automatically exported from code.google.com/p/google-api-objectivec-client
0 stars 0 forks source link

Due date cannot be set in Google Tasks API #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create: [GTLTasksTask object]
2. Set due date: patchObject.due = [GTLDateTime dateTimeWithDate:...];
3. Create: GTLQueryTasks *query = [GTLQueryTasks 
queryForTasklistsPatchWithObject:patchObject ...]
4. Execute: [tasksService executeQuery:query completionHandler:...]
5. Watch the error occur in completion handler.

What is the expected output? What do you see instead?

I expect the due date to be set. 
Instead, I see the following error:
------------
Error Domain=com.google.GTLJSONRPCErrorDomain Code=400 "The operation 
couldn’t be completed. (Bad Request)" UserInfo=0x6dac300 
{NSLocalizedFailureReason=(Bad Request), GTLStructuredError=GTLErrorObject 
0x6da0d20: {message:"Bad Request" data:[1] code:400}, error=Bad Request}
-------------

What version of the product are you using? On what operating system?
Just downloaded the latest version from SVN. 
Using iOS 4.3

Please provide any additional information below.

Original issue reported on code.google.com by kazushi....@gmail.com on 30 Sep 2011 at 10:42

GoogleCodeExporter commented 9 years ago
Use +queryForTasksPatchWithObject:tasklist:task: to set the due date of a task.

Note that +queryForTasklistsPatchWithObject: does not take a task identifier as 
a parameter.

Original comment by grobb...@google.com on 30 Sep 2011 at 9:17

GoogleCodeExporter commented 9 years ago
Sorry, that was a copy & paste problem.. the step #3 actually uses 
[queryForTasksPatchWithObject:tasklist:task]

I think I found the root of the problem: whenever you create a GTLDateTime 
using [GTLDateTime dateTimeWithDate:], if the NSDate object contains a 
millisecond (such as [NSDate date]), then the 
[queryForTasksPatchWithObject:tasklist:task] works. If NSDate object does not 
contain milliseconds (such as [NSDate 
dateWithTimeIntervalSinceReferenceDate:(pass int here)]), then the update 
fails. 

GTLDateTime has a property called "milliseconds" and I think there's a bug 
around that. 

Original comment by kazushi....@gmail.com on 30 Sep 2011 at 10:49

GoogleCodeExporter commented 9 years ago
Re-opening for investigation.

Original comment by grobb...@google.com on 30 Sep 2011 at 11:11

GoogleCodeExporter commented 9 years ago
Filed internally as a Tasks API server bug, b/5399288

Original comment by grobb...@google.com on 30 Sep 2011 at 11:41

GoogleCodeExporter commented 9 years ago
How to remove the due date?

Original comment by 4341...@gmail.com on 13 Dec 2011 at 5:14