Fixed event listing

Signed-off-by: Gergely POLONKAI <polesz@w00d5t0ck.info>
This commit is contained in:
Gergely POLONKAI
2012-08-15 18:07:46 +02:00
parent 7a77a4e1ed
commit 111c563409
6 changed files with 44 additions and 17 deletions

View File

@@ -399,4 +399,20 @@ class Event
)
);
}
/**
* Check if the event happened before a given date
*
* @param DateTime $date
* @return boolean
*/
public function isPast(\DateTime $date = null)
{
if ($date === null)
{
$date = new \DateTime('now');
}
return ($this->endDate < $date);
}
}