Update calendar view to automatically mark missing past days as Absent
This commit is contained in:
@@ -1032,8 +1032,18 @@ class AttendanceRecordController extends Controller
|
||||
$dateIndex = $dateObj->dayOfWeek;
|
||||
$isRestDay = !in_array($dateIndex, $workingDaysIndices);
|
||||
|
||||
$status = $isRestDay ? 'RD' : '--';
|
||||
$label = $isRestDay ? 'Rest Day' : 'Not Marked';
|
||||
$isPast = $dateObj->isBefore(\Carbon\Carbon::today());
|
||||
|
||||
if ($isRestDay) {
|
||||
$status = 'RD';
|
||||
$label = 'Rest Day';
|
||||
} else if ($isPast) {
|
||||
$status = 'A';
|
||||
$label = 'Absent (No Record)';
|
||||
} else {
|
||||
$status = '--';
|
||||
$label = 'Not Marked';
|
||||
}
|
||||
$recordDetail = null;
|
||||
|
||||
if ($userRecords->has($dateKey)) {
|
||||
@@ -1242,8 +1252,13 @@ class AttendanceRecordController extends Controller
|
||||
$status = 'W';
|
||||
$label = 'Weekend';
|
||||
} else {
|
||||
$status = '--';
|
||||
$label = 'Not Marked';
|
||||
if ($isPast) {
|
||||
$status = 'A';
|
||||
$label = 'Absent (No Record)';
|
||||
} else {
|
||||
$status = '--';
|
||||
$label = 'Not Marked';
|
||||
}
|
||||
}
|
||||
|
||||
$recordDetail = null;
|
||||
|
||||
Reference in New Issue
Block a user