Merge pull request #6788 from MontejoJorge/fix/render-upcoming
This commit is contained in:
@@ -45,7 +45,7 @@ function enableScrollX() {
|
||||
|
||||
function renderUpcoming(elem, items) {
|
||||
const groups = [];
|
||||
let currentGroupName = '';
|
||||
let currentGroupName;
|
||||
let currentGroup = [];
|
||||
|
||||
for (let i = 0, length = items.length; i < length; i++) {
|
||||
@@ -66,15 +66,13 @@ function renderUpcoming(elem, items) {
|
||||
}
|
||||
|
||||
if (dateText != currentGroupName) {
|
||||
if (currentGroup.length) {
|
||||
groups.push({
|
||||
name: currentGroupName,
|
||||
items: currentGroup
|
||||
});
|
||||
}
|
||||
|
||||
currentGroupName = dateText;
|
||||
currentGroup = [item];
|
||||
|
||||
groups.push({
|
||||
name: currentGroupName,
|
||||
items: currentGroup
|
||||
});
|
||||
} else {
|
||||
currentGroup.push(item);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user