@props(['service', 'date', 'slots', 'selectedSlot' => null, 'disabled' => false]) @php $daysOfWeek = ['الأحد', 'الإثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت']; $months = ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر']; $currentDate = \Carbon\Carbon::parse($date); $currentMonth = $currentDate->month - 1; $currentYear = $currentDate->year; $firstDay = \Carbon\Carbon::createFromDate($currentYear, $currentMonth + 1, 1)->dayOfWeek; $daysInMonth = $currentDate->daysInMonth; @endphp

{{ $months[$currentMonth] }} {{ $currentYear }}

@foreach ($daysOfWeek as $day)
{{ $day }}
@endforeach
@for ($i = 0; $i < $firstDay; $i++)
@endfor @for ($day = 1; $day <= $daysInMonth; $day++) @php $date = sprintf('%04d-%02d-%02d', $currentYear, $currentMonth + 1, $day); $isAvailable = isset($slots[$date]) && count($slots[$date]) > 0; $isToday = $date === now()->format('Y-m-d'); $isPast = $date < now()->format('Y-m-d'); @endphp
@endfor

الفترات المتاحة