Skip to content

Commit 94ebf33

Browse files
MAGETWO-34390: Stabilization of replacing Zend_Locale with Native PHP Implementation
1 parent 04db117 commit 94ebf33

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,9 +404,14 @@ protected function _getTZOffsetTransitions($timezone, $from = null, $to = null)
404404
$tzTransitions = [];
405405
try {
406406
if (!empty($from)) {
407-
$from = $from->getTimestamp();
407+
$from = $from instanceof \DateTime
408+
? $from->getTimestamp()
409+
: (new \DateTime($from))->getTimestamp();
408410
}
409411

412+
$to = $to instanceof \DateTime
413+
? $to
414+
: new \DateTime($to);
410415
$nextPeriod = $this->_getWriteAdapter()->formatDate(
411416
$to->format('Y-m-d H:i:s')
412417
);

0 commit comments

Comments
 (0)