mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-01-13 23:45:25 +00:00
Fixed clock skew on graphs around midnight
This commit is contained in:
parent
4f90954084
commit
c462b3bb00
20
lib/SvelteUi/app/dist/index.js
vendored
20
lib/SvelteUi/app/dist/index.js
vendored
File diff suppressed because one or more lines are too long
@ -9,7 +9,7 @@
|
||||
$:{
|
||||
showFull = Math.abs(new Date().getTime()-timestamp.getTime()) < 300000;
|
||||
if(!isNaN(offset))
|
||||
addHours(timestamp, offset - (timestamp.getHours() - timestamp.getUTCHours()));
|
||||
addHours(timestamp, offset - ((timestamp.getHours() - timestamp.getUTCHours())%24));
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
min = max = 0;
|
||||
let cur = addHours(new Date(), -24);
|
||||
let currentHour = new Date().getUTCHours();
|
||||
addHours(cur, sysinfo.clock_offset);
|
||||
addHours(cur, sysinfo.clock_offset - ((cur.getHours() - cur.getUTCHours())%24));
|
||||
for(i = currentHour; i<24; i++) {
|
||||
let imp = json["i"+zeropad(i)];
|
||||
let exp = json["e"+zeropad(i)];
|
||||
@ -25,7 +25,7 @@
|
||||
if(exp === undefined) exp = 0;
|
||||
|
||||
xTicks.push({
|
||||
label: zeropad(cur.getUTCHours())
|
||||
label: zeropad(cur.getHours())
|
||||
});
|
||||
points.push({
|
||||
label: imp.toFixed(1),
|
||||
@ -47,7 +47,7 @@
|
||||
if(exp === undefined) exp = 0;
|
||||
|
||||
xTicks.push({
|
||||
label: zeropad(cur.getUTCHours())
|
||||
label: zeropad(cur.getHours())
|
||||
});
|
||||
points.push({
|
||||
label: imp.toFixed(1),
|
||||
|
||||
@ -17,8 +17,8 @@
|
||||
min = max = 0;
|
||||
let cur = new Date();
|
||||
let lm = new Date();
|
||||
addHours(cur, sysinfo.clock_offset);
|
||||
addHours(lm, sysinfo.clock_offset);
|
||||
addHours(cur, sysinfo.clock_offset - ((cur.getHours() - cur.getUTCHours())%24));
|
||||
addHours(lm, sysinfo.clock_offset - ((lm.getHours() - lm.getUTCHours())%24));
|
||||
lm.setDate(0);
|
||||
|
||||
for(i = cur.getDate(); i<=lm.getDate(); i++) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user