Skip to content

Commit 963b918

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-61004' into 2.1.8-develop-pr20
2 parents 34dd741 + 82f8d75 commit 963b918

File tree

1 file changed

+1
-13
lines changed
  • dev/tests/functional/tests/app/Magento/Backend/Test/Fixture/Source

1 file changed

+1
-13
lines changed

dev/tests/functional/tests/app/Magento/Backend/Test/Fixture/Source/Date.php

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@
66

77
namespace Magento\Backend\Test\Fixture\Source;
88

9-
use Magento\Framework\App\ObjectManager;
109
use Magento\Mtf\Fixture\DataSource;
1110

1211
/**
1312
* Class Date.
1413
*
1514
* Data keys:
1615
* - pattern (Format a local time/date with delta, e.g. 'm/d/Y -3 days' = current day - 3 days)
17-
* - apply_timezone (true if it is needed to apply timezone)
1816
*/
1917
class Date extends DataSource
2018
{
@@ -37,17 +35,7 @@ public function __construct(array $params, $data = [])
3735
if (!$timestamp) {
3836
throw new \Exception('Invalid date format for "' . $this->params['attribute_code'] . '" field');
3937
}
40-
if (isset($data['apply_timezone']) && $data['apply_timezone'] === true) {
41-
42-
$timezone = ObjectManager::getInstance()
43-
->get(\Magento\Framework\Stdlib\DateTime\TimezoneInterface::class);
44-
$date = new \DateTime();
45-
$date->setTimestamp($timestamp);
46-
$date->setTimezone(new \DateTimeZone($timezone->getConfigTimezone()));
47-
$date = $date->format(str_replace($delta, '', $data['pattern']));
48-
} else {
49-
$date = date(str_replace($delta, '', $data['pattern']), $timestamp);
50-
}
38+
$date = date(str_replace($delta, '', $data['pattern']), $timestamp);
5139
if (!$date) {
5240
$date = date('m/d/Y');
5341
}

0 commit comments

Comments
 (0)