test(time): more time testing
This commit is contained in:
@@ -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"
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user