This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
findOverlappingIntervals = (intervals) -> | |
# throw all dates into an array. each date object also knows whether it is a start or end | |
# date. after sorting, each start you hit signifies an interval. each end you hit signifies an | |
# interval ends. if the interval counter is greater than zero, it means there is an overlap | |
# construct list of start and end dates from all intervals | |
dates = [] | |
for interval, index in intervals | |
startElement = | |
type: 'start' |