From 97264545d83773d2036c712ef485bb6b0b8faec0 Mon Sep 17 00:00:00 2001 From: Alex Baker Date: Sat, 1 Aug 2020 08:00:40 -0500 Subject: [PATCH] Fix due time when rescheduling via drag and drop --- .../main/java/com/todoroo/astrid/adapter/TaskAdapter.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/todoroo/astrid/adapter/TaskAdapter.kt b/app/src/main/java/com/todoroo/astrid/adapter/TaskAdapter.kt index 6f035d22b..b01f68bd0 100644 --- a/app/src/main/java/com/todoroo/astrid/adapter/TaskAdapter.kt +++ b/app/src/main/java/com/todoroo/astrid/adapter/TaskAdapter.kt @@ -213,10 +213,10 @@ open class TaskAdapter( private suspend fun applyDate(task: Task, date: Long) { val original = task.dueDate - task.setDueDateAdjustingHideUntil(if (date == 0L) { - 0L - } else { - date.toDateTime().withMillisOfDay(task.dueDate.toDateTime().millisOfDay).millis + task.setDueDateAdjustingHideUntil(when { + date == 0L -> 0L + task.hasDueTime() -> date.toDateTime().withMillisOfDay(task.dueDate.toDateTime().millisOfDay).millis + else -> Task.createDueDate(Task.URGENCY_SPECIFIC_DAY, date) }) if (original != task.dueDate) { taskDao.save(task)