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

Use date-fns for relative time functions #4583

Closed
wants to merge 1 commit into from
Closed

Conversation

MauAraujo
Copy link
Contributor

@MauAraujo MauAraujo commented Apr 26, 2024

POR-

What does this PR do?

The existing function in the code that we were using to display relative time formats had a bug where if the date was between 8 months and a year, it displayed "8 months" regardless of the actual difference. The rest of dates were displayed correctly, but to avoid any future problems I instead change those function to use the date-fns library.

}

return true;
return isPast(new Date(timestamp)) ? true : false;
Copy link
Contributor

Choose a reason for hiding this comment

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

return isPast(new Date(timestamp))

@MauAraujo
Copy link
Contributor Author

Closing in favor of #4584

@MauAraujo MauAraujo closed this Apr 29, 2024
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