test(time): more time testing

This commit is contained in:
2025-04-21 21:03:38 -05:00
parent e9cb3e5db4
commit 6334efe093

View File

@@ -1,8 +1,12 @@
import { addHours, format } from "date-fns";
import { addHours } from "date-fns";
import { format } from "date-fns-tz";
export const fixTime = (date: any) => {
/**
* This fix is when it comes directly from lst
*/
if (!date) return;
// const strippedDate = date?.replace("Z", ""); // Remove Z
//const strippedDate = date?.replace("Z", ""); // Remove Z
//return format(strippedDate, "MM/dd/yyyy hh:mm a");
const rawDate = new Date(date).toISOString();
@@ -12,6 +16,6 @@ export const fixTime = (date: any) => {
return format(
addHours(rawDate, offsetHours).toISOString(),
"MM/dd/yyyy hh:mm a"
"MM/dd/yyyy hh:mm"
);
};