Skip to content

Commit

Permalink
add ~ 5 minutes leeway to determine whether a date/time is in the past
Browse files Browse the repository at this point in the history
  • Loading branch information
Amy Chen authored and Paul F Bugni committed Jan 14, 2025
1 parent d402105 commit 844ebe3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion patientsearch/src/js/helpers/utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,8 @@ export function isInPast(dateString) {
const today = new Date();
const targetDate = new Date(dateString);
if (!isValid(targetDate)) return false;
return targetDate < today;
const diff = (today - targetDate); // in miniseconds
return diff > (1000 * 60 * 5); // this will check if diff is 5 minutes or more
}

/*
Expand Down

0 comments on commit 844ebe3

Please sign in to comment.