Permalink
Browse files

resolved due date bug

  • Loading branch information...
1 parent 199c7a5 commit 5d9b411bc56e2ec8385d2179ee0161cb59c6c351 Gerhard Schraml committed Jan 19, 2010
Showing with 42 additions and 8 deletions.
  1. +41 −7 Classes/SyncManager.m
  2. +1 −1 toodledo-objc
View
@@ -797,8 +797,15 @@ -(BOOL)syncTasksMatchDates
localTask.creationDate = remoteTask.date_created;
//localTask.lastLocalModification = remoteTask.date_modified;
localTask.startDateAnnoy = remoteTask.date_start; // ???
- localTask.dueDate = remoteTask.date_due;
- localTask.dueTime = remoteTask.date_due;
+
+ if(remoteTask.hasDueDate)
+ localTask.dueDate = remoteTask.date_due;
+ else
+ localTask.dueDate = nil;
+ if(remoteTask.hasDueTime)
+ localTask.dueTime = remoteTask.date_due;
+ else
+ localTask.dueTime = nil;
NSMutableArray *tagsToRemove = [NSMutableArray array];
for(Tag *tag in localTask.tags)
@@ -887,8 +894,14 @@ -(BOOL)syncTasksMatchDates
newTask.creationDate = remoteTask.date_created;
newTask.modificationDate = remoteTask.date_modified;
newTask.startDateAnnoy = remoteTask.date_start; // ???
- newTask.dueDate = remoteTask.date_due;
- newTask.dueTime = remoteTask.date_due;
+ if(remoteTask.hasDueDate)
+ newTask.dueDate = remoteTask.date_due;
+ else
+ newTask.dueDate = nil;
+ if(remoteTask.hasDueTime)
+ newTask.dueTime = remoteTask.date_due;
+ else
+ newTask.dueTime = nil;
for(NSString *remoteTag in remoteTask.tags)
{
@@ -1153,7 +1166,14 @@ -(BOOL)syncTasksPreferLocal
newTask.creationDate = remoteTask.date_created;
newTask.modificationDate = remoteTask.date_modified;
newTask.startDateAnnoy = remoteTask.date_start; // ???
- newTask.dueDate = remoteTask.date_due;
+ if(remoteTask.hasDueDate)
+ newTask.dueDate = remoteTask.date_due;
+ else
+ newTask.dueDate = nil;
+ if(remoteTask.hasDueTime)
+ newTask.dueTime = remoteTask.date_due;
+ else
+ newTask.dueTime = nil;
for(NSString *remoteTag in remoteTask.tags)
{
@@ -1394,7 +1414,14 @@ -(BOOL)syncTasksPreferRemote
localTask.creationDate = remoteTask.date_created;
//localTask.lastLocalModification = remoteTask.date_modified;
localTask.startDateAnnoy = remoteTask.date_start; // ???
- localTask.dueDate = remoteTask.date_due;
+ if(remoteTask.hasDueDate)
+ localTask.dueDate = remoteTask.date_due;
+ else
+ localTask.dueDate = nil;
+ if(remoteTask.hasDueTime)
+ localTask.dueTime = remoteTask.date_due;
+ else
+ localTask.dueTime = nil;
NSMutableArray *tagsToRemove = [NSMutableArray array];
for(Tag *tag in localTask.tags)
@@ -1476,7 +1503,14 @@ -(BOOL)syncTasksPreferRemote
newTask.creationDate = remoteTask.date_created;
newTask.modificationDate = remoteTask.date_modified;
newTask.startDateAnnoy = remoteTask.date_start; // ???
- newTask.dueDate = remoteTask.date_due;
+ if(remoteTask.hasDueDate)
+ newTask.dueDate = remoteTask.date_due;
+ else
+ newTask.dueDate = nil;
+ if(remoteTask.hasDueTime)
+ newTask.dueTime = remoteTask.date_due;
+ else
+ newTask.dueTime = nil;
for(NSString *remoteTag in remoteTask.tags)
{

0 comments on commit 5d9b411

Please sign in to comment.