From f141234b2460baa8663bd4703ae023bf3b096148 Mon Sep 17 00:00:00 2001 From: Jon Ziebell Date: Sun, 20 Oct 2019 14:29:36 -0400 Subject: [PATCH] Fixed #159 - Current month is missing from Runtime Summary Needed to move end moment for bucket calculation. --- js/component/card/runtime_thermostat_summary.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/js/component/card/runtime_thermostat_summary.js b/js/component/card/runtime_thermostat_summary.js index a18b083..35f056a 100755 --- a/js/component/card/runtime_thermostat_summary.js +++ b/js/component/card/runtime_thermostat_summary.js @@ -191,7 +191,14 @@ beestat.component.card.runtime_thermostat_summary.prototype.get_data_ = function : beestat.setting('runtime_thermostat_summary_group_by') ); } - var end_m = moment(); + + // Make sure the current month, etc gets included (see #159). + var end_m = moment() + .endOf( + beestat.setting('runtime_thermostat_summary_group_by') === 'week' + ? 'isoweek' + : beestat.setting('runtime_thermostat_summary_group_by') + ); var current_m = begin_m; while (current_m.isSameOrAfter(end_m) === false) {