Created
February 2, 2017 10:36
-
-
Save dimaShin/67b4836c7f7b8bff99010e0bc7dcce0a to your computer and use it in GitHub Desktop.
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
const events = group.events; | |
const aggregatedRanges = [ new AggregatedRange(events[0]) ]; | |
for (let i = 1; i < events.length; i++) { | |
const range = aggregatedRanges[aggregatedRanges.length -1]; | |
const event = events[i]; | |
if (event.data.start < range.end) { | |
range.events.push(event); | |
if (event.data.end > range.end) { | |
range.end = event.data.end; | |
} | |
} else { | |
aggregatedRanges.push(new AggregatedRange(event)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment