diff options
| author | James Barnett <noreply@jamesbarnett.xyz> | 2018-04-01 23:18:28 +0100 |
|---|---|---|
| committer | James Barnett <noreply@jamesbarnett.xyz> | 2018-04-01 23:18:28 +0100 |
| commit | 5fac63cf5fa974d9723617bc2bfa8f4e668fe342 (patch) | |
| tree | c8d887f2bfa140ca1b7e00bb02a692ed62fe83ef /routes/energy-usage.js | |
| parent | 567bea38fd7524e5e41fc5d09036cf86ad3932cd (diff) | |
| download | tplink-energy-monitor-5fac63cf5fa974d9723617bc2bfa8f4e668fe342.tar.xz tplink-energy-monitor-5fac63cf5fa974d9723617bc2bfa8f4e668fe342.zip | |
Show total and average usage for current day and month
Diffstat (limited to 'routes/energy-usage.js')
| -rw-r--r-- | routes/energy-usage.js | 4 |
1 files changed, 2 insertions, 2 deletions
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; |