From eeea4dd1492685d024f56eddc13ba5d5f6de4ac8 Mon Sep 17 00:00:00 2001 From: Aline Abler Date: Fri, 28 Jun 2024 09:41:03 +0200 Subject: [PATCH] Fix scheduling for week N --- task/task.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/task/task.go b/task/task.go index 2ed1d04..da337a5 100644 --- a/task/task.go +++ b/task/task.go @@ -196,9 +196,11 @@ func (w MergeWindow) checkIsoWeek(t time.Time) (bool, error) { return iw%2 == 0, nil case "@odd": return iw%2 == 1, nil - case strconv.Itoa(iw): - return true, nil - default: - return false, fmt.Errorf("unknown iso week: %s", w.Schedule.IsoWeek) } + nw, err := strconv.ParseInt(w.Schedule.IsoWeek, 10, 64) + if err == nil { + return nw == int64(iw), nil + } + + return false, fmt.Errorf("unknown iso week: %s", w.Schedule.IsoWeek) }