I have an array of objects with the following format:
const timeframes = [{
dateStart: '2023-09-20 08:00:00',
dateEnd: '2023-09-22 09:00:00',
}, {
dateStart: '2023-09-26 18:00:00',
dateEnd: '2023-09-29 22:35:00',
}];
Assuming the length of this array to be a finite number, how do I check if the range of datetime values, timeframes
, overlaps a datetime value provided by user, i.e. const datetimeProvided = {dateStart: '2023-09-21 07:45:00', dateEnd: '2023-09-27 09:00:00'}
?