Refine booking flow

This commit is contained in:
Roba Boru
2026-07-02 16:03:57 +03:00
parent 118ba46930
commit f2ee62b95f
16 changed files with 921 additions and 471 deletions

View File

@@ -13,9 +13,17 @@ export const formatDate = (date: string | Date, formatStr: string = 'MMM dd, yyy
};
export const formatDateTime = (date: string | Date): string => {
return format(new Date(date), 'MMM dd, yyyy HH:mm');
return format(new Date(date), 'MMM dd, yyyy h:mm a');
};
export const formatTime = (date: string | Date): string => {
return format(new Date(date), 'HH:mm');
return format(new Date(date), 'h:mm a');
};
export const getTimePeriod = (date: string | Date): string => {
const hour = new Date(date).getHours();
if (hour >= 5 && hour < 12) return 'Morning';
if (hour >= 12 && hour < 17) return 'Afternoon';
if (hour >= 17 && hour < 21) return 'Evening';
return 'Night';
};