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.UtcNow.AddMinutes(-5) - DateTime.UtcNow).Humanize() results in arguments out of range of valid values #436

Closed
htapal opened this issue Jun 29, 2015 · 7 comments

Comments

@htapal
Copy link

htapal commented Jun 29, 2015

Just upgraded Humanizer to latest version from 1.34.0 to 1.36.0 and started receiving errors when Humanizing a timespan with a negative value.

(DateTime.UtcNow.AddDays(-5) - DateTime.UtcNow).Humanize()
Specified argument was out of the range of valid values.
Parameter name: count

@htapal
Copy link
Author

htapal commented Jun 29, 2015

I downgraded to 1.36.0 and that version doesn't exhibit this issue. It correctly handles a negative time span as "no time value" message.

@MehdiK
Copy link
Member

MehdiK commented Jul 1, 2015

Thanks for reporting this @htapal. Would you be able to send a PR with a supporting test please?

@jeremysimmons
Copy link
Contributor

Suggest merging this with #434

@MehdiK
Copy link
Member

MehdiK commented Jul 2, 2015

This is fixed by #438 although it will not report the negative values as 'no time value'. It will Humanize it as if it's a positive value.

@htapal
Copy link
Author

htapal commented Jul 2, 2015

Thanks @MehdiK. Apologies for the silence as I'd been traveling. I'm assuming this will be included in the next release?

@MehdiK
Copy link
Member

MehdiK commented Jul 2, 2015

No worries. Yup!

@MehdiK
Copy link
Member

MehdiK commented Jul 2, 2015

Now up on NuGet

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

No branches or pull requests

3 participants