Skip to content

Commit 8f46ec1

Browse files
committed
ACP2E-2990: Customer "created_at" date Not Converted to store time zone upon export
- Fixed the CR comments.
1 parent 0c3ae20 commit 8f46ec1

File tree

2 files changed

+9
-5
lines changed
  • app/code/Magento/CustomerImportExport/Model/Export
  • dev/tests/integration/testsuite/Magento/CustomerImportExport/Model/Export

2 files changed

+9
-5
lines changed

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,14 @@ public function exportItem($item)
160160
$row = $this->_addAttributeValuesToRow($item);
161161
$row[self::COLUMN_WEBSITE] = $this->_websiteIdToCode[$item->getWebsiteId()];
162162
$row[self::COLUMN_STORE] = $this->_storeIdToCode[$item->getStoreId()];
163-
$row[self::COLUMN_CREATED_AT] = $this->_localeDate->formatDate(
164-
$item->getCreatedAt(),
165-
\IntlDateFormatter::MEDIUM,
166-
true
167-
);
163+
if (isset($row[self::COLUMN_CREATED_AT])) {
164+
$row[self::COLUMN_CREATED_AT] = $this->_localeDate->formatDate(
165+
$item->getCreatedAt(),
166+
\IntlDateFormatter::MEDIUM,
167+
true
168+
);
169+
$row[self::COLUMN_CREATED_AT] = (new \DateTime($row[self::COLUMN_CREATED_AT]))->format('Y-m-d H:i:s');
170+
}
168171

169172
$this->getWriter()->writeRow($row);
170173
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ private function checkExportData(array $lines, array $expectedAttributes): void
166166
\IntlDateFormatter::MEDIUM,
167167
true
168168
);
169+
$data['created_at'] = (new \DateTime($data['created_at']))->format('Y-m-d H:i:s');
169170
$exportData = $lines['data'][$data['email']];
170171
$exportData = $this->unsetDuplicateData($exportData);
171172

0 commit comments

Comments
 (0)