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

Patch time ago #257

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

UberJason
Copy link
Contributor

Bug fix for #243 where the timeAgo function would fail to return an adequate result of yesterday. Looking at the code, it defines yesterday as date.subtract(1.day):

let yesterday = date.subtract(1.days)
let isYesterday = yesterday.day == self.day

But date isn't always the later of the two dates, and the code actually computes which of the two dates should be the latest and which should be the earliest. They're just not being used here. The patch fixes this by ensuring that "yesterday" is the latest date minus 1 day.

let yesterday = latest.subtract(1.days)
let isYesterday = yesterday.day == earliest.day

…d reading an incorrect number of hours apart.
@UberJason UberJason changed the title Bug fix for timeAgo Patch time ago Apr 6, 2018
… but the day component is 2 apart. (Example: April 19, 10PM and April 21, 2PM)
@darquro
Copy link

darquro commented Oct 18, 2018

I'm having the same issue. Please marge!

@suxur
Copy link

suxur commented Jan 17, 2019

I'm having this issue as well. Is this library still supported?

@BrentMifsud
Copy link

having this issue as well

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.

4 participants