Skip to content

Commit e857533

Browse files
committed
ACP2E-2990: Customer "created_at" date Not Converted to store time zone upon export
- Reverted with the old commit to check the build failures.
1 parent 2af2298 commit e857533

File tree

4 files changed

+7
-140
lines changed

4 files changed

+7
-140
lines changed

app/code/Magento/CustomerImportExport/Model/Export/Customer.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ class Customer extends \Magento\ImportExport\Model\Export\Entity\AbstractEav
2727

2828
const COLUMN_STORE = '_store';
2929

30+
private const COLUMN_CREATED_AT = 'created_at';
31+
3032
/**
3133
* Attribute collection name
3234
*/
@@ -158,6 +160,11 @@ public function exportItem($item)
158160
$row = $this->_addAttributeValuesToRow($item);
159161
$row[self::COLUMN_WEBSITE] = $this->_websiteIdToCode[$item->getWebsiteId()];
160162
$row[self::COLUMN_STORE] = $this->_storeIdToCode[$item->getStoreId()];
163+
$row[self::COLUMN_CREATED_AT] = $this->_localeDate->formatDate(
164+
$row[self::COLUMN_CREATED_AT],
165+
\IntlDateFormatter::MEDIUM,
166+
true
167+
);
161168

162169
$this->getWriter()->writeRow($row);
163170
}

app/code/Magento/CustomerImportExport/Plugin/Model/Export/FormatCustomerCreatedAt.php

Lines changed: 0 additions & 60 deletions
This file was deleted.

app/code/Magento/CustomerImportExport/Test/Unit/Plugin/Model/Export/FormatCustomerCreatedAtTest.php

Lines changed: 0 additions & 67 deletions
This file was deleted.

dev/tests/integration/testsuite/Magento/CustomerImportExport/Model/Export/CustomerTest.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@
1717
use Magento\Customer\Model\Customer as CustomerModel;
1818
use Magento\Customer\Model\ResourceModel\Attribute\Collection;
1919
use Magento\Customer\Model\ResourceModel\Customer\Collection as CustomerCollection;
20-
use Magento\Framework\Stdlib\DateTime\TimezoneInterface;
2120

2221
/**
2322
* Tests for customer export model.
2423
*
2524
* @magentoAppArea adminhtml
26-
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2725
*/
2826
class CustomerTest extends \PHPUnit\Framework\TestCase
2927
{
@@ -52,11 +50,6 @@ class CustomerTest extends \PHPUnit\Framework\TestCase
5250
*/
5351
private $attributeCollection;
5452

55-
/**
56-
* @var TimezoneInterface
57-
*/
58-
private $localeDate;
59-
6053
/**
6154
* @inheritdoc
6255
*/
@@ -65,7 +58,6 @@ protected function setUp(): void
6558
$this->objectManager = Bootstrap::getObjectManager();
6659
$this->_model = $this->objectManager->create(Customer::class);
6760
$this->attributeCollection = $this->objectManager->create(Collection::class);
68-
$this->localeDate = $this->objectManager->create(TimezoneInterface::class);
6961
}
7062

7163
/**
@@ -161,11 +153,6 @@ private function checkExportData(array $lines, array $expectedAttributes): void
161153
$customers = $this->objectManager->create(CustomerCollection::class);
162154
foreach ($customers as $customer) {
163155
$data = $this->processCustomerData($customer, $expectedAttributes);
164-
$data['created_at'] = $this->localeDate->formatDate(
165-
$data['created_at'],
166-
\IntlDateFormatter::MEDIUM,
167-
true
168-
);
169156
$exportData = $lines['data'][$data['email']];
170157
$exportData = $this->unsetDuplicateData($exportData);
171158

0 commit comments

Comments
 (0)