Time Blockers Manage one-off blocked periods like appointments, breaks, or closures.
{#if loading}
{#each Array(3) as _, i (i)} {/each}
{:else} {#if blockers.length === 0}

No time blockers found.

{:else}
{#each pagedBlockers as b (b.id)}
{b.description || 'Untitled'}
{new SvelteDate(b.start_time).toLocaleDateString('en-GB', { weekday: 'short', day: 'numeric', month: 'short' })} · {new SvelteDate(b.start_time).toLocaleTimeString('en-GB', { hour: 'numeric', minute: '2-digit', hour12: true })} {(() => { const end = new SvelteDate(b.start_time); end.setMinutes(end.getMinutes() + b.duration_minutes); return end.toLocaleTimeString('en-GB', { hour: 'numeric', minute: '2-digit', hour12: true }); })()} {formatDuration(b.duration_minutes)}
{formatRelativeTime(b.start_time)}
{/each}
{#if totalPages > 1}

{(currentPage - 1) * PAGE_SIZE + 1}–{Math.min(currentPage * PAGE_SIZE, sortedBlockers.length)} of {sortedBlockers.length}

{#each Array(totalPages) as _, i (i)} {/each}
{/if} {/if} {/if}
Create Time Blocker Block off a period of time so no bookings can be made during it.

Start

{#if hoursLoading} {:else if !selectedWorkingHours}

Select a date first

{:else if !selectedWorkingHours.isOpen}

Closed on {new SvelteDate(newStartDate + 'T00:00:00').toLocaleDateString('en-GB', { weekday: 'long' })}

{:else} {/if}

End Time

{#if hoursLoading} {:else if !selectedWorkingHours}

Select a date first

{:else if !selectedWorkingHours.isOpen}

Closed on this day

{:else if availableEndOptions.length === 0}

No available end time after selected start

{:else} {/if}
{#if checkingOverlap}
Checking for conflicting bookings…
{:else if hasOverlap}
{overlappingBookings.length} booking{overlappingBookings.length > 1 ? 's' : ''} conflict{overlappingBookings.length > 1 ? '' : 's'} with this slot
{#each overlappingBookings as booking (booking.id)}
{booking.user?.full_name || 'Unknown'}
{new SvelteDate(booking.start_time).toLocaleTimeString('en-GB', { hour: 'numeric', minute: '2-digit', hour12: true })}} {' · '} {formatDuration(booking.duration_minutes)} {#if booking.services?.length} {' · '} {booking.services.join(', ')} {/if}
{#if openBookingModal} {/if} {#if openUserModal && booking.user?.id} {/if}
{/each}
{/if}
Delete time blocker? This will remove the "{blockerToDelete?.description}" time blocker. Bookings may become available during this period. This action cannot be undone. { showDeleteAlert = false; blockerToDelete = null; }} > Cancel Delete