widbaroalarm settings graph: fix off by one

master
Erik Andresen 2024-02-10 17:18:51 +01:00
parent dc4b2dd741
commit f75d97662a
1 changed files with 1 additions and 1 deletions

View File

@ -118,7 +118,7 @@
const now = new Date()/(1000); const now = new Date()/(1000);
let curtime = now-3*60*60; // 3h ago let curtime = now-3*60*60; // 3h ago
const data = []; const data = [];
while (curtime < now) { while (curtime <= now) {
// find closest value in history for this timestamp // find closest value in history for this timestamp
const closest = history3.reduce((prev, curr) => { const closest = history3.reduce((prev, curr) => {
return (Math.abs(curr.ts - curtime) < Math.abs(prev.ts - curtime) ? curr : prev); return (Math.abs(curr.ts - curtime) < Math.abs(prev.ts - curtime) ? curr : prev);