Fix for chrome browser showing time

This commit is contained in:
Jeas0001 2025-04-08 10:32:03 +02:00
parent 4be7977c11
commit f35aeb592b

View File

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