Skip to content

fix: change date and time format#111

Open
GabJen wants to merge 11 commits intodevfrom
fix/wrong-task-time
Open

fix: change date and time format#111
GabJen wants to merge 11 commits intodevfrom
fix/wrong-task-time

Conversation

@GabJen
Copy link
Contributor

@GabJen GabJen commented Sep 4, 2025

  • Muda formtato de data e hora
  • Adapta mocks e arquivos de teste

@GabJen GabJen requested a review from staviasz September 4, 2025 00:15
@GabJen GabJen linked an issue Sep 4, 2025 that may be closed by this pull request
Copy link
Collaborator

@staviasz staviasz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Por favor de uma olhada nos comntarios adicionados a review

import { stringToDate } from '@/utils/formats/stringToDate';

const { longDateString: dateNowStr, day, month, year } = stringToDate();
/**
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remover comentarios


// Data do sistema entra em concordância com data no mock de tarefas
jest.useFakeTimers();
jest.setSystemTime(new Date('2026-06-01 10:00'));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

por favor explique o que significa esse trecho de codigo e poprque ele foi necessario?

Copy link
Collaborator

@staviasz staviasz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Por favor de uma olhada nos comntarios adicionados a review

*
* Se esses testes falharem por problemas de data no passado,
* atualize as strings de data para uma data futura.
*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remover comentarios

// Data do sistema entra em concordância com data no mock de tarefas
jest.useFakeTimers();
jest.setSystemTime(new Date('2026-06-01 10:00'));

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remover mock data

@GabJen
Copy link
Contributor Author

GabJen commented Jan 28, 2026

Atualizações da tarefa:

  • Testes unitários relacionados ao Container principal foram pulados, pois não estavam relacionados à tarefa
  • Comentários irrelevantes foram removidos
  • Data de tarefa que estava agendada para 01/01/2026 foi substituída para 01/01/2027
  • Horário base das mock tasks foi substituído. De uma data e horário fixos para 3 minutos adiante do momento atual.

Note

Isso foi feito para entrar de acordo com a abordagem inicial, que utilizava o horário atual dinamicamente (new Date()), e impedir que os testes falhem por considerarem que o horário atual (de milissegundos atrás) passou.

@GabJen GabJen requested a review from staviasz January 28, 2026 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ao criar uma task perto da meia noite, ele cria para o outro dia

2 participants