summaryrefslogtreecommitdiff
path: root/system/api/analytics
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2016-11-04 11:27:54 -0700
committerSteve Manuel <nilslice@gmail.com>2016-11-04 11:27:54 -0700
commitfd95f0b55ca5ee2a924194e269329ea5c723ae9e (patch)
treeead16c0b96c1dba8998702974c18c6f09f982303 /system/api/analytics
parent5606b5740c8e8714b25b011e22290989c1a92716 (diff)
reverting to UTC and reducing the check for len(times) to be n-1
Diffstat (limited to 'system/api/analytics')
-rw-r--r--system/api/analytics/init.go4
1 files changed, 2 insertions, 2 deletions
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]++