Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

201
Visualizações
How can I change text based on how long ago it was using JS?

I'm setting up an online dashboard for monitoring whether hardware is operational or not. This information is shown in a table. It would say when the hardware was 'last seen'.

I am able to get the date/time 'last seen' data in this format: 2022-05-25 12:15

The data becomes a table that won't inherently have any IDs.

What I would like to do is have the text 2022-05-25 12:15 change colour based on how long ago it was from the present time. For example, if it was 'last seen' more than ten minutes ago, the text would turn red to alert people that it needs to be checked out.

I am not handling the backend of this project, just the frontend.

How would I be able to change the colour of the text in the value based on how long ago it was?

Thanks!

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda