Fix basic hourly and weekly recurrence

pull/2598/head
Alex Baker 8 months ago
parent 78b2cdac06
commit 58edc6b4d8

@ -154,7 +154,7 @@ class RepeatTaskHelper @Inject constructor(
recur: Recur, original: DateTime, hasDueTime: Boolean): Long {
val byDay = recur.dayList
var newDate = original.millis
newDate += DateUtilities.ONE_WEEK * (recur.interval - 1)
newDate += DateUtilities.ONE_WEEK * (recur.interval.coerceAtLeast(1) - 1)
var date = DateTime(newDate)
Collections.sort(byDay, weekdayCompare)
val next = findNextWeekday(byDay, date)
@ -263,7 +263,7 @@ class RepeatTaskHelper @Inject constructor(
else -> throw RuntimeException(
"Error handing subday repeat: " + recur.frequency) // $NON-NLS-1$
}
val newDueDate = startDate.millis + millis * recur.interval
val newDueDate = startDate.millis + millis * recur.interval.coerceAtLeast(1)
return createDueDate(Task.URGENCY_SPECIFIC_DAY_TIME, newDueDate)
}

Loading…
Cancel
Save