diff --git a/web/src/components/overlay/detail/TrackingDetails.tsx b/web/src/components/overlay/detail/TrackingDetails.tsx index 39ffaf4c8..ceb426b8a 100644 --- a/web/src/components/overlay/detail/TrackingDetails.tsx +++ b/web/src/components/overlay/detail/TrackingDetails.tsx @@ -177,21 +177,22 @@ export function TrackingDetails({ }) : ""; - const formattedEnd = config - ? formatUnixTimestampToDateTime(event.end_time ?? 0, { - timezone: config.ui.timezone, - date_format: - config.ui.time_format == "24hour" - ? t("time.formattedTimestamp.24hour", { - ns: "common", - }) - : t("time.formattedTimestamp.12hour", { - ns: "common", - }), - time_style: "medium", - date_style: "medium", - }) - : ""; + const formattedEnd = + config && event.end_time != null + ? formatUnixTimestampToDateTime(event.end_time, { + timezone: config.ui.timezone, + date_format: + config.ui.time_format == "24hour" + ? t("time.formattedTimestamp.24hour", { + ns: "common", + }) + : t("time.formattedTimestamp.12hour", { + ns: "common", + }), + time_style: "medium", + date_style: "medium", + }) + : ""; useEffect(() => { if (!eventSequence || eventSequence.length === 0) return; @@ -525,9 +526,16 @@ export function TrackingDetails({
{label} - - {formattedStart ?? ""} - {formattedEnd ?? ""} - +
+ {formattedStart ?? ""} + {event.end_time != null ? ( + <> - {formattedEnd} + ) : ( +
+ +
+ )} +
{event.data?.recognized_license_plate && ( <> ยท