From 8e6293824b6c2a5126f5f3cb009fb22e5a8af3e2 Mon Sep 17 00:00:00 2001 From: Matt Lott Date: Wed, 11 May 2016 11:55:46 -0700 Subject: [PATCH] :bug:Fix admin demo requests 7-day average --- app/views/admin/DemoRequestsView.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/admin/DemoRequestsView.coffee b/app/views/admin/DemoRequestsView.coffee index 4f5ca49c2..9e5f0c407 100644 --- a/app/views/admin/DemoRequestsView.coffee +++ b/app/views/admin/DemoRequestsView.coffee @@ -26,7 +26,8 @@ module.exports = class DemoRequestsView extends RootView @dayCounts.push(day: day, count: count) @dayCounts.sort((a, b) -> b.day.localeCompare(a.day)) sevenCounts = [] - for dayCount in @dayCounts + for i in [@dayCounts.length - 1..0] + dayCount = @dayCounts[i] sevenCounts.push(dayCount.count) while sevenCounts.length > 7 sevenCounts.shift()