From 4d882911e802e2efcddbc8385bcf91333ac64e17 Mon Sep 17 00:00:00 2001 From: Brian Buikema Date: Tue, 2 Dec 2014 10:44:06 -0700 Subject: [PATCH] Removed one second subtraction from start time in exclusive time calculation. --- .../QueryParameters/SimpleGroupByQueryParameters.php | 4 +--- .../Test/QueryParameters/SimpleGroupByQueryParametersTest.php | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/DruidFamiliar/QueryParameters/SimpleGroupByQueryParameters.php b/src/DruidFamiliar/QueryParameters/SimpleGroupByQueryParameters.php index 2db0740..4f8e906 100644 --- a/src/DruidFamiliar/QueryParameters/SimpleGroupByQueryParameters.php +++ b/src/DruidFamiliar/QueryParameters/SimpleGroupByQueryParameters.php @@ -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)); } } diff --git a/tests/DruidFamiliar/Test/QueryParameters/SimpleGroupByQueryParametersTest.php b/tests/DruidFamiliar/Test/QueryParameters/SimpleGroupByQueryParametersTest.php index 2184923..6941615 100644 --- a/tests/DruidFamiliar/Test/QueryParameters/SimpleGroupByQueryParametersTest.php +++ b/tests/DruidFamiliar/Test/QueryParameters/SimpleGroupByQueryParametersTest.php @@ -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();