File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -75,9 +75,13 @@ protected function _getFormat()
75
75
public function render (\Magento \Framework \DataObject $ row )
76
76
{
77
77
if ($ data = $ row ->getData ($ this ->getColumn ()->getIndex ())) {
78
+ $ timezone = $ this ->getColumn ()->getTimezone () !== false ? $ this ->_localeDate ->getConfigTimezone () : 'UTC ' ;
78
79
return $ this ->dateTimeFormatter ->formatObject (
79
80
$ this ->_localeDate ->date (
80
- new \DateTime ($ data , new \DateTimeZone ($ this ->_localeDate ->getConfigTimezone ()))
81
+ new \DateTime (
82
+ $ data ,
83
+ new \DateTimeZone ($ timezone )
84
+ )
81
85
),
82
86
$ this ->_getFormat ()
83
87
);
Original file line number Diff line number Diff line change @@ -20,11 +20,13 @@ class Datetime extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\Abstra
20
20
public function render (\Magento \Framework \DataObject $ row )
21
21
{
22
22
$ format = $ this ->getColumn ()->getFormat ();
23
- if ($ data = $ this ->_getValue ($ row )) {
24
- return $ this ->_localeDate ->formatDate (
25
- $ data ,
23
+ if ($ date = $ this ->_getValue ($ row )) {
24
+ return $ this ->_localeDate ->formatDateTime (
25
+ $ date instanceof \DateTimeInterface ? $ date : new \ DateTime ( $ date ) ,
26
26
$ format ?: \IntlDateFormatter::MEDIUM ,
27
- true
27
+ $ format ?: \IntlDateFormatter::MEDIUM ,
28
+ null ,
29
+ $ this ->getColumn ()->getTimezone () !== false ? null : 'UTC '
28
30
);
29
31
}
30
32
return $ this ->getColumn ()->getDefault ();
You can’t perform that action at this time.
0 commit comments