@foreach (['Min', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'] as $day)
{{ $day }}
@endforeach
@foreach ($period as $day)
@php
$tanggal = $day->format('Y-m-d');
$shift = $shifts[$tanggal] ?? null;
$inMonth = $day->month === $date->month;
$isToday = $tanggal === now()->format('Y-m-d');
$isPast = $tanggal < now()->format('Y-m-d');
// Default Colors
$cellBg = $inMonth ? 'bg-white' : 'bg-gray-50/50 text-gray-400';
$badgeBg = '';
$badgeText = '';
if ($shift) {
$shiftColor = $userColors[$shift->user->id] ?? [
'bg' => 'bg-gray-200',
'badge' => 'bg-gray-500',
'text' => 'text-white',
];
$cellBg = $shiftColor['bg'];
$badgeBg = $shiftColor['badge'];
$badgeText = $shiftColor['text'];
}
// Modifikasi Past Day
$pastClasses = '';
if ($isPast) {
$pastClasses = 'opacity-50 pointer-events-none disabled-cell';
if (!$shift) {
$cellBg = 'bg-gray-100';
} else {
$pastClasses .= ' grayscale';
}
}
@endphp
@if ($isToday)
Hari Ini
@endif
{{ $day->day }}
@if ($shift)
{{ $shift->user->name }}
@endif
@endforeach