Here's a solution that uses an internal chart like this:
09 10 11 12 13 14 15 16 17 18 19 20
(------------- 1 ------------)
(----------------- 2 ---------------)
(----- 3 -----)
(----- 4 ------)
(------------ 5 ------------)
and then collects the key times on there (where any event stops or starts), here 9, 11, 12, 13, 14, 15, 18, and 20, groups those into pairs, such as 9 - 11, 11 - 12, ... 18 - 20, and for each one finds the events which start before the period's end and end after its start. It then filters the list to return those which have more than one event:
// utility functions
const inPairs = (xs) => xs .slice (1) .map ((x, i) => [xs [i], x])
const uniq = (xs) => [... new Set (xs)]
// main function
const overlaps = (events) =>
inPairs (uniq (events .flatMap ((w) => [w .startDate, w .endDate])) .sort ())
.map (([start, end]) => ({
start,
end,
events: events.filter (e => e .startDate < end && e.endDate > start) .map (e => e .id)
}))
.filter (({events}) => events .length > 1)
// sample data
const meetings = [{id: 1, startDate: '2022-03-29T14:00:00', endDate: '2022-03-29T18:00:00'}, {id: 2, startDate: '2022-03-29T15:00:00', endDate: '2022-03-29T20:00:00'}, {id: 3, startDate: '2022-03-29T09:00:00', endDate: '2022-03-29T11:00:00'}, {id: 4, startDate: '2022-03-29T11:00:00', endDate: '2022-03-29T13:00:00'}, {id: 5, startDate: '2022-03-29T12:00:00', endDate: '2022-03-29T16:00:00'}]
// demo
const conflicts = overlaps (meetings)
// display
conflicts .forEach (({start, end, events}) => console .log (`${start} - ${end}: events: ${events .join (', ')}`))
inPairs converts something like ['a', 'b', 'c', 'd'] into [['a', 'b']. ['b', 'c'], ['c', 'd']].
uniq simply collects the unique elements of an array of elements.
Our main function, overlaps first collects all the start and end dates of a list of events, finds the unique elements, sorts them, and then uses inPairs to turn that list into an array of periods. We map these into objects, finding all the events which overlap the period. Finally, we filter them to those which include more than one event.
This uses ISO-8601 string dates rather than Date objects. If you want to use actual dates, you will need to find another way to create the unique set and to do the event filtering. Those aren't hard, but it might be easier just to convert into this format before you call this function.
This doesn't solve your outer problem, but does give you a list of conflicts, and the events in each one.