diff --git a/modules/worker/back/models/worker.js b/modules/worker/back/models/worker.js index e1adca77e..2e45b78da 100644 --- a/modules/worker/back/models/worker.js +++ b/modules/worker/back/models/worker.js @@ -28,9 +28,9 @@ module.exports = Self => { Self.canModifyAbsenceInPast = async(ctx, time) => { const hasPrivs = await Self.app.models.ACL.checkAccessAcl(ctx, 'Worker', 'canModifyAbsenceInPast', 'WRITE'); - const now = Date.vnNew(); - now.setHours(0, 0, 0, 0); - return hasPrivs || now.getTime() < time; + const today = Date.vnNew(); + today.setHours(0, 0, 0, 0); + return hasPrivs || today.getTime() < time; }; async function tinIsValid(err, done) {