From b9160bf681c2911a9551cfc672872ecc10776af9 Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Sat, 21 Dec 2024 01:49:04 -0500 Subject: [PATCH] Fix #53 Completing a task multiple times with "Reschedule from completion date" pushes it further into the future --- internal/chore/scheduler.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/internal/chore/scheduler.go b/internal/chore/scheduler.go index cec120d..84b4c81 100644 --- a/internal/chore/scheduler.go +++ b/internal/chore/scheduler.go @@ -42,14 +42,6 @@ func scheduleNextDueDate(chore *chModel.Chore, completedDate time.Time) (*time.T baseDate = time.Date(baseDate.Year(), baseDate.Month(), baseDate.Day(), t.Hour(), t.Minute(), 0, 0, t.Location()) } - if chore.IsRolling && chore.NextDueDate.Before(completedDate) { - // we need to check if chore due date is before the completed date to handle this senario: - // if user trying to complete chore due in future (multiple time for insance) due date will be calculated - // from the last completed date and due date change only in seconds. - // this make sure that the due date is always in future if the chore is rolling - - baseDate = completedDate.UTC() - } if chore.FrequencyType == "daily" { nextDueDate = baseDate.AddDate(0, 0, 1)