From e9a5baabee281e681ee9e523b067e777ff51e90c Mon Sep 17 00:00:00 2001 From: Alex Baker Date: Thu, 1 Nov 2018 16:03:54 -0500 Subject: [PATCH] Set CalDAV completion percentage --- app/src/main/java/org/tasks/caldav/CaldavConverter.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/tasks/caldav/CaldavConverter.java b/app/src/main/java/org/tasks/caldav/CaldavConverter.java index 1f5388f06..bc0d8740b 100644 --- a/app/src/main/java/org/tasks/caldav/CaldavConverter.java +++ b/app/src/main/java/org/tasks/caldav/CaldavConverter.java @@ -128,8 +128,13 @@ public class CaldavConverter { } else { remote.setDue(null); } - remote.setCompletedAt( - task.isCompleted() ? new Completed(new DateTime(task.getCompletionDate())) : null); + if (task.isCompleted()) { + remote.setCompletedAt(new Completed(new DateTime(task.getCompletionDate()))); + remote.setPercentComplete(100); + } else if (remote.getCompletedAt() != null) { + remote.setCompletedAt(null); + remote.setPercentComplete(0); + } if (task.isRecurring()) { try { String rrule = task.getRecurrenceWithoutFrom().replace("RRULE:", "");