-
Notifications
You must be signed in to change notification settings - Fork 965
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
Fixed issue 238 - Change DefaultDateTimeHumanizeStrategy to turn 60 min ... #278
Conversation
…in to one hour not 45, Humanizr#238
@@ -71,7 +71,7 @@ public void MinutesAgo(int minutes, string expected) | |||
[InlineData(1, "et minut fra nu")] | |||
[InlineData(10, "10 minutter fra nu")] | |||
[InlineData(44, "44 minutter fra nu")] | |||
[InlineData(45, "en time fra nu")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add 60 minutes for all languages please as that's currently missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool will do that today
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry MehdiK didn't get that. I have added the 60 minutes to the strategy it self hence it now works for all languages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. Previously the logic was to return "an hour" for 45 minutes and we had test coverage for that in all locales. The code is now changed/fixed to return "one hour" for 60 minutes but we no longer have unit tests for that in any of the other locales. Just need to fix the tests to reflect the change. Thanks.
Add your PR to the release notes + explaining the breaking change. |
updated release notes with [Humanizr#278](Humanizr#278): Added "60 minutes" to "an hour ago" test cases for all locals
@@ -33,6 +33,9 @@ public string Humanize(DateTime input, DateTime comparisonBase) | |||
if (ts.TotalMinutes < 45) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This condition is not needed any more, as it also included in the next condition < 60
.
We should remove it.
This is now rebased and pushed. Great catch @mexx. It's fixed. |
This is now released to NuGet as v1.27.0. Thanks for your contribution. |
...to one hour not 45, #238