From 5fac63cf5fa974d9723617bc2bfa8f4e668fe342 Mon Sep 17 00:00:00 2001 From: James Barnett Date: Sun, 1 Apr 2018 23:18:28 +0100 Subject: Show total and average usage for current day and month --- routes/energy-usage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'routes') diff --git a/routes/energy-usage.js b/routes/energy-usage.js index 740e29e..eb21eb9 100644 --- a/routes/energy-usage.js +++ b/routes/energy-usage.js @@ -130,9 +130,9 @@ function fillMissingMonths(sparseMonthStats, statsMoment) { let denseMonthStats = []; let maxMonths; - // Dont fill months in months which havent happened yet + // Dont fill in months which exist in the future if(statsMoment.year() === moment().year()) { - maxMonths = moment().month(); + maxMonths = moment().month() + 1; // API months are 1 based } else { maxMonths = 12; -- cgit v1.2.3