From eaa62909ff5a3241f0a7f4ce5143f8adcb84a7f7 Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 9 Dec 2024 14:30:45 +0100 Subject: [PATCH] chore: simplify --- modules/worker/back/methods/worker/createAbsence.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/worker/back/methods/worker/createAbsence.js b/modules/worker/back/methods/worker/createAbsence.js index 34dcd1f59..e46ce9577 100644 --- a/modules/worker/back/methods/worker/createAbsence.js +++ b/modules/worker/back/methods/worker/createAbsence.js @@ -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,