style: apply prettier formatting to frontend
This commit is contained in:
@@ -9,7 +9,13 @@
|
||||
import * as Label from '$lib/components/ui/label';
|
||||
import DatePicker from '$lib/components/booking/DatePicker.svelte';
|
||||
import PolicyPopover from '$lib/components/ui/policyPopover.svelte';
|
||||
import type { Booking, BookingDiscount, Service, WorkingHoursDay, AvailableHoursDay } from '$lib/types/booking';
|
||||
import type {
|
||||
Booking,
|
||||
BookingDiscount,
|
||||
Service,
|
||||
WorkingHoursDay,
|
||||
AvailableHoursDay
|
||||
} from '$lib/types/booking';
|
||||
import {
|
||||
extractBookedSlots,
|
||||
getLunchProtectionForSlots,
|
||||
@@ -70,7 +76,11 @@
|
||||
// ─── Date constants ─────────────────────────────────────
|
||||
const todayCalendarDate = getLondonTodayCalendarDate();
|
||||
const minDate = todayCalendarDate;
|
||||
const maxDate = new SvelteDate(todayCalendarDate.year, todayCalendarDate.month - 1, todayCalendarDate.day);
|
||||
const maxDate = new SvelteDate(
|
||||
todayCalendarDate.year,
|
||||
todayCalendarDate.month - 1,
|
||||
todayCalendarDate.day
|
||||
);
|
||||
maxDate.setMonth(todayCalendarDate.month - 1 + 6);
|
||||
const maxCalendarDate = new CalendarDate(
|
||||
maxDate.getFullYear(),
|
||||
@@ -82,9 +92,7 @@
|
||||
let hoursUntilAppointment = $derived(
|
||||
(new SvelteDate(booking.start_time).getTime() - new SvelteDate().getTime()) / (1000 * 60 * 60)
|
||||
);
|
||||
let hasPayments = $derived(
|
||||
(booking.amount_paid ?? 0) > 0
|
||||
);
|
||||
let hasPayments = $derived((booking.amount_paid ?? 0) > 0);
|
||||
let noticePeriodBlocked = $derived(
|
||||
hasPayments ? hoursUntilAppointment < 72 : hoursUntilAppointment < 24
|
||||
);
|
||||
@@ -218,7 +226,12 @@
|
||||
|
||||
if (isToday) {
|
||||
const now = new Date();
|
||||
const londonTime = now.toLocaleTimeString('en-GB', { timeZone: 'Europe/London', hour: '2-digit', minute: '2-digit', hour12: false });
|
||||
const londonTime = now.toLocaleTimeString('en-GB', {
|
||||
timeZone: 'Europe/London',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
hour12: false
|
||||
});
|
||||
const [londonHours, londonMinutes] = londonTime.split(':').map(Number);
|
||||
const currentMin = londonHours * 60 + londonMinutes;
|
||||
startMin = Math.max(startMin, Math.ceil((currentMin + 60) / 15) * 15);
|
||||
@@ -268,7 +281,12 @@
|
||||
const isToday = date.compare(todayCal) === 0;
|
||||
if (isToday) {
|
||||
const now = new Date();
|
||||
const londonTime = now.toLocaleTimeString('en-GB', { timeZone: 'Europe/London', hour: '2-digit', minute: '2-digit', hour12: false });
|
||||
const londonTime = now.toLocaleTimeString('en-GB', {
|
||||
timeZone: 'Europe/London',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
hour12: false
|
||||
});
|
||||
const [londonHours, londonMinutes] = londonTime.split(':').map(Number);
|
||||
const currentMin = londonHours * 60 + londonMinutes;
|
||||
startMin = Math.max(startMin, Math.ceil((currentMin + 60) / 15) * 15);
|
||||
@@ -466,11 +484,7 @@
|
||||
}
|
||||
|
||||
const tomorrowCal = getLondonTodayCalendarDate();
|
||||
newDate = new CalendarDate(
|
||||
tomorrowCal.year,
|
||||
tomorrowCal.month,
|
||||
tomorrowCal.day + 1
|
||||
);
|
||||
newDate = new CalendarDate(tomorrowCal.year, tomorrowCal.month, tomorrowCal.day + 1);
|
||||
if (!userNavigatedCalendar) {
|
||||
placeholderDate = new CalendarDate(tomorrowCal.year, tomorrowCal.month, 1);
|
||||
}
|
||||
@@ -774,8 +788,13 @@
|
||||
<p class="font-medium text-amber-900">Cannot Reschedule Online</p>
|
||||
<p class="mt-1">{noticeBlockedMessage}</p>
|
||||
<p class="mt-1">
|
||||
<a href="/contact" target="_blank" class="underline">Contact us</a> to discuss options,
|
||||
or <button type="button" onclick={() => open = false} class="inline underline cursor-pointer">cancel this booking</button>
|
||||
<a href="/contact" target="_blank" class="underline">Contact us</a> to discuss
|
||||
options, or
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => (open = false)}
|
||||
class="inline cursor-pointer underline">cancel this booking</button
|
||||
>
|
||||
and rebook — note that cancellation fees may apply based on our
|
||||
<PolicyPopover>
|
||||
{#snippet trigger()}
|
||||
@@ -788,8 +807,8 @@
|
||||
<div class="rounded-md border border-amber-200 bg-amber-50 p-3 text-sm text-amber-800">
|
||||
<p class="font-medium text-amber-900">Rescheduling Within 24h</p>
|
||||
<p class="mt-1">
|
||||
Rescheduling within 24h counts as a no-show towards your deposit obligations. Two no-shows
|
||||
within 6 months will require deposits on future bookings.
|
||||
Rescheduling within 24h counts as a no-show towards your deposit obligations. Two
|
||||
no-shows within 6 months will require deposits on future bookings.
|
||||
<PolicyPopover>
|
||||
{#snippet trigger()}
|
||||
<span class="underline">Full policy</span>
|
||||
@@ -800,14 +819,12 @@
|
||||
{/if}
|
||||
|
||||
{#if booking.discounts && booking.discounts.length > 0}
|
||||
<div
|
||||
class="rounded-md border border-amber-200 bg-amber-50 p-3 text-sm text-amber-800"
|
||||
>
|
||||
<div class="rounded-md border border-amber-200 bg-amber-50 p-3 text-sm text-amber-800">
|
||||
<p class="font-medium text-amber-900">Discounts Applied to This Booking</p>
|
||||
<p class="mt-1">
|
||||
Your booking has £{discountTotal.toFixed(2)} in savings from loyalty stamps or
|
||||
promotional offers. A time change requires admin approval. If denied, you can cancel
|
||||
(standard refund policy applies) and rebook at full price.
|
||||
Your booking has £{discountTotal.toFixed(2)} in savings from loyalty stamps or promotional
|
||||
offers. A time change requires admin approval. If denied, you can cancel (standard refund
|
||||
policy applies) and rebook at full price.
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -914,7 +931,7 @@
|
||||
</div>
|
||||
{:else}
|
||||
<div
|
||||
class="no-scrollbar mt-2 flex max-h-40 min-h-25 w-full scroll-pb-6 flex-col gap-4 overflow-y-auto border-t pt-4"
|
||||
class="mt-2 no-scrollbar flex max-h-40 min-h-25 w-full scroll-pb-6 flex-col gap-4 overflow-y-auto border-t pt-4"
|
||||
>
|
||||
<div class="grid justify-center gap-2 text-sm text-gray-600">
|
||||
{newDate.toDate(getLocalTimeZone()).toLocaleDateString('en-GB', {
|
||||
|
||||
Reference in New Issue
Block a user