From b10587662d35bef3a3d08af81ec9a05784132cc5 Mon Sep 17 00:00:00 2001 From: Alex Baker Date: Mon, 18 Nov 2019 17:10:10 -0600 Subject: [PATCH] Set DtStart on recurring tasks --- app/src/main/java/org/tasks/caldav/CaldavConverter.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/org/tasks/caldav/CaldavConverter.java b/app/src/main/java/org/tasks/caldav/CaldavConverter.java index 338f59adf..452d7c3a6 100644 --- a/app/src/main/java/org/tasks/caldav/CaldavConverter.java +++ b/app/src/main/java/org/tasks/caldav/CaldavConverter.java @@ -23,6 +23,7 @@ import net.fortuna.ical4j.model.DateTime; import net.fortuna.ical4j.model.Property; import net.fortuna.ical4j.model.Recur; import net.fortuna.ical4j.model.property.Completed; +import net.fortuna.ical4j.model.property.DtStart; import net.fortuna.ical4j.model.property.Due; import net.fortuna.ical4j.model.property.RRule; import net.fortuna.ical4j.model.property.RelatedTo; @@ -151,6 +152,10 @@ public class CaldavConverter { try { String rrule = task.getRecurrenceWithoutFrom().replace("RRULE:", ""); remote.setRRule(new RRule(rrule)); + if (remote.getDtStart() == null) { + Date date = remote.getDue() != null ? remote.getDue().getDate() : new Date(); + remote.setDtStart(new DtStart(date)); + } } catch (ParseException e) { Timber.e(e); }