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