aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard/app
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2025-04-10 10:23:46 +0200
committerTaras Madan <tarasmadan@google.com>2025-04-10 19:10:32 +0000
commit1cacc015cc3921bcc1a20c4a5459917d14cf70fd (patch)
tree0f5bf3dac88314fb31f7562814f5b22909eed83c /dashboard/app
parent1bc60a19f725612590947493424fef2e314bd044 (diff)
dashboard/app: allow user defined dateto for coverage
It allows to see records older than 12 periods. And it allows to specify the target for coverage regression analysis.
Diffstat (limited to 'dashboard/app')
-rw-r--r--dashboard/app/coverage.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/dashboard/app/coverage.go b/dashboard/app/coverage.go
index 68f5459c4..9bc15c9f7 100644
--- a/dashboard/app/coverage.go
+++ b/dashboard/app/coverage.go
@@ -103,7 +103,14 @@ func handleHeatmap(c context.Context, w http.ResponseWriter, r *http.Request, f
return fmt.Errorf("periods_count is wrong, expected [1, 12]: %w", err)
}
- periods, err := coveragedb.GenNPeriodsTill(nPeriods, civil.DateOf(timeNow(c)), periodType)
+ dateTo := civil.DateOf(timeNow(c))
+ if customDate := r.FormValue("dateto"); customDate != "" {
+ if dateTo, err = civil.ParseDate(customDate); err != nil {
+ return fmt.Errorf("civil.ParseDate(%s): %w", customDate, err)
+ }
+ }
+
+ periods, err := coveragedb.GenNPeriodsTill(nPeriods, dateTo, periodType)
if err != nil {
return fmt.Errorf("%s: %w", err.Error(), ErrClientBadRequest)
}