@php
$months = [
1 => 'Jan', 2 => 'Feb', 3 => 'Mar', 4 => 'Apr',
5 => 'Mei', 6 => 'Jun', 7 => 'Jul', 8 => 'Agu',
9 => 'Sep', 10 => 'Okt', 11 => 'Nov', 12 => 'Des',
];
@endphp
@for ($m = 1; $m <= 12; $m++)
@php
$monthEvents = collect($yearData['events'])->filter(fn ($e) => $e['month'] === $m)->values();
@endphp
@if ($monthEvents->isNotEmpty())
{{ $months[$m] }}
@foreach ($monthEvents as $ev)
@php
$a = $ev['author'];
$birthYear = (int) $a->birth_date->year;
$deathYear = $a->death_date ? (int) $a->death_date->year : null;
@endphp
@if ($ev['kind'] === 'birth')
@else
@endif
{{ $a->name }}
{{ $a->birth_date->format('d-m') }}{{ $a->death_date ? ' / ' . $a->death_date->format('d-m') : '' }}
@endforeach
@endif
@endfor