Ensure that only future events can be retrieved
This commit is contained in:
parent
306082d17b
commit
fddaa56ed2
2 changed files with 30 additions and 8 deletions
|
@ -61,11 +61,9 @@ class TalksExtension extends Twig_Extension
|
|||
*/
|
||||
public function getUpcoming($talks, array $eventData = [])
|
||||
{
|
||||
return $this->format($talks, $eventData)
|
||||
->filter(function ($talk) {
|
||||
return $talk['event']['date'] >= $this->today;
|
||||
})
|
||||
->sortBy('event.date');
|
||||
return $this->getAll($talks)->filter(function ($talk) {
|
||||
return collect($talk['events'])->pluck('date')->sort()->last() >= $this->today;
|
||||
})->values();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -80,7 +78,7 @@ class TalksExtension extends Twig_Extension
|
|||
{
|
||||
return $this->getAll($talks)->filter(function ($talk) {
|
||||
return collect($talk['events'])->pluck('date')->sort()->last() < $this->today;
|
||||
});
|
||||
})->values();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue