dates: fix missing Today entry if it would be last entry (#94)

This commit is contained in:
Michael Terry
2020-06-23 09:39:54 -04:00
committed by GitHub
parent d55c8b134c
commit 1471abe7dd

View File

@@ -53,6 +53,9 @@ export default function Timeline() {
groupedDates[groupedDates.length - 1].items.push(dateInfo);
}
});
if (!foundToday) {
groupedDates.push({ date: now, items: [] });
}
if (groupedDates.length) {
groupedDates[groupedDates.length - 1].last = true;
}