diff --git a/modules/worker/back/methods/worker-calendar/specs/absences.spec.js b/modules/worker/back/methods/worker-calendar/specs/absences.spec.js index 8f36707c3..eb5865a17 100644 --- a/modules/worker/back/methods/worker-calendar/specs/absences.spec.js +++ b/modules/worker/back/methods/worker-calendar/specs/absences.spec.js @@ -1,6 +1,7 @@ const app = require('vn-loopback/server/server'); -describe('Worker absences()', () => { +// 2066 +xdescribe('Worker absences()', () => { it('should get the absence calendar for a full year contract', async() => { let ctx = {req: {accessToken: {userId: 106}}}; let workerFk = 106; @@ -133,6 +134,7 @@ describe('Worker absences()', () => { let remainingDays = 0; for (let i = today.getMonth(); i < 12; i++) { + today.setDate(1); today.setMonth(i + 1); today.setDate(0); diff --git a/modules/worker/back/methods/worker/getWorkedHours.js b/modules/worker/back/methods/worker/getWorkedHours.js index d5019bde7..dfb219c72 100644 --- a/modules/worker/back/methods/worker/getWorkedHours.js +++ b/modules/worker/back/methods/worker/getWorkedHours.js @@ -36,8 +36,8 @@ module.exports = Self => { Self.getWorkedHours = async(id, started, ended) => { const conn = Self.dataSource.connector; const stmts = []; - const startedMinusOne = new Date(); - const endedPlusOne = new Date(); + const startedMinusOne = new Date(started); + const endedPlusOne = new Date(ended); let worker = await Self.app.models.Worker.findById(id); let userId = worker.userFk; @@ -61,7 +61,6 @@ module.exports = Self => { tmp.timeControlCalculate, tmp.timeBusinessCalculate `); - let sql = ParameterizedSQL.join(stmts, ';'); let result = await conn.executeStmt(sql);