Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

208
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!