fix: fix employee logged in when only one attendance registration is found
This commit is contained in:
parent
8ec8d481b8
commit
b4ccd1ed76
|
|
@ -10,7 +10,7 @@ import {
|
|||
isBefore,
|
||||
isWithinInterval,
|
||||
set,
|
||||
subMilliseconds
|
||||
subMilliseconds,
|
||||
} from 'date-fns';
|
||||
import { getTimezoneOffset, toZonedTime } from 'date-fns-tz';
|
||||
|
||||
|
|
@ -303,7 +303,8 @@ export class EmployeesLoggedInDetector extends AnomalyDetector {
|
|||
isBefore(lastClockedOut.dateTime, firstClockedIn.dateTime)
|
||||
) {
|
||||
return [
|
||||
false,
|
||||
isBefore(firstClockedIn.dateTime, datetimeToCheckWithBuffer) ||
|
||||
isBefore(firstClockedIn.dateTime, datetimeToCheck),
|
||||
{
|
||||
start: firstClockedIn.dateTime,
|
||||
end: undefined,
|
||||
|
|
@ -320,6 +321,7 @@ export class EmployeesLoggedInDetector extends AnomalyDetector {
|
|||
start: new Date(firstClockedIn.dateTime),
|
||||
end: new Date(lastClockedOut.dateTime),
|
||||
};
|
||||
|
||||
return [
|
||||
isWithinInterval(datetimeToCheckWithBuffer, interval) ||
|
||||
isWithinInterval(datetimeToCheck, interval),
|
||||
|
|
|
|||
Loading…
Reference in New Issue