@extends('frontend.layouts.app') @section('title', $title) @section('description', $description) @section('content') @php $assetPath = fn (string $path) => asset('frontend/' . ltrim($path, '/')); $monthLabel = \Carbon\Carbon::createFromFormat('Y-m', $date)->format('F Y'); $prevMonth = \Carbon\Carbon::createFromFormat('Y-m', $date)->copy()->subMonth()->format('Y-m'); $nextMonth = \Carbon\Carbon::createFromFormat('Y-m', $date)->copy()->addMonth()->format('Y-m'); @endphp @include('frontend.layouts.breadcrumb', ['title' => $pageCalendarTitle ?? 'Events Calendar'])
@if(!empty($pageCalendarIntro))

{{ $pageCalendarIntro }}

@endif
@foreach(['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] as $day)
{{ $day }}
@endforeach
@php $currentDate = $startOfMonth->copy()->startOfWeek(); $endGrid = $endOfMonth->copy()->endOfWeek(); @endphp
@while($currentDate <= $endGrid) @php $isCurrentMonth = $currentDate->month === $startOfMonth->month; $isToday = $currentDate->isToday(); $dayEvents = $events[$currentDate->format('Y-m-d')] ?? collect(); $cellClass = $isCurrentMonth ? 'bg-white' : 'bg-light'; @endphp
{{ $currentDate->format('j') }} @if($dayEvents->count() > 0) {{ $dayEvents->count() }} @endif
@foreach($dayEvents->take(3) as $event) {{ $event->title }} @if($event->start_date->format('H:i') !== '00:00') {{ $event->start_date->format('h:i A') }} @endif @endforeach @if($dayEvents->count() > 3) +{{ $dayEvents->count() - 3 }} more @endif
@php $currentDate->addDay(); @endphp @endwhile
@if($events->flatten()->count() > 0)
Schedule

This month

@foreach($events->flatten()->take(6) as $event)

{{ $event->title }}

{{ $event->start_date->format('M d, Y') }} @if($event->start_date->format('H:i') !== '00:00') ยท {{ $event->start_date->format('h:i A') }} @endif

{{ \Illuminate\Support\Str::limit(strip_tags($event->description ?? ''), 90) }}

DetailsDetails
@endforeach
@if($events->flatten()->count() > 6) @endif
@else

No events scheduled

There are no events for {{ $monthLabel }}.

Back to events
@endif
@include('frontend.partials.newsletter') @endsection