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

The logic behind showing "Yesterday" is wrong IMO #263

Open
shehabic-work opened this issue Jun 3, 2018 · 2 comments
Open

The logic behind showing "Yesterday" is wrong IMO #263

shehabic-work opened this issue Jun 3, 2018 · 2 comments

Comments

@shehabic-work
Copy link

Hello,

First thank you for such great effort,

I wanted to point out that for the logic of Displaying "Yesterday" I strong believe is wrong.

e.g. I'm using it in a news app, showing if I publish something at 23:59:00 then I start reading it at let's say 00:00:10 it shows "Yesterday" rather than 1 minute ago, I'd limit showing yesterday to more than X hours, I'd say this would be 24 hours, so from 1 - 23 hours I'd still show x hours ago, then after that I starting writing yesterday.

@shehabic
Copy link

shehabic commented Jun 3, 2018

Here's a PR to fix it in a simpler way, I've seen another PR but I think this one is much simpler.
#264

@objectivecosta
Copy link

objectivecosta commented Jan 29, 2019

I concur. Yesterday should be for > 24h, shouldn't be possible for 1 or 2 min differences.

Since it is returned by a function called timeAgoSinceNow, it should reflect time, not date.

However, @shehabic's fix doesn't actually fix the issue (at least, not in my tests). It never actually shows the "Yesterday" text. I believe that when the .hour is >= 24, it goes to the .day component, never triggering the "Yesterday" return value.

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

3 participants