Skip to content

Commit 8397770

Browse files
committed
ACP2E-1068: Incorrect Dashboard YTD values
1 parent 1a0e9e2 commit 8397770

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

app/code/Magento/Reports/Model/ResourceModel/Order/Collection.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,7 @@ public function getDateRange($range, $customStart, $customEnd, $returnObjects =
425425
$dateEnd->modify('now');
426426
break;
427427
case '24h':
428+
$dateEnd = new \DateTime('now', new \DateTimeZone($timezoneLocal));
428429
$dateEnd->modify('+1 hour');
429430
$dateStart = clone $dateEnd;
430431
$dateStart->modify('-1 day');

app/code/Magento/Reports/Test/Unit/Model/ResourceModel/Order/CollectionTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,8 @@ public function testPrepareSummary($useAggregatedData, $mainTable, $isFilter, $g
286286
*/
287287
public function testGetDateRangeFirstPart($range, $customStart, $customEnd, $expectedInterval): void
288288
{
289-
$timeZoneToReturn = date_default_timezone_get();
290-
date_default_timezone_set('UTC');
291289
$result = $this->collection->getDateRange($range, $customStart, $customEnd);
292290
$interval = $result['to']->diff($result['from']);
293-
date_default_timezone_set($timeZoneToReturn);
294291
$intervalResult = $interval->format('%y %m %d %h:%i:%s');
295292
$this->assertEquals($expectedInterval, $intervalResult);
296293
}

0 commit comments

Comments
 (0)