I am currently working with an array of time ranges that have both start and end values.
var timeRanges = [{
start: 120,
end: 140
},{
start: 180,
end: 220
},{
start: 250,
end: 300
}]
My task requires me to determine if the selected range overlaps with any of the given time ranges. Additionally, the selected range must fall within the intervals defined by the timeRanges. For example, 140-180 and 220-250 would be valid selections.
var selected = {
start: 150,
end: 170
}