Fix for task repeat not to spec throwing parse errors when syncing astrid.com

pull/14/head
Tim Su 13 years ago
parent 132f27963c
commit e194d12e6a

@ -967,7 +967,7 @@ public final class ActFmSyncService {
model.setValue(Task.COMPLETION_DATE, readDate(json, "completed_at"));
model.setValue(Task.CREATION_DATE, readDate(json, "created_at"));
model.setValue(Task.DELETION_DATE, readDate(json, "deleted_at"));
model.setValue(Task.RECURRENCE, json.optString("repeat", ""));
model.setValue(Task.RECURRENCE, filterRepeat(json.optString("repeat", "")));
if(json.optString("repeat", "").contains("FROM=COMPLETION"))
model.setFlag(Task.FLAGS, Task.FLAG_REPEAT_AFTER_COMPLETION, true);
else
@ -989,6 +989,11 @@ public final class ActFmSyncService {
metadata.add(tagMetadata);
}
}
/** Filter out FROM */
private static String filterRepeat(String repeat) {
return repeat.replaceAll("BYDAY=;","").replaceAll(";?FROM=[^;]*", "");
}
}
}

@ -60,6 +60,7 @@ public class RepeatDetailExposer extends BroadcastReceiver {
try {
rrule = new RRule(recurrence);
} catch (ParseException e) {
System.err.println(e.toString());
return null;
}

Loading…
Cancel
Save