1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 00:32:42 +01:00

Fix an issue with Phrequent where range_start might not be defined

Summary: If two events start on the same second (somewhat common now, since
start time can be specified) we'll hit a "push" with no range start. Instead,
always set a minimal range start.
This commit is contained in:
epriestley 2014-05-29 06:44:45 -07:00
parent b20142c0fe
commit 7f2b6412a2

View file

@ -23,6 +23,11 @@ final class PhrequentTimeBlock extends Phobject {
public function getObjectTimeRanges($now) {
$ranges = array();
$range_start = time();
foreach ($this->events as $event) {
$range_start = min($range_start, $event->getDateStarted());
}
$object_ranges = array();
foreach ($this->events as $event) {