polish order confirmation in orders list and order details pages

This commit is contained in:
tedraykov
2024-07-01 22:42:02 +03:00
parent f4f6edcd9a
commit 64a666f34a
18 changed files with 206 additions and 208 deletions

View File

@@ -124,12 +124,13 @@ export function toPrintDate(date: string) {
});
}
export const isBeforeToday = (date?: Date | null) => {
export const isBeforeToday = (date?: string | null) => {
if (!date) return false;
const today = new Date();
const compareDate = new Date(date);
today.setHours(0, 0, 0, 0);
date.setHours(0, 0, 0, 0);
compareDate.setHours(0, 0, 0, 0);
return date <= today;
return compareDate <= today;
};