From 83a2f15fd095d65dd7ae0d58d3dbe628af3b3daa Mon Sep 17 00:00:00 2001 From: Taras Madan Date: Wed, 2 Oct 2024 11:27:29 +0200 Subject: dashboard/app: timeNow(c) not time.Now() --- dashboard/app/graphs.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'dashboard') diff --git a/dashboard/app/graphs.go b/dashboard/app/graphs.go index 742f048ca..501e405da 100644 --- a/dashboard/app/graphs.go +++ b/dashboard/app/graphs.go @@ -219,7 +219,7 @@ func handleHeatmap(c context.Context, w http.ResponseWriter, r *http.Request, f return fmt.Errorf("only day and month are allowed, but received %s instead, %w", periodType, ErrClientBadRequest) } - periods, err := coveragedb.GenNPeriodsTill(12, civil.DateOf(time.Now()), periodType) + periods, err := coveragedb.GenNPeriodsTill(12, civil.DateOf(timeNow(c)), periodType) if err != nil { return fmt.Errorf("%s: %w", err.Error(), ErrClientBadRequest) } @@ -308,7 +308,7 @@ func handleCoverageGraph(c context.Context, w http.ResponseWriter, r *http.Reque if err != nil { return err } - periodEndDates, err := coveragedb.GenNPeriodsTill(12, civil.DateOf(time.Now()), periodType) + periodEndDates, err := coveragedb.GenNPeriodsTill(12, civil.DateOf(timeNow(c)), periodType) if err != nil { return err } -- cgit mrf-deployment