From f0a8f24b59156edba7dfe9303508b5cc3059eca4 Mon Sep 17 00:00:00 2001 From: Jon Ziebell Date: Mon, 16 Dec 2019 22:27:00 -0500 Subject: [PATCH] Fixed #195 - Runtime Detail gets stuck when end date range is today --- js/component/card/runtime_detail.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/js/component/card/runtime_detail.js b/js/component/card/runtime_detail.js index 822d310..b81a578 100644 --- a/js/component/card/runtime_detail.js +++ b/js/component/card/runtime_detail.js @@ -72,11 +72,18 @@ beestat.component.card.runtime_detail.prototype.decorate_contents_ = function(pa ); } + // Don't go before there's data. required_begin = moment.max( required_begin, moment(thermostat.first_connected) ); + // Don't go after now. + required_end = moment.min( + required_end, + moment().subtract(1, 'hour') + ); + /** * If the needed data exists in the database and the runtime_thermostat * cache is empty, then query the data. If the needed data does not exist in