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

Added maximum TimeUnit to TimeSpanHumanizeExtensions.Humanize #384

Merged
merged 6 commits into from
Feb 28, 2015

Conversation

mthamil
Copy link
Contributor

@mthamil mthamil commented Feb 23, 2015

Fixes #383
Added a parameter, TimeUnit maxUnit, to TimeSpanHumanizeExtensions.Humanize methods to prevent rolling up to the next largest unit of time.
For example, TimeSpan.FromDays(7).Humanize(maxUnit: TimeUnit.Day) outputs "7 days" instead of "1 week". The parameter is defaulted to TimeUnit.Week to preserve existing behavior.

MehdiK added a commit that referenced this pull request Feb 28, 2015
Added maximum TimeUnit to TimeSpanHumanizeExtensions.Humanize
@MehdiK MehdiK merged commit 5238885 into Humanizr:master Feb 28, 2015
@MehdiK
Copy link
Member

MehdiK commented Feb 28, 2015

Very well done. Thanks for the contribution.

@MehdiK
Copy link
Member

MehdiK commented Mar 4, 2015

This is now released to NuGet as v1.34.0. Thanks.

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.

Allow TimeSpanHumanizeExtensions.Humanize to take a maximum TimeUnit.
2 participants