Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ~ 5 minutes leeway to determine whether a date/time is in the past #236

Merged
merged 4 commits into from
Jan 15, 2025

Conversation

achen2401
Copy link
Contributor

Per Slack convo

When determine whether date/time for the Next Message column is in the past (see here), add 5 minutes for comparison.

@achen2401 achen2401 requested a review from pbugni January 14, 2025 01:10
@pbugni pbugni force-pushed the feature/time-in-past-comparison branch from 3b70a32 to 844ebe3 Compare January 14, 2025 22:27
@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd love a comment that explains the buffer, i.e.:

pad by 5 mins to give system time to transmit message, rather than indicate no next message time during processing

@achen2401 achen2401 marked this pull request as ready for review January 14, 2025 22:37
@achen2401 achen2401 merged commit 534a996 into develop Jan 15, 2025
7 checks passed
@achen2401 achen2401 deleted the feature/time-in-past-comparison branch January 15, 2025 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants