test(rfid): more rfid work and tested working
This commit is contained in:
14
frontend/src/routes/(logistics)/openOrders/index.tsx
Normal file
14
frontend/src/routes/(logistics)/openOrders/index.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import OpenOrders from "@/components/logistics/warehouse/openOrders";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/(logistics)/openOrders/")({
|
||||
component: RouteComponent,
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
return (
|
||||
<div className="m-5 w-11/12 h-9/10">
|
||||
<OpenOrders />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,6 +1,17 @@
|
||||
import { format } from "date-fns";
|
||||
import { addHours, format } from "date-fns";
|
||||
|
||||
export const fixTime = (date: any) => {
|
||||
const strippedDate = date.replace("Z", ""); // Remove Z
|
||||
return format(strippedDate, "MM/dd/yyyy hh:mm a");
|
||||
if (!date) return;
|
||||
// const strippedDate = date?.replace("Z", ""); // Remove Z
|
||||
//return format(strippedDate, "MM/dd/yyyy hh:mm a");
|
||||
|
||||
const rawDate = new Date(date).toISOString();
|
||||
const offsetMinutes = new Date().getTimezoneOffset(); // in minutes
|
||||
const offsetHours =
|
||||
-offsetMinutes / 60 >= 0 ? offsetMinutes / 60 : -offsetMinutes / 60;
|
||||
|
||||
return format(
|
||||
addHours(rawDate, offsetHours).toISOString(),
|
||||
"MM/dd/yyyy hh:mm a"
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user