You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
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.
The text was updated successfully, but these errors were encountered: