Skip to content

Commit

Permalink
fix(page-job-scheduler): ajusta diferença na data selecionada
Browse files Browse the repository at this point in the history
Ajustado a diferença entre a data selecionada e a data submitida para API

fixes DTHFUI-10152
  • Loading branch information
anderson-gregorio-totvs authored and pedrodominguesp committed Nov 4, 2024
1 parent 662812f commit ebea302
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ describe('PoPageJobSchedulerService:', () => {
const jobSchedulerInternal = {
periodicity: 'single',
recurrent: undefined,
firstExecution: new Date(),
firstExecution: new Date().toISOString(),
firstExecutionHour: '10:00'
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,16 @@ export class PoPageJobSchedulerService {
}

private replaceHourFirstExecution(date: string, time: string): string {
const firstExecutionDate = new Date(date);
const dateSplited = date.split('-');
const year = parseInt(dateSplited[0]);
const monthIndex = parseInt(dateSplited[1]) - 1;
const day = parseInt(dateSplited[2]);

const timeSplited = time.split(':');

const hours = parseInt(timeSplited[0], 10);
const minutes = parseInt(timeSplited[1], 10);

firstExecutionDate.setHours(hours, minutes);
const firstExecutionDate = new Date(year, monthIndex, day, hours, minutes);

return convertDateToISOExtended(firstExecutionDate);
}
Expand Down

0 comments on commit ebea302

Please sign in to comment.