diff --git a/frontend/app/utils/date.ts b/frontend/app/utils/date.ts index dd8f84c..56ebc06 100644 --- a/frontend/app/utils/date.ts +++ b/frontend/app/utils/date.ts @@ -13,15 +13,15 @@ export function formatDate(d: Date): string { } /** - * Format time from ISO string to HH:MM format. + * Format time from ISO string to HH:MM format in UTC. + * Uses UTC to avoid timezone conversion issues when displaying booking slots. */ export function formatTime(isoString: string): string { const d = new Date(isoString); - return d.toLocaleTimeString("en-US", { - hour: "2-digit", - minute: "2-digit", - hour12: false, - }); + // Use UTC methods to avoid timezone conversion + const hours = String(d.getUTCHours()).padStart(2, "0"); + const minutes = String(d.getUTCMinutes()).padStart(2, "0"); + return `${hours}:${minutes}`; } /**