Skip to content

Commit

Permalink
By default, show times in admin grids in the store timezone.
Browse files Browse the repository at this point in the history
fixes #9426

This test basically said, use the column config value, or use FALSE:

    $timezone = isset($this->getConfiguration()['timezone'])
        ? $this->booleanUtils->convert($this->getConfiguration()['timezone'])
        : false;

The only config values currently present in the code set the 'timezone'
config to FALSE using `<timezone>false</timezone>`. There are 0 occurances
of `<timezone>true</timezone>` in the code base at this time. This makes
me believe that the default value should not be FALSE but TRUE. Otherwise
the outcome will always be FALSE, be it explicit or by default.

This way the product review created_at times will be the same in the
catalog/product/edit adminhtml page as well as on the Marketing | Reviews
grid. They were not equal before this commit.

The same goes for the CMS page grid, the CMS block grid, the customer grid,
the online customers grid, and the sales grids.

I believe admins wint to see these times in their configured time zone and
not in UTC. Otherwise someone can appear to have placed an order in the
future which is very confusing.
  • Loading branch information
Anton Evers committed Jun 14, 2017
1 parent ec99590 commit 049cc45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/code/Magento/Ui/Component/Listing/Columns/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function prepareDataSource(array $dataSource)
$date = $this->timezone->date(new \DateTime($item[$this->getData('name')]));
$timezone = isset($this->getConfiguration()['timezone'])
? $this->booleanUtils->convert($this->getConfiguration()['timezone'])
: false;
: true;
if (!$timezone) {
$date = new \DateTime($item[$this->getData('name')]);
}
Expand Down

0 comments on commit 049cc45

Please sign in to comment.