Remove empty events from Agenda::getNextOfEach

This commit is contained in:
Jørn Åne 2016-08-27 00:13:28 +02:00
parent d9ff461877
commit 305b4e7064
1 changed files with 2 additions and 2 deletions

View File

@ -70,11 +70,11 @@ class Agenda {
}
public function getNextOfEach(DateTimeImmutable $startDate) {
$result = array_map(
$result = array_filter(array_map(
function($a) use ($startDate){
return $a->getNextEventFrom($startDate);
}, $this->activities
);
), function($a){return $a;});
usort($result, function($a, $b) {
return ($a->getStart()->getTimeStamp() < $b->getStart()->getTimeStamp())
? -1