Skip to content

Commit

Permalink
times ago, conversion fix (#203)
Browse files Browse the repository at this point in the history
Co-authored-by: Amy Chen <clone@cesium.cirg.washington.edu>
  • Loading branch information
achen2401 and Amy Chen authored Nov 14, 2023
1 parent 4e8a711 commit fe624a9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions patientsearch/src/js/helpers/utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,10 @@ export function getTimeAgoDisplay(objDate) {
const total = today - objDate;
// future date
if (total < 0) return null;
const seconds = Math.round((today - objDate) / 1000);
const minutes = Math.round(seconds / 60);
const hours = Math.round(minutes / 60);
const days = Math.round(hours / 24);
const seconds = Math.floor((today - objDate) / 1000);
const minutes = Math.floor(seconds / 60);
const hours = Math.floor(minutes / 60);
const days = Math.floor(hours / 24);
if (seconds < 5) {
return "now";
} else if (seconds < 60) {
Expand Down

0 comments on commit fe624a9

Please sign in to comment.