From 5daa8baba86d2fab0aff537e3414cfcd201d13b1 Mon Sep 17 00:00:00 2001 From: Hafiz Date: Tue, 2 Jan 2024 09:17:26 -0500 Subject: [PATCH] Handle if no days are selected for a weekly --- .../java/com/habitrpg/android/habitica/models/tasks/Task.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Habitica/src/main/java/com/habitrpg/android/habitica/models/tasks/Task.kt b/Habitica/src/main/java/com/habitrpg/android/habitica/models/tasks/Task.kt index ecac4a46c..c596e9a5d 100644 --- a/Habitica/src/main/java/com/habitrpg/android/habitica/models/tasks/Task.kt +++ b/Habitica/src/main/java/com/habitrpg/android/habitica/models/tasks/Task.kt @@ -379,7 +379,8 @@ open class Task : RealmObject, BaseMainObject, Parcelable, BaseTask { // Set to start date if current date is earlier if (dateTimeOccurenceToSchedule.isBefore(startDate)) { dateTimeOccurenceToSchedule = startDate - } else { + } else if (repeatDays?.hasAnyDaySelected() == true) { + var nextDueDate = dateTimeOccurenceToSchedule.withHour(reminderTime.hour).withMinute(reminderTime.minute) // If the next due date already happened for today, increment it by one day. Otherwise, it will be scheduled for today. if (nextDueDate.isBefore(now) && occurrencesList.size == 0) {