Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

200
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda