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:
parent
1ffda41f16
commit
213ca4067e
@ -74,15 +74,31 @@ const useAttendanceStatus = (attendanceData) => {
|
||||
text: "Regularize",
|
||||
color: 'btn-warning',
|
||||
});
|
||||
}else if(activity === 4 && checkInTime !== null && checkOutTime !== null && !timeElapsed(checkInTime,THRESH_HOLD) ){
|
||||
setStatus({
|
||||
status: "Check-In",
|
||||
action: ACTIONS.CHECK_IN,
|
||||
disabled: false,
|
||||
text: "Check In",
|
||||
color: 'btn-primary',
|
||||
})
|
||||
}else if(activity === 2 && checkInTime !== null ){
|
||||
} 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,
|
||||
disabled: false,
|
||||
text: "Check In",
|
||||
color: 'btn-primary',
|
||||
} )
|
||||
}
|
||||
}
|
||||
else if ( activity === 2 && checkInTime !== null )
|
||||
{
|
||||
setStatus({
|
||||
status: "Requested",
|
||||
action: ACTIONS.REQUESTED,
|
||||
|
Loading…
x
Reference in New Issue
Block a user