Skip to content

Commit

Permalink
remove logs
Browse files Browse the repository at this point in the history
  • Loading branch information
HenriqueAmorim20 committed Dec 9, 2023
1 parent aaa091a commit 8f2e68f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/rotina/rotina.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,12 @@ export class RotinaService {

const dataStringArray = data.replace(',', '').split('/');
const dataString = `${dataStringArray[2]}-${dataStringArray[1]}-${dataStringArray[0]}`;
const weekday = new Date(dataString).getDay();
const startString = `${dataString}T00:00:00.000Z`;
const endString = `${dataString}T23:59:59.000Z`;
const weekday = new Date(`${dataString}T00:00:00.000`).getDay();

const where = `"notificacao" = ${true} AND (("dataHora"::date BETWEEN '${startString}'::date AND '${endString}'::date) OR (dias && '{${weekday}}'::rotina_dias_enum[])) AND lpad(date_part('hour', "dataHora")::text, 2, '0') || ':' || lpad(date_part('minute', "dataHora")::text, 2, '0') = '${hora}'`;

console.log(where);

return this._repository
.createQueryBuilder('rotinas')
.where(where)
Expand Down

0 comments on commit 8f2e68f

Please sign in to comment.