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(
|
return format(
|
||||||
addHours(rawDate, offsetHours).toISOString(),
|
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 { 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.
|
// This type is used to define the shape of our data.
|
||||||
// You can use a Zod schema here if you want.
|
// You can use a Zod schema here if you want.
|
||||||
@@ -35,7 +35,7 @@ export const columns: ColumnDef<Adjustmnets>[] = [
|
|||||||
if (row.getValue("ProductionDate")) {
|
if (row.getValue("ProductionDate")) {
|
||||||
const correctDate = format(
|
const correctDate = format(
|
||||||
row.getValue("ProductionDate"),
|
row.getValue("ProductionDate"),
|
||||||
"M/d/yyyy hh:mm"
|
"M/d/yyyy HH:mm"
|
||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<div className="text-left font-medium">{correctDate}</div>
|
<div className="text-left font-medium">{correctDate}</div>
|
||||||
|
|||||||
@@ -36,10 +36,7 @@ export const labelolumns: ColumnDef<Adjustmnets>[] = [
|
|||||||
if (row.getValue("upd_date")) {
|
if (row.getValue("upd_date")) {
|
||||||
const correctDate: any = row.getValue("upd_date");
|
const correctDate: any = row.getValue("upd_date");
|
||||||
const strippedDate = correctDate.replace("Z", ""); // Remove Z
|
const strippedDate = correctDate.replace("Z", ""); // Remove Z
|
||||||
const formattedDate = format(
|
const formattedDate = format(strippedDate, "MM/dd/yyyy HH:mm");
|
||||||
strippedDate,
|
|
||||||
"MM/dd/yyyy hh:mm a"
|
|
||||||
);
|
|
||||||
return (
|
return (
|
||||||
<div className="text-left font-medium">{formattedDate}</div>
|
<div className="text-left font-medium">{formattedDate}</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user