123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- /**
- * Sitemap grid link column renderer
- *
- */
- namespace Magento\Sitemap\Block\Adminhtml\Grid\Renderer;
- class Time extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer
- {
- /**
- * @var \Magento\Framework\Stdlib\DateTime\DateTime
- */
- protected $_date;
- /**
- * @param \Magento\Backend\Block\Context $context
- * @param \Magento\Framework\Stdlib\DateTime\DateTime $date
- * @param array $data
- */
- public function __construct(
- \Magento\Backend\Block\Context $context,
- \Magento\Framework\Stdlib\DateTime\DateTime $date,
- array $data = []
- ) {
- $this->_date = $date;
- parent::__construct($context, $data);
- }
- /**
- * Prepare link to display in grid
- *
- * @param \Magento\Framework\DataObject $row
- * @return string
- */
- public function render(\Magento\Framework\DataObject $row)
- {
- $time = date('Y-m-d H:i:s', strtotime($row->getSitemapTime()) + $this->_date->getGmtOffset());
- return $time;
- }
- }
|