Skip to content

Commit c4652ba

Browse files
author
He, Joan(johe)
committed
Merge pull request #160 from magento-south/MAGETWO-45277
[South] MAGETWO-45277: Timezone fixes for Customer module
2 parents 32094af + 76b1dcb commit c4652ba

File tree

2 files changed

+8
-4
lines changed
  • dev/tests/integration/testsuite/Magento/Framework/Data/Form/Element
  • lib/internal/Magento/Framework/Data/Form/Element

2 files changed

+8
-4
lines changed

dev/tests/integration/testsuite/Magento/Framework/Data/Form/Element/DateTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ public function getValueDataProvider()
4242
{
4343
$testTimestamp = strtotime('2014-05-18 12:08:16');
4444
$date = new \DateTime('@' . $testTimestamp);
45-
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
46-
$timezone = $objectManager->get('Magento\Framework\Stdlib\DateTime\TimezoneInterface');
47-
$date->setTimezone(new \DateTimeZone($timezone->getConfigTimezone()));
4845
return [
4946
[
5047
[

lib/internal/Magento/Framework/Data/Form/Element/Date.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,14 @@ public function getValue($format = null)
113113
$format .= ($format && $this->getTimeFormat()) ? ' ' : '';
114114
$format .= $this->getTimeFormat() ? $this->getTimeFormat() : '';
115115
}
116-
return $this->localeDate->formatDateTime($this->_value, null, null, null, null, $format);
116+
return $this->localeDate->formatDateTime(
117+
$this->_value,
118+
null,
119+
null,
120+
null,
121+
$this->_value->getTimezone(),
122+
$format
123+
);
117124
}
118125

119126
/**

0 commit comments

Comments
 (0)