Commit e1ad374e authored by Nienke Wessel's avatar Nienke Wessel
Browse files

Merge branch 'fix/welcome-not-showing-events' into 'master'

Welcome screen now displays correctly when there are only two or fewer events.

See merge request !53
parents dbffe0bb c67bc4b1
......@@ -29,16 +29,12 @@ const eventListToSections = (eventList) => {
for (let i = 0; i < numberOfDays && eventIndex < eventList.length; i += 1) {
const first = eventList[eventIndex];
eventIndex += 1;
const list = [];
let next = first;
while (Moment(first.start).isSame(next.start, 'day') && eventIndex < eventList.length) {
list.push(next);
next = eventList[eventIndex];
while (eventIndex < eventList.length && Moment(first.start).isSame(eventList[eventIndex].start, 'day')) {
list.push(eventList[eventIndex]);
eventIndex += 1;
}
eventLists.push(list);
eventIndex -= 1;
}
return eventLists.map(list => ({
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment