fix: Typisierung von timeUnit für Chart.js X-Achse korrigiert ('hour' | 'day')

This commit is contained in:
ISA
2025-05-07 15:35:37 +02:00
parent d9314c7bb2
commit 4f6b664ad0
2 changed files with 3 additions and 3 deletions

View File

@@ -77,7 +77,7 @@ const LoopMeasurementChart = () => {
const from = vonDatum ? parseISO(vonDatum) : null; const from = vonDatum ? parseISO(vonDatum) : null;
const to = bisDatum ? parseISO(bisDatum) : null; const to = bisDatum ? parseISO(bisDatum) : null;
const durationInHours = from && to ? differenceInHours(to, from) : 9999; const durationInHours = from && to ? differenceInHours(to, from) : 9999;
const timeUnit = durationInHours <= 48 ? "hour" : "day"; const timeUnit: "hour" | "day" = durationInHours <= 48 ? "hour" : "day";
useEffect(() => { useEffect(() => {
import("chartjs-plugin-zoom").then((zoomPlugin) => { import("chartjs-plugin-zoom").then((zoomPlugin) => {
@@ -173,7 +173,7 @@ const LoopMeasurementChart = () => {
x: { x: {
type: "time" as const, type: "time" as const,
time: { time: {
unit: timeUnit as const, unit: timeUnit,
tooltipFormat: "dd.MM.yyyy HH:mm:ss", tooltipFormat: "dd.MM.yyyy HH:mm:ss",
displayFormats: { displayFormats: {
hour: "HH:mm", hour: "HH:mm",

View File

@@ -6,5 +6,5 @@
2: Patch oder Hotfix (Bugfixes oder kleine Änderungen). 2: Patch oder Hotfix (Bugfixes oder kleine Änderungen).
*/ */
const webVersion = "1.6.393"; const webVersion = "1.6.394";
export default webVersion; export default webVersion;