From 7d209034e30a09ff61f794bcba14bcc70928be08 Mon Sep 17 00:00:00 2001 From: Radek Stepan Date: Thu, 26 Sep 2013 21:18:22 +0100 Subject: [PATCH] trendline accounting for today --- src/modules/graph.coffee | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/graph.coffee b/src/modules/graph.coffee index 2020c11..b5e2f6d 100644 --- a/src/modules/graph.coffee +++ b/src/modules/graph.coffee @@ -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 ]