Skip to content

Commit

Permalink
Removed one second subtraction from start time in exclusive time calc…
Browse files Browse the repository at this point in the history
…ulation.
  • Loading branch information
brianwebpt committed Dec 2, 2014
1 parent 37a30c7 commit 4d88291
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,9 @@ public function setIntervalByStartAndEnd($intervalStart, $intervalEnd)
*/
public function setIntervalForQueryingUsingExclusiveTimes($startDateTime, $endDateTime)
{
$adjustedStartDateTime = new \DateTime($startDateTime);
$adjustedStartDateTime->sub(new \DateInterval('PT1S'));
$adjustedEndDateTime = new \DateTime($endDateTime);
$adjustedEndDateTime->add(new \DateInterval('PT1S'));

$this->setIntervals(new Interval($adjustedStartDateTime, $adjustedEndDateTime));
$this->setIntervals(new Interval($startDateTime, $adjustedEndDateTime));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function testAdjustTimeIntervalForQueryingSuccessfullyBuildsExclusiveTime
$origStartDateTime = '2014-06-18T12:30:01Z';
$origEndDateTime = '2014-06-18T01:00:00Z';

$expectedResults = new Interval('2014-06-18T12:30:00Z', '2014-06-18T01:00:01Z');
$expectedResults = new Interval('2014-06-18T12:30:01Z', '2014-06-18T01:00:01Z');

$query->setIntervalForQueryingUsingExclusiveTimes($origStartDateTime, $origEndDateTime);
$results = $query->getIntervals();
Expand Down

0 comments on commit 4d88291

Please sign in to comment.