Skip to content

Commit

Permalink
widbaroalarm settings graph: fix off by one
Browse files Browse the repository at this point in the history
  • Loading branch information
nxdefiant committed Feb 10, 2024
1 parent dc4b2dd commit f75d976
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/widbaroalarm/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
const now = new Date()/(1000);
let curtime = now-3*60*60; // 3h ago
const data = [];
while (curtime < now) {
while (curtime <= now) {
// find closest value in history for this timestamp
const closest = history3.reduce((prev, curr) => {
return (Math.abs(curr.ts - curtime) < Math.abs(prev.ts - curtime) ? curr : prev);
Expand Down

0 comments on commit f75d976

Please sign in to comment.