Skip to content

Commit 4d88291

Browse files
committed
Removed one second subtraction from start time in exclusive time calculation.
1 parent 37a30c7 commit 4d88291

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/DruidFamiliar/QueryParameters/SimpleGroupByQueryParameters.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,9 @@ public function setIntervalByStartAndEnd($intervalStart, $intervalEnd)
251251
*/
252252
public function setIntervalForQueryingUsingExclusiveTimes($startDateTime, $endDateTime)
253253
{
254-
$adjustedStartDateTime = new \DateTime($startDateTime);
255-
$adjustedStartDateTime->sub(new \DateInterval('PT1S'));
256254
$adjustedEndDateTime = new \DateTime($endDateTime);
257255
$adjustedEndDateTime->add(new \DateInterval('PT1S'));
258256

259-
$this->setIntervals(new Interval($adjustedStartDateTime, $adjustedEndDateTime));
257+
$this->setIntervals(new Interval($startDateTime, $adjustedEndDateTime));
260258
}
261259
}

tests/DruidFamiliar/Test/QueryParameters/SimpleGroupByQueryParametersTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function testAdjustTimeIntervalForQueryingSuccessfullyBuildsExclusiveTime
1717
$origStartDateTime = '2014-06-18T12:30:01Z';
1818
$origEndDateTime = '2014-06-18T01:00:00Z';
1919

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

2222
$query->setIntervalForQueryingUsingExclusiveTimes($origStartDateTime, $origEndDateTime);
2323
$results = $query->getIntervals();

0 commit comments

Comments
 (0)