diff --git a/assets/goreportcard.css b/assets/goreportcard.css index ef89d03..7c4051f 100644 --- a/assets/goreportcard.css +++ b/assets/goreportcard.css @@ -1,3 +1,8 @@ +time { + border-bottom: 1px dashed; + line-height: 1.5em; + cursor: pointer; +} .header .is-active { font-weight: bold; } diff --git a/handlers/checks.go b/handlers/checks.go index ef75e7e..83e4448 100644 --- a/handlers/checks.go +++ b/handlers/checks.go @@ -49,7 +49,8 @@ func getFromCache(repo string) (checksResp, error) { } resp.LastRefresh = resp.LastRefresh.UTC() - resp.HumanizedLastRefresh = humanize.Time(resp.LastRefresh.UTC()) + resp.LastRefreshFormatted = resp.LastRefresh.Format(time.UnixDate) + resp.LastRefreshHumanized = humanize.Time(resp.LastRefresh.UTC()) return resp, nil } @@ -72,7 +73,8 @@ type checksResp struct { Repo string `json:"repo"` ResolvedRepo string `json:"resolvedRepo"` LastRefresh time.Time `json:"last_refresh"` - HumanizedLastRefresh string `json:"humanized_last_refresh"` + LastRefreshFormatted string `json:"formatted_last_refresh"` + LastRefreshHumanized string `json:"humanized_last_refresh"` } func newChecksResp(repo string, forceRefresh bool) (checksResp, error) { @@ -142,12 +144,14 @@ func newChecksResp(repo string, forceRefresh bool) (checksResp, error) { }(c) } + t := time.Now().UTC() resp := checksResp{ Repo: repo, ResolvedRepo: repoRoot.Repo, Files: len(filenames), - LastRefresh: time.Now().UTC(), - HumanizedLastRefresh: humanize.Time(time.Now().UTC()), + LastRefresh: t, + LastRefreshFormatted: t.Format(time.UnixDate), + LastRefreshHumanized: humanize.Time(t), } var total, totalWeight float64 diff --git a/templates/report.html b/templates/report.html index ea18395..5a8f936 100644 --- a/templates/report.html +++ b/templates/report.html @@ -159,7 +159,10 @@