Skip to content

Inconsistent use of "yesterday" #313

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

Open
JasonBarnabe opened this issue Apr 30, 2025 · 0 comments
Open

Inconsistent use of "yesterday" #313

JasonBarnabe opened this issue Apr 30, 2025 · 0 comments

Comments

@JasonBarnabe
Copy link

Using relative-time-element v4.4.5.

I am in a UTC-5 time zone. The current time for me is April 30 1:53PM (2025-04-30 18:53 UTC).

I've set up a test page at https://greasyfork.org/en/relative_date_test to show the last 48 hours of <relative-time>. Here is what I see:

Image

  • 0 hours ago shows "now", no issue.
  • 1 - 13 hours ago (Apr 30 for me) - shows as "x hours ago", no issue.
  • 14 - 20 hours ago (Apr 29 for me) - shows as "x hours ago", could also show as "yesterday", but that's fine.
  • 21 - 35 hours ago (Apr 29 for me) - shows as "yesterday", no issue.
  • 36 - 37 hours ago (Apr 29 for me) - shows as "2 days ago".
  • 38 - 48 hours ago (Apr 28 for me) - shows as "2 days ago", no issue.

36 and 37 hours ago for me is Apr 29 12:53AM and 1:53AM, which is still "yesterday", not "2 days ago". Especially weird that then Apr 29 2:53AM is "yesterday".

I imagine that maybe "1.5 days ago" is getting rounded up to "2 days ago", but "yesterday" is a concept of calendar dates and not a number of hours, so there's no reason to stop using that term until it's no longer 1 calendar day ago.

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

No branches or pull requests

1 participant