dateTimeFormatter = $dateTimeFormatter; } /** * Retrieve date format * * @return string * @deprecated 100.1.0 */ protected function _getFormat() { $format = $this->getColumn()->getFormat(); if ($format === null) { if (self::$_format === null) { try { self::$_format = $this->_localeDate->getDateFormat( \IntlDateFormatter::MEDIUM ); } catch (\Exception $e) { $this->_logger->critical($e); } } $format = self::$_format; } return $format; } /** * Renders grid column * * @param \Magento\Framework\DataObject $row * @return string */ public function render(\Magento\Framework\DataObject $row) { $format = $this->getColumn()->getFormat(); $date = $this->_getValue($row); if ($date) { if (!($date instanceof \DateTimeInterface)) { $date = new \DateTime($date); } return $this->_localeDate->formatDateTime( $date, $format ?: \IntlDateFormatter::MEDIUM, \IntlDateFormatter::NONE, null, $this->getColumn()->getTimezone() === false ? 'UTC' : null ); } return $this->getColumn()->getDefault(); } }