fix edge case for humanize month - #894
Closed
devchilll wants to merge 4 commits into
Closed
Conversation
Codecov Report
@@ Coverage Diff @@
## master #894 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 9 9
Lines 1817 1819 +2
Branches 320 321 +1
=========================================
+ Hits 1817 1819 +2
Continue to review full report at Codecov.
|
systemcatch
reviewed
Dec 15, 2020
systemcatch
left a comment
Collaborator
There was a problem hiding this comment.
The only problem now @yiransii is that we get this happening.
>>> import arrow
>>> dt1=arrow.utcnow()
>>> dt2=dt1.shift(days=+29)
>>> dt1
<Arrow [2020-12-15T19:38:49.844060+00:00]>
>>> dt2
<Arrow [2021-01-13T19:38:49.844060+00:00]>
>>> dt1.humanize(dt2)
'a month ago'
>>> dt2.humanize(dt1)
'in a month'Where as on master we still get the correct result.
>>> dt1.humanize(dt2)
'4 weeks ago'
>>> dt2.humanize(dt1)
'in 4 weeks'
Collaborator
|
Hey @yiransii I'll close this for now, let me know if you want to take it up again. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Checklist
Thank you for taking the time to improve Arrow! Before submitting your pull request, please check all appropriate boxes:
toxormake testto find out!).tox -e lintormake lintto find out!).masterbranch.Description of Changes
Added edge case handling for the
humanizemethod to describe the delta of both 30 days and 31 days as "1 month".For instance,
should print
Closes: #749