trendline accounting for today

This commit is contained in:
Radek Stepan 2013-09-26 21:18:22 +01:00
parent c8e91be427
commit 7d209034e3
1 changed files with 4 additions and 0 deletions

View File

@ -79,6 +79,10 @@ module.exports =
'trendline': (actual, created_at, due_on) ->
start = +actual[0].date
# Now is an actual point too.
last = actual[actual.length - 1]
actual.push { 'date': new Date(), 'points': last.points }
values = _.map actual, ({ date, points }) ->
[ +date - start, points ]