chore: simplify
gitea/salix/pipeline/head This commit looks good Details
gitea/salix/pipeline/pr-master This commit looks good Details

This commit is contained in:
Alex Moreno 2024-12-09 14:30:45 +01:00
parent 9403588d7b
commit eaa62909ff
1 changed files with 1 additions and 2 deletions

View File

@ -62,9 +62,8 @@ module.exports = Self => {
await models.ACL.checkAccessAcl(ctx, 'Worker', 'canCreateAbsenceInPast', 'WRITE');
const now = Date.vnNew();
const newDate = new Date(args.dated).getTime();
const nowDate = now.getTime();
if ((nowDate > newDate) && !canCreateAbsenceInPast)
if ((now.getTime() > newDate) && !canCreateAbsenceInPast)
throw new UserError(`Holidays to past days not available`);
const labour = await models.WorkerLabour.findById(args.businessFk,