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,7 +74,20 @@ const useAttendanceStatus = (attendanceData) => {
text: "Regularize",
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 ) )
{
if ( activity === 4 && checkInTime !== null && checkOutTime !== null && new Date(checkOutTime).toDateString() !== new Date().toDateString())
{
setStatus( {
status: "Approved",
action: ACTIONS.APPROVED,
disabled: true,
text: "Approved",
color: 'btn-success',
} );
} else
{
setStatus( {
status: "Check-In",
action: ACTIONS.CHECK_IN,
@ -82,7 +95,10 @@ const useAttendanceStatus = (attendanceData) => {
text: "Check In",
color: 'btn-primary',
} )
}else if(activity === 2 && checkInTime !== null ){
}
}
else if ( activity === 2 && checkInTime !== null )
{
setStatus({
status: "Requested",
action: ACTIONS.REQUESTED,