@php /** @var \Carbon\Carbon $month */ /** @var \Illuminate\Support\Collection $events grouped by Y-m-d */ $prevMonth = $month->copy()->subMonthNoOverflow()->format('Y-m'); $nextMonth = $month->copy()->addMonthNoOverflow()->format('Y-m'); $thisMonth = now()->format('Y-m'); $today = now()->format('Y-m-d'); $weekdays = __('group_calendar.weekdays'); $monthName = __('group_calendar.months.' . (int) $month->format('n')); // Build a 6x7 grid starting on Monday $firstOfMonth = $month->copy()->startOfMonth(); $gridStart = $firstOfMonth->copy()->startOfWeek(\Carbon\Carbon::MONDAY); $cells = []; for ($i = 0; $i < 42; $i++) { $d = $gridStart->copy()->addDays($i); $cells[] = [ 'date' => $d, 'in_month' => $d->format('Y-m') === $month->format('Y-m'), 'is_today' => $d->format('Y-m-d') === $today, 'events' => $events[$d->format('Y-m-d')] ?? collect(), ]; } $typeColors = [ 'meetup' => '#405189', 'rally' => '#f06548', 'webinar' => '#7a5af8', 'fundraiser' => '#f7b84b', 'volunteer' => '#0ab39c', 'conference' => '#0d6efd', 'other' => '#6c757d', ]; @endphp
{{ __('group_calendar.title') }}
{{ $monthName }} {{ $month->format('Y') }}
@foreach($weekdays as $wd)
{{ $wd }}
@endforeach @foreach($cells as $cell) @php $dayEvents = $cell['events']; $bg = $cell['in_month'] ? 'bg-white' : 'bg-gray-50'; $dateText = $cell['in_month'] ? 'text-gray-700' : 'text-gray-400'; @endphp
@if($cell['is_today']) {{ $cell['date']->day }} @else {{ $cell['date']->day }} @endif @if($dayEvents->count() > 0 && $cell['in_month']) {{ $dayEvents->count() }} @endif
@foreach($dayEvents->take(2) as $ev) {{ $ev->starts_at->format('H:i') }} {{ $ev->title }} @endforeach @if($dayEvents->count() > 2)
+{{ trans_choice('group_calendar.more', $dayEvents->count() - 2, ['count' => $dayEvents->count() - 2]) }}
@endif
@endforeach
{{-- ── QUICK-ADD EVENT MODAL ──────────────────────────── --}}
{{ __('group_calendar.modal_title') }}
@csrf
@push('scripts') @endpush