From fe624a97f8f702ebfc4e833bf0e129ae1aa70a43 Mon Sep 17 00:00:00 2001 From: Amy Chen Date: Tue, 14 Nov 2023 13:18:24 -0800 Subject: [PATCH] times ago, conversion fix (#203) Co-authored-by: Amy Chen --- patientsearch/src/js/helpers/utility.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/patientsearch/src/js/helpers/utility.js b/patientsearch/src/js/helpers/utility.js index 046b0a32..89480782 100644 --- a/patientsearch/src/js/helpers/utility.js +++ b/patientsearch/src/js/helpers/utility.js @@ -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) {