Skip to content

Commit 7f2b641

Browse files
author
epriestley
committedMay 29, 2014
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.
1 parent b20142c commit 7f2b641

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

‎src/applications/phrequent/storage/PhrequentTimeBlock.php

+5
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ public function getTimeSpentOnObject($phid, $now) {
2323
public function getObjectTimeRanges($now) {
2424
$ranges = array();
2525

26+
$range_start = time();
27+
foreach ($this->events as $event) {
28+
$range_start = min($range_start, $event->getDateStarted());
29+
}
30+
2631
$object_ranges = array();
2732
foreach ($this->events as $event) {
2833

0 commit comments

Comments
 (0)
Failed to load comments.