WIP call in booking
This commit is contained in:
@@ -24,6 +24,12 @@
|
||||
duration_minutes: number;
|
||||
};
|
||||
|
||||
function isPastAppointment(startTime: string, durationMinutes: number): boolean {
|
||||
const start = new Date(startTime);
|
||||
const end = new Date(start.getTime() + durationMinutes * 60_000);
|
||||
return end.getTime() < Date.now();
|
||||
}
|
||||
|
||||
let appointments = $state<TodayAppointment[]>([]);
|
||||
let loading = $state(true);
|
||||
|
||||
@@ -179,7 +185,8 @@
|
||||
<div class="space-y-3">
|
||||
{#each appointments as apt (apt.id)}
|
||||
<div
|
||||
class="flex items-center gap-4 rounded-lg border p-3 transition-all hover:shadow-md"
|
||||
class="flex items-center gap-4 rounded-lg border p-3 transition-all hover:shadow-md
|
||||
{isPastAppointment(apt.start_time, apt.duration_minutes) ? 'line-through opacity-50' : ''}"
|
||||
>
|
||||
<div class="min-w-[80px] text-sm font-semibold text-gray-700">
|
||||
{formatTime(apt.start_time)}
|
||||
|
||||
Reference in New Issue
Block a user