mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-05-05 07:34:24 +00:00
Fixed issue with price graph in relation to entering or leaving DST
This commit is contained in:
18
lib/SvelteUi/app/dist/index.js
vendored
18
lib/SvelteUi/app/dist/index.js
vendored
File diff suppressed because one or more lines are too long
@@ -180,4 +180,9 @@ export function fmtnum(v,d) {
|
||||
if(isNaN(d))
|
||||
d = v < 10 ? 1 : 0;
|
||||
return v.toFixed(d);
|
||||
}
|
||||
|
||||
export function addHours(date, hours) {
|
||||
date.setTime(date.getTime() + hours * 3600000);
|
||||
return date;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<script>
|
||||
import { zeropad } from './Helpers.js';
|
||||
import { zeropad, addHours } from './Helpers.js';
|
||||
import BarChart from './BarChart.svelte';
|
||||
|
||||
export let json;
|
||||
@@ -19,7 +19,6 @@
|
||||
let points = [];
|
||||
let cur = new Date();
|
||||
for(i = hour; i<24; i++) {
|
||||
cur.setUTCHours(i);
|
||||
val = json[zeropad(h++)];
|
||||
if(val == null) break;
|
||||
xTicks.push({
|
||||
@@ -34,9 +33,9 @@
|
||||
});
|
||||
min = Math.min(min, val*100);
|
||||
max = Math.max(max, val*100);
|
||||
addHours(cur, 1);
|
||||
};
|
||||
for(i = 0; i < 24; i++) {
|
||||
cur.setUTCHours(i);
|
||||
val = json[zeropad(h++)];
|
||||
if(val == null) break;
|
||||
xTicks.push({
|
||||
@@ -51,6 +50,7 @@
|
||||
});
|
||||
min = Math.min(min, val*100);
|
||||
max = Math.max(max, val*100);
|
||||
addHours(cur, 1);
|
||||
};
|
||||
|
||||
max = Math.ceil(max);
|
||||
|
||||
Reference in New Issue
Block a user