From 2e516bcd068741d15f63ac0653cd934ada823377 Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Fri, 26 Jun 2026 16:26:44 +0700 Subject: [PATCH] fix: adjust attendance date range logic to use employee join date when available, ensuring accurate attendance tracking --- app/Services/System/AnalysisService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Services/System/AnalysisService.php b/app/Services/System/AnalysisService.php index ea12293..8f2db93 100644 --- a/app/Services/System/AnalysisService.php +++ b/app/Services/System/AnalysisService.php @@ -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;