🐛Fix admin demo requests 7-day average

This commit is contained in:
Matt Lott 2016-05-11 11:55:46 -07:00
parent 8bc9cd5ee6
commit 8e6293824b

View file

@ -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()