diff --git a/cmd/http/router.go b/cmd/http/router.go index 1458760..5ddabd3 100644 --- a/cmd/http/router.go +++ b/cmd/http/router.go @@ -172,9 +172,9 @@ func (router Router) APITrends(w http.ResponseWriter, r *http.Request) { } } - pie("Median Spending", `Withdrawal:[0-9]*`, 50) - pie("Median Spending (detailed)", `Withdrawal:[0-9]*:[^:]*`, 25) - pie("Median Spending (MORE detailed)", `Withdrawal:[0-9]*:[^:]*:[^:]*`, 10) + pie(fmt.Sprintf("Median Monthly Spending Since %dmo ago", int(recent/time.Hour/24/30)), `Withdrawal:[0-9]*`, 50) + pie("Median Monthly Spending (detailed)", `Withdrawal:[0-9]*:[^:]*`, 25) + pie("Median Monthly Spending (MORE detailed)", `Withdrawal:[0-9]*:[^:]*:[^:]*`, 10) } func (router Router) APIAmend(w http.ResponseWriter, r *http.Request) {