refactor(time): more time changes to fix 24 hour format
This commit is contained in:
@@ -16,6 +16,6 @@ export const fixTime = (date: any) => {
|
||||
|
||||
return format(
|
||||
addHours(rawDate, offsetHours).toISOString(),
|
||||
"MM/dd/yyyy hh:mm"
|
||||
"MM/dd/yyyy HH:mm"
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ColumnDef } from "@tanstack/react-table";
|
||||
import { format } from "date-fns";
|
||||
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.
|
||||
@@ -35,7 +35,7 @@ export const columns: ColumnDef<Adjustmnets>[] = [
|
||||
if (row.getValue("ProductionDate")) {
|
||||
const correctDate = format(
|
||||
row.getValue("ProductionDate"),
|
||||
"M/d/yyyy hh:mm"
|
||||
"M/d/yyyy HH:mm"
|
||||
);
|
||||
return (
|
||||
<div className="text-left font-medium">{correctDate}</div>
|
||||
|
||||
@@ -36,10 +36,7 @@ export const labelolumns: ColumnDef<Adjustmnets>[] = [
|
||||
if (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"
|
||||
);
|
||||
const formattedDate = format(strippedDate, "MM/dd/yyyy HH:mm");
|
||||
return (
|
||||
<div className="text-left font-medium">{formattedDate}</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user