Clear caldav status and progress when incompleting

pull/757/head
Alex Baker 6 years ago
parent e9a5baabee
commit 3880639f93

@ -18,6 +18,7 @@ import net.fortuna.ical4j.model.Recur;
import net.fortuna.ical4j.model.property.Completed; import net.fortuna.ical4j.model.property.Completed;
import net.fortuna.ical4j.model.property.Due; import net.fortuna.ical4j.model.property.Due;
import net.fortuna.ical4j.model.property.RRule; import net.fortuna.ical4j.model.property.RRule;
import net.fortuna.ical4j.model.property.Status;
import org.tasks.data.CaldavTask; import org.tasks.data.CaldavTask;
import timber.log.Timber; import timber.log.Timber;
@ -130,10 +131,12 @@ public class CaldavConverter {
} }
if (task.isCompleted()) { if (task.isCompleted()) {
remote.setCompletedAt(new Completed(new DateTime(task.getCompletionDate()))); remote.setCompletedAt(new Completed(new DateTime(task.getCompletionDate())));
remote.setStatus(Status.VTODO_COMPLETED);
remote.setPercentComplete(100); remote.setPercentComplete(100);
} else if (remote.getCompletedAt() != null) { } else if (remote.getCompletedAt() != null) {
remote.setCompletedAt(null); remote.setCompletedAt(null);
remote.setPercentComplete(0); remote.setStatus(null);
remote.setPercentComplete(null);
} }
if (task.isRecurring()) { if (task.isRecurring()) {
try { try {

Loading…
Cancel
Save