Compare commits

..

2 Commits

Author SHA1 Message Date
Jeas0001
07230e1ef3 Merge branch 'master' of git.reim.ar:ReiMerc/temperature-alarm 2025-04-08 10:32:11 +02:00
Jeas0001
f35aeb592b Fix for chrome browser showing time 2025-04-08 10:32:03 +02:00

View File

@ -28,7 +28,7 @@ function buildTable(data, offset = 0) {
color = "tempNormal";
}
const parsedDate = luxon.DateTime.fromISO(log.date).setZone("Europe/Copenhagen").setLocale("gb");
const parsedDate = luxon.DateTime.fromISO(log.date, { zone: "UTC" }).setZone("Europe/Copenhagen").setLocale("gb");
const date = parsedDate.toLocaleString(luxon.DateTime.DATE_SHORT);
const time = parsedDate.toLocaleString(luxon.DateTime.TIME_WITH_SECONDS);
@ -139,7 +139,7 @@ async function fetchData() {
},
adapters: {
date: {
zone: "Europe/Copenhagen",
zone: "system",
},
},
},
@ -163,7 +163,7 @@ async function fetchData() {
backgroundColor: `rgba(${color}, 1.0)`,
borderColor: `rgba(${color}, 0.1)`,
data: dataset.map(log => ({
x: new Date(log.date).getTime(),
x: luxon.DateTime.fromISO(log.date, { zone: "UTC" }).toMillis(),
y: log.temperature,
})),
};