This commit is contained in:
Oliver Davies 2017-11-02 00:16:43 +00:00
parent 7a49f59294
commit ed29c5a92b

View file

@ -53,11 +53,9 @@ class FormatTalksExtension extends Twig_Extension
* @return array * @return array
*/ */
public function getUpcoming(array $data) { public function getUpcoming(array $data) {
$talks = $this->format($data)->filter(function ($talk) { return $this->sort($this->format($data)->filter(function ($talk) {
return $talk['event']['date'] >= $this->today; return $talk['event']['date'] >= $this->today;
}); }));
return $this->sort($talks);
} }
/** /**
@ -70,11 +68,9 @@ class FormatTalksExtension extends Twig_Extension
* @return array * @return array
*/ */
public function getPast(array $data) { public function getPast(array $data) {
$talks = $this->format($data)->filter(function ($talk) { return $this->sort($this->format($data)->filter(function ($talk) {
return $talk['event']['date'] < $this->today; return $talk['event']['date'] < $this->today;
}); }));
return $this->sort($talks);
} }
/** /**