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

Add a method to Range to detect overlap/intersection with another Range #14487

Open
jgaskins opened this issue Apr 15, 2024 · 0 comments
Open

Comments

@jgaskins
Copy link
Contributor

The Range type doesn't currently tell you if it overlaps with another instance, but it's a useful thing to check for. For example, a scheduling app may need to detect whether a given time period conflicts with any existing meetings/events:

existing_events.any?(&.overlaps?(range))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants