Skip to content

Commit 4265a8f

Browse files
committed
fix
1 parent 243d5a5 commit 4265a8f

File tree

1 file changed

+11
-11
lines changed
  • app/code/core/Mage/Reports/Model/Resource/Report

1 file changed

+11
-11
lines changed

app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -403,28 +403,28 @@ public function getStoreTZOffsetQuery($table, $column, $from = null, $to = null,
403403
* Retrieve transitions for offsets of given timezone
404404
*
405405
* @param string $timezone
406-
* @param mixed $fromDate
407-
* @param mixed $toDate
406+
* @param mixed $from
407+
* @param mixed $to
408408
* @return array
409409
*/
410-
protected function _getTZOffsetTransitions($timezone, $fromDate = null, $toDate = null)
410+
protected function _getTZOffsetTransitions($timezone, $from = null, $to = null)
411411
{
412412
$tzTransitions = [];
413413
try {
414-
if (!empty($fromDate)) {
415-
$fromDate = new Zend_Date($fromDate, Varien_Date::DATETIME_INTERNAL_FORMAT);
416-
$fromDate = $fromDate->getTimestamp();
414+
if (!empty($from)) {
415+
$from = new Zend_Date($from, Varien_Date::DATETIME_INTERNAL_FORMAT);
416+
$from = $from->getTimestamp();
417417
}
418418

419-
$toDate = new Zend_Date($toDate, Varien_Date::DATETIME_INTERNAL_FORMAT);
420-
$nextPeriod = $this->_getWriteAdapter()->formatDate($toDate->toString(Varien_Date::DATETIME_INTERNAL_FORMAT));
421-
$toDate = $toDate->getTimestamp();
419+
$to = new Zend_Date($to, Varien_Date::DATETIME_INTERNAL_FORMAT);
420+
$nextPeriod = $this->_getWriteAdapter()->formatDate($to->toString(Varien_Date::DATETIME_INTERNAL_FORMAT));
421+
$to = $to->getTimestamp();
422422

423423
$dtz = new DateTimeZone($timezone);
424424
$transitions = array_reverse($dtz->getTransitions());
425425
$dateTimeObject = new Zend_Date('c');
426426
foreach ($transitions as $transition) {
427-
if (!$this->_isValidTransition($transition, $toDate)) {
427+
if (!$this->_isValidTransition($transition, $to)) {
428428
continue;
429429
}
430430

@@ -433,7 +433,7 @@ protected function _getTZOffsetTransitions($timezone, $fromDate = null, $toDate
433433
->formatDate($dateTimeObject->toString(Varien_Date::DATETIME_INTERNAL_FORMAT));
434434
$tzTransitions[$transition['offset']][] = ['from' => $transition['time'], 'to' => $nextPeriod];
435435

436-
if (!empty($fromDate) && $transition['ts'] < $fromDate) {
436+
if (!empty($from) && $transition['ts'] < $from) {
437437
break;
438438
}
439439

0 commit comments

Comments
 (0)