From 413494a7fb069a262271921d087f26d1978149b7 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Thu, 12 Sep 2024 12:44:29 +0800 Subject: [PATCH] Remove last checked from pagesspeed car --- Client/src/Components/Charts/BarChart/index.jsx | 10 ++++++++-- Client/src/Pages/PageSpeed/card.jsx | 11 ----------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/Client/src/Components/Charts/BarChart/index.jsx b/Client/src/Components/Charts/BarChart/index.jsx index 54a9524af..e2d8c7b45 100644 --- a/Client/src/Components/Charts/BarChart/index.jsx +++ b/Client/src/Components/Charts/BarChart/index.jsx @@ -1,12 +1,14 @@ import { useTheme } from "@emotion/react"; import { Box, Stack, Tooltip, Typography } from "@mui/material"; -import { formatDate } from "../../../Utils/timeUtils"; +import { formatDateWithTz } from "../../../Utils/timeUtils"; import { useEffect, useState } from "react"; import "./index.css"; +import { useSelector } from "react-redux"; const BarChart = ({ checks = [] }) => { const theme = useTheme(); const [animate, setAnimate] = useState(false); + const uiTimezone = useSelector((state) => state.ui.timezone); useEffect(() => { setAnimate(true); @@ -51,7 +53,11 @@ const BarChart = ({ checks = [] }) => { title={ <> - {formatDate(new Date(check.createdAt), { year: undefined })} + {formatDateWithTz( + check.createdAt, + "ddd, MMMM D, YYYY, HH:mm A", + uiTimezone + )} { {monitor.url.replace(/^https?:\/\//, "")} - - - Last checked:{" "} - - {formatDate(getLastChecked(monitor.checks, false))}{" "} - - ({formatDurationRounded(getLastChecked(monitor.checks))} ago) - -