From 732b0facee4b3f83bf4608e0b47687c12458378d Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Tue, 22 Apr 2025 16:12:22 -0500 Subject: [PATCH] clean up --- web/src/components/graph/LineGraph.tsx | 28 ++++++++++++++---------- web/src/components/graph/SystemGraph.tsx | 14 +++++++----- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/web/src/components/graph/LineGraph.tsx b/web/src/components/graph/LineGraph.tsx index 4e4f3666a2..76c9c2ce34 100644 --- a/web/src/components/graph/LineGraph.tsx +++ b/web/src/components/graph/LineGraph.tsx @@ -55,12 +55,14 @@ export function CameraLineGraph({ const formatTime = useCallback( (val: unknown) => { - const timestamp = updateTimes[Math.round(val as number)]; - return formatUnixTimestampToDateTime(timestamp, { - timezone: config?.ui.timezone, - date_format: format, - locale, - }); + return formatUnixTimestampToDateTime( + updateTimes[Math.round(val as number)], + { + timezone: config?.ui.timezone, + date_format: format, + locale, + }, + ); }, [config?.ui.timezone, format, locale, updateTimes], ); @@ -190,12 +192,14 @@ export function EventsPerSecondsLineGraph({ const formatTime = useCallback( (val: unknown) => { - const timestamp = updateTimes[Math.round(val as number) - 1]; - return formatUnixTimestampToDateTime(timestamp, { - timezone: config?.ui.timezone, - date_format: format, - locale, - }); + return formatUnixTimestampToDateTime( + updateTimes[Math.round(val as number) - 1], + { + timezone: config?.ui.timezone, + date_format: format, + locale, + }, + ); }, [config?.ui.timezone, format, locale, updateTimes], ); diff --git a/web/src/components/graph/SystemGraph.tsx b/web/src/components/graph/SystemGraph.tsx index e70990c516..b77231aa7c 100644 --- a/web/src/components/graph/SystemGraph.tsx +++ b/web/src/components/graph/SystemGraph.tsx @@ -65,12 +65,14 @@ export function ThresholdBarGraph({ if (dateIndex < 0) { timeOffset = 5 * Math.abs(dateIndex); } - const timestamp = updateTimes[Math.max(1, dateIndex) - 1] - timeOffset; - return formatUnixTimestampToDateTime(timestamp, { - timezone: config?.ui.timezone, - date_format: format, - locale, - }); + return formatUnixTimestampToDateTime( + updateTimes[Math.max(1, dateIndex) - 1] - timeOffset, + { + timezone: config?.ui.timezone, + date_format: format, + locale, + }, + ); }, [config?.ui.timezone, format, locale, updateTimes], );