Show talks that have been on past days

Technically, if a talk is due to be given today, it hasn't been
presented yet and shouldn't be included within the talk count.

This commit changes the comparison to match on talks that were given
yesterday instead of today.
This commit is contained in:
Oliver Davies 2024-05-11 14:51:01 +02:00
parent 9aec0bbff8
commit 700e7b478b

View file

@ -17,13 +17,13 @@ final class TalkCounter {
}
public function getCount(): int {
$today = Carbon::today()->format('Y-m-d H:i:s');
$yesterday = Carbon::yesterday()->format('Y-m-d H:i:s');
return $this->talkRepository
->findAllPublished()
->getEvents()
->filter(fn(ParagraphInterface $event) => $event->get('field_date')
->getString() <= $today)
->getString() <= $yesterday)
->count();
}