From fd95f0b55ca5ee2a924194e269329ea5c723ae9e Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Fri, 4 Nov 2016 11:27:54 -0700 Subject: reverting to UTC and reducing the check for len(times) to be n-1 --- system/api/analytics/init.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system') diff --git a/system/api/analytics/init.go b/system/api/analytics/init.go index 95123ba..e118f89 100644 --- a/system/api/analytics/init.go +++ b/system/api/analytics/init.go @@ -114,7 +114,7 @@ func Week() (map[string]interface{}, error) { times := [7]time.Time{} dates := [7]string{} now := time.Now() - today := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local) + today := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.UTC) for i := range times { // subtract 24 * i hours to make days prior @@ -168,7 +168,7 @@ CHECK_REQUEST: for j := range times { // if on today, there will be no next iteration to set values for // day prior so all valid requests belong to today - if j == len(times) { + if j == len(times)-1 { if ts.After(times[j]) || ts.Equal(times[j]) { // do all record keeping total[j]++ -- cgit v1.2.3