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 #256

Closed
wants to merge 4 commits into from
Closed

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

Jason Ji and others added 4 commits March 29, 2017 11:52
@UberJason
Copy link
Contributor Author

My apologies - this PR accidentally includes some other tweaks. Let me close and try again.

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.

1 participant