From 6d95eb6dcf2bd2e0cade6e36cf226b6dfea25339 Mon Sep 17 00:00:00 2001 From: Stephen Adamson Date: Fri, 8 May 2026 22:27:40 +0100 Subject: [PATCH] fix: match date/time picker style, fix two-row footer layout - Replace Modal.Footer with plain div to avoid bits-ui class merging (sm:flex-row override) - DatePicker wrapped in flex items-center justify-center matching BookingCreateModal - Time picker uses Button elements with fuchsia selection (hover:bg-fuchsia-50, bg-fuchsia-100) - Generate 30-min time slots from 08:00-18:00 matching salon hours - Reschedule form container uses bg-gray-50 matching other sections - Footer: two rows with flex-1 buttons for equal width --- .../account/UserBookingModal.svelte | 123 +++++++++++------- 1 file changed, 78 insertions(+), 45 deletions(-) diff --git a/frontend/src/lib/components/account/UserBookingModal.svelte b/frontend/src/lib/components/account/UserBookingModal.svelte index 029a8cf..63e8a92 100644 --- a/frontend/src/lib/components/account/UserBookingModal.svelte +++ b/frontend/src/lib/components/account/UserBookingModal.svelte @@ -146,6 +146,30 @@ return jsDate < todayStart; } + function formatTime(time: string): string { + const parts = time.split(':').map(Number); + const hours = parts[0]; + const minutes = parts.length > 1 ? parts[1] : 0; + if (hours === 12 && minutes === 0) return 'Noon'; + if (hours === 0 && minutes === 0) return 'Midnight'; + const period = hours >= 12 ? 'PM' : 'AM'; + const displayHours = hours % 12 || 12; + return `${displayHours}:${minutes.toString().padStart(2, '0')} ${period}`; + } + + function generateTimeSlots(): string[] { + const slots: string[] = []; + for (let h = 8; h <= 18; h++) { + for (let m = 0; m < 60; m += 30) { + if (h === 18 && m > 0) break; + slots.push(`${String(h).padStart(2, '0')}:${String(m).padStart(2, '0')}`); + } + } + return slots; + } + + const timeSlots = generateTimeSlots(); + async function submitReschedule() { if (!selectedBooking || !rescheduleDate || !rescheduleTime) return; rescheduleSubmitting = true; @@ -427,70 +451,79 @@ {/if} {#if showRescheduleForm} -
-

+
+

Request Reschedule

-
+ +
{ rescheduleDate = d; }} + onchange={(d) => { rescheduleDate = d; rescheduleTime = ''; }} onPlaceholderChange={(p) => { reschedulePlaceholder = p; }} /> +
-
- Preferred Time * - -

We'll confirm the exact time based on availability

+ {#if rescheduleDate} +
+
+ {rescheduleDate.toDate(getLocalTimeZone()).toLocaleDateString('en-GB', { weekday: 'long', day: 'numeric', month: 'short' })} +
+
+ {#each timeSlots as slot (slot)} + + {/each} +
+ {/if} -
- Reason (optional) - -
+
+ Reason (optional) + +
-
- - -
+
+ +
{/if}
{/if} - +
{#if isCancellable}
- +