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,6 +1,10 @@
import { addHours, format } from "date-fns"; import { addHours } from "date-fns";
import { format } from "date-fns-tz";
export const fixTime = (date: any) => { export const fixTime = (date: any) => {
/**
* This fix is when it comes directly from lst
*/
if (!date) return; 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"); //return format(strippedDate, "MM/dd/yyyy hh:mm a");
@@ -12,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 a" "MM/dd/yyyy hh:mm"
); );
}; };