added one more codition if emp checkIn and checkOut and checkout day is current , so ee can able to checkIn otherwise their attendance approved of that day

This commit is contained in:
Pramod Mahajan 2025-05-02 14:23:18 +05:30
parent 22be64d393
commit cb2950338c

View File

@ -74,15 +74,31 @@ const useAttendanceStatus = (attendanceData) => {
text: "Regularize", text: "Regularize",
color: 'btn-warning', color: 'btn-warning',
}); });
}else if(activity === 4 && checkInTime !== null && checkOutTime !== null && !timeElapsed(checkInTime,THRESH_HOLD) ){ } else if ( activity === 4 && checkInTime !== null && checkOutTime !== null && !timeElapsed( checkInTime, THRESH_HOLD ) )
setStatus({ {
status: "Check-In",
action: ACTIONS.CHECK_IN, if ( activity === 4 && checkInTime !== null && checkOutTime !== null && new Date(checkOutTime).toDateString() !== new Date().toDateString())
disabled: false, {
text: "Check In", setStatus( {
color: 'btn-primary', status: "Approved",
}) action: ACTIONS.APPROVED,
}else if(activity === 2 && checkInTime !== null ){ disabled: true,
text: "Approved",
color: 'btn-success',
} );
} else
{
setStatus( {
status: "Check-In",
action: ACTIONS.CHECK_IN,
disabled: false,
text: "Check In",
color: 'btn-primary',
} )
}
}
else if ( activity === 2 && checkInTime !== null )
{
setStatus({ setStatus({
status: "Requested", status: "Requested",
action: ACTIONS.REQUESTED, action: ACTIONS.REQUESTED,