Skip to content

Commit

Permalink
Merge pull request #160 from magento-south/MAGETWO-45277
Browse files Browse the repository at this point in the history
[South] MAGETWO-45277: Timezone fixes for Customer module
  • Loading branch information
He, Joan(johe) committed Nov 12, 2015
2 parents 32094af + 76b1dcb commit c4652ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ public function getValueDataProvider()
{
$testTimestamp = strtotime('2014-05-18 12:08:16');
$date = new \DateTime('@' . $testTimestamp);
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$timezone = $objectManager->get('Magento\Framework\Stdlib\DateTime\TimezoneInterface');
$date->setTimezone(new \DateTimeZone($timezone->getConfigTimezone()));
return [
[
[
Expand Down
9 changes: 8 additions & 1 deletion lib/internal/Magento/Framework/Data/Form/Element/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,14 @@ public function getValue($format = null)
$format .= ($format && $this->getTimeFormat()) ? ' ' : '';
$format .= $this->getTimeFormat() ? $this->getTimeFormat() : '';
}
return $this->localeDate->formatDateTime($this->_value, null, null, null, null, $format);
return $this->localeDate->formatDateTime(
$this->_value,
null,
null,
null,
$this->_value->getTimezone(),
$format
);
}

/**
Expand Down

0 comments on commit c4652ba

Please sign in to comment.