aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2024-10-02 11:27:29 +0200
committerTaras Madan <tarasmadan@google.com>2024-10-02 09:40:02 +0000
commit83a2f15fd095d65dd7ae0d58d3dbe628af3b3daa (patch)
tree610044293c589bd55db9bf6661da1eeb44a98aeb
parent1b1436f96458d8d3168370f927b997633ea29c9a (diff)
dashboard/app: timeNow(c) not time.Now()
-rw-r--r--dashboard/app/graphs.go4
1 files changed, 2 insertions, 2 deletions
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
}