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
Add Duration.min()
and Duration.max()
#1527
Comments
Hey @icambron, If you are ok with adding these methods to the Duration class, can I be assigned this issue? |
This definitely is not trivial. The problem is that durations by default use "casual" conversion rules, which can make it so this comparison would not be reflexive or transitive, depending on which unit you use for comparison. So, 29 days is both larger and smaller than 1 month, considering the above logic. Also: This gets even more complicated if you have multiple (even different) units on both sides. So really, the user needs to tell which unit to use for the comparison. And even then they might not get the result they want. |
I get what you are saying. I think could be done after any resolution of #1514, right? |
No, this is an inherent property of the casual conversion matrix that Durations use by default. You can read more about it in the documentation. |
Can you please add static methods
min
andmax
to theDuration
, analogous to the methods inDateTime
?The text was updated successfully, but these errors were encountered: