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

Date Time Humanize should not use tomorrow unless it is actually tomorrow. #254

Closed
deeksy opened this issue Apr 29, 2014 · 4 comments
Closed

Comments

@deeksy
Copy link

deeksy commented Apr 29, 2014

Humanize on a date time that uses precision is not smart enough with reference to dates.

If I select two dates that are 1.25 days apart but are actually 10:00pm on a Monday to 4:00 am on a Wednesday, Humanize will return "tomorrow", which is clearly wrong. Tomorrow is a defined concept and should only appear when the date is actually 1 day from now.

@DanAtkinson
Copy link

Do you have a code sample?

@hazzik
Copy link
Member

hazzik commented Jun 19, 2014

The example is like following:

var now = DateTime.Now; // run at 10p.m.
var then = now.AddDays(1.25);
Console.WriteLine(now);
Console.WriteLine(then);
Console.WriteLine(then.Humanize());
19.06.2014 22:24:18
21.06.2014 4:24:18
tomorrow

@DanAtkinson
Copy link

I see what you're saying now, thanks! I'm not sure why but I wasn't getting this into my head before! :)

@MehdiK
Copy link
Member

MehdiK commented Jul 7, 2014

This is fixed in #309

@MehdiK MehdiK closed this as completed Jul 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants