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

DateTime Humanize #2

Closed
PallaviRathore opened this issue Aug 15, 2013 · 3 comments
Closed

DateTime Humanize #2

PallaviRathore opened this issue Aug 15, 2013 · 3 comments
Labels

Comments

@PallaviRathore
Copy link

When i do DateTime.Now.AddDays(-1).Humanize() i get result as "23 hours ago" and not as yesterday which i have expected.
Am i doing anything wrong?
Also DateTime.Now.AddDays(1).Humanize() gives me result as not yet.

@MehdiK
Copy link
Member

MehdiK commented Aug 24, 2013

The first instance gives you 23 hours ago because by the time humanizer gets to calculate the time the cpu has ticked past yesterday!! If you tried DateTime.Now.AddDays(-1).AddSeconds(-1) then you should get Yesterday as expected.

With regards to future dates that's the algorithm used by stackoverflow; but I agree it would be nice to get a similar result to the past dates. Will add that in. Thanks.

@MehdiK
Copy link
Member

MehdiK commented Jan 24, 2014

I am going to close this issue in favor of the new #67 as that's explicitly about future dates. Hopefully will do this soon.

@MehdiK MehdiK closed this as completed Jan 24, 2014
@MehdiK
Copy link
Member

MehdiK commented Jan 31, 2014

This is now done and released as 1.7.1 to NuGet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants