modify date format to ISO standard, remove toTimeStamp method

This commit is contained in:
Alex Holliday committed 2025-01-01 17:27:12 -08:00
1 parent e7cf127fde
commit b332bed14e
5 files changed
+11 -39

No files matched your search

@@ -1,10 +1,9 @@
import PropTypes from "prop-types";
import { useSelector } from "react-redux";
import { formatDateWithTz, toTimeStamp } from "../../../../Utils/timeUtils";
import { formatDateWithTz } from "../../../../Utils/timeUtils";
const CustomLabels = ({ x, width, height, firstDataPoint, lastDataPoint, type }) => {
const uiTimezone = useSelector((state) => state.ui.timezone);
const formatString = type === "month" ? "YYYY-MM-DD" : "YYYY-MM-DD-HH";
const dateFormat = type === "day" ? "MMM D, h:mm A" : "MMM D";
return (
@@ -16,11 +15,7 @@ const CustomLabels = ({ x, width, height, firstDataPoint, lastDataPoint, type })
textAnchor="start"
fontSize={11}
>
{formatDateWithTz(
toTimeStamp(firstDataPoint._id, formatString),
dateFormat,
uiTimezone
)}
{formatDateWithTz(firstDataPoint._id, dateFormat, uiTimezone)}
</text>
<text
x={width}
@@ -29,11 +24,7 @@ const CustomLabels = ({ x, width, height, firstDataPoint, lastDataPoint, type })
textAnchor="end"
fontSize={11}
>
{formatDateWithTz(
toTimeStamp(lastDataPoint._id, formatString),
dateFormat,
uiTimezone
)}
{formatDateWithTz(lastDataPoint._id, dateFormat, uiTimezone)}
</text>
</>
);
+2 -9
View File
@@ -24,7 +24,6 @@ import { formatDateWithTz, formatDurationSplit } from "../../../Utils/timeUtils"
import { useIsAdmin } from "../../../Hooks/useIsAdmin";
import IconBox from "../../../Components/IconBox";
import StatBox from "../../../Components/StatBox";
import { toTimeStamp } from "../../../Utils/timeUtils";
import UpBarChart from "./Charts/UpBarChart";
import DownBarChart from "./Charts/DownBarChart";
import ResponseGaugeChart from "./Charts/ResponseGaugeChart";
@@ -320,10 +319,7 @@ const DetailsPage = () => {
color={theme.palette.text.tertiary}
>
{formatDateWithTz(
toTimeStamp(
hoveredUptimeData._id,
dateRange === "month" ? "YYYY-MM-DD" : "YYYY-MM-DD-HH"
),
hoveredUptimeData._id,
dateFormat,
uiTimezone
)}
@@ -380,10 +376,7 @@ const DetailsPage = () => {
color={theme.palette.text.tertiary}
>
{formatDateWithTz(
toTimeStamp(
hoveredIncidentsData._id,
dateRange === "month" ? "YYYY-MM-DD" : "YYYY-MM-DD-HH"
),
hoveredIncidentsData._id,
dateFormat,
uiTimezone
)}