fix: adjust attendance date range logic to use employee join date when available, ensuring accurate attendance tracking

This commit is contained in:
Yoga Pangestu 2026-06-26 16:26:44 +07:00
parent f34406afae
commit 2e516bcd06

View File

@ -62,8 +62,8 @@ public function getMyAttendance(User $user, ?Carbon $startDate = null, ?Carbon $
];
}
$start = $startDate ?? Carbon::today()->startOfMonth();
$end = $endDate ?? Carbon::today()->endOfMonth();
$start = $startDate ?? ($employee->join_date ? Carbon::parse($employee->join_date) : Carbon::today()->startOfMonth());
$end = $endDate ?? Carbon::today();
$totalDays = 0;
$presentDays = 0;