From bb6d1c3bffa21a00b30d0e5d418b337c5ee1dcaf Mon Sep 17 00:00:00 2001 From: Blake Matthes Date: Mon, 21 Apr 2025 07:48:21 -0500 Subject: [PATCH] fix(time): changes the labeling time to be our db version --- .../tableData/production/labels/labelColumns.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/frontend/src/utils/tableData/production/labels/labelColumns.tsx b/frontend/src/utils/tableData/production/labels/labelColumns.tsx index d1291bc..7e99feb 100644 --- a/frontend/src/utils/tableData/production/labels/labelColumns.tsx +++ b/frontend/src/utils/tableData/production/labels/labelColumns.tsx @@ -1,5 +1,6 @@ -import { fixTime } from "@/utils/fixTime"; +//import { fixTime } from "@/utils/fixTime"; import { ColumnDef } from "@tanstack/react-table"; +import { format } from "date-fns-tz"; // This type is used to define the shape of our data. // You can use a Zod schema here if you want. @@ -33,9 +34,14 @@ export const labelolumns: ColumnDef[] = [ header: "Label Date", cell: ({ row }) => { if (row.getValue("upd_date")) { - const correctDate = fixTime(row.getValue("upd_date")); + const correctDate: any = row.getValue("upd_date"); + const strippedDate = correctDate.replace("Z", ""); // Remove Z + const formattedDate = format( + strippedDate, + "MM/dd/yyyy hh:mm a" + ); return ( -
{correctDate}
+
{formattedDate}
); } },