1
0
mirror of https://github.com/beestat/app.git synced 2025-07-09 03:04:07 -04:00

Fixed #159 - Current month is missing from Runtime Summary

Needed to move end moment for bucket calculation.
This commit is contained in:
Jon Ziebell 2019-10-20 14:29:36 -04:00
parent e6600fecac
commit f141234b24

View File

@ -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) {