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
Interval equality #544
Comments
To test exact equality, Do you have a use case that calls for needing to know whether an interval range is precisely the same, but where the step of the interval doesn't matter? |
Hi @bitwalker , Thanks for the quick response. On a side project I decided to use Interval(s) to represent the date at which a product becomes available and the date at which it expires. That could be when your bag of apples is purchasable online and when they disappear from the website because they are completely rotten at this date. It could be when an early bird ticket to Elixir Conf becomes available and when it's not anymore. In both examples, I don't need the |
Don't you think that |
@svarlet as mentioned by @NobbZ, the use of |
Thanks for the feedback. I didn't know about Date.range but unfortunately that won't quite work for me. Date.range only works with Date, not DateTime. |
Hi,
First of all, thanks for the great work, this is such a good library and so useful!
I am using
Timex.Interval
and I am suddenly wondering how to test equality of 2 intervals? There isn't any function for this. I'm tempted to use one of the others likecontains?/2
and do this:Would it work? is there a better way?
As someone noted in the slack chat, the
steps
property would certainly make my implementation of equal wrong. In this particular instance I don't use the steps property so I'd be fine.The text was updated successfully, but these errors were encountered: