File tree Expand file tree Collapse file tree 4 files changed +11
-3
lines changed
app/code/Magento/SalesGraphQl/Model Expand file tree Collapse file tree 4 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 88namespace Magento \SalesGraphQl \Model \Formatter ;
99
1010use Magento \Framework \App \ObjectManager ;
11+ use Magento \Framework \Stdlib \DateTime ;
1112use Magento \Framework \Stdlib \DateTime \TimezoneInterface ;
1213use Magento \Framework \Exception \LocalizedException ;
1314use Magento \Sales \Api \Data \OrderInterface ;
@@ -49,7 +50,8 @@ public function format(OrderInterface $orderModel): array
4950 'id ' => base64_encode ((string )$ orderModel ->getEntityId ()),
5051 'increment_id ' => $ orderModel ->getIncrementId (),
5152 'number ' => $ orderModel ->getIncrementId (),
52- 'order_date ' => $ this ->timezone ->date ($ orderModel ->getCreatedAt ()),
53+ 'order_date ' => $ this ->timezone ->date ($ orderModel ->getCreatedAt ())
54+ ->format (DateTime::DATETIME_PHP_FORMAT ),
5355 'order_number ' => $ orderModel ->getIncrementId (),
5456 'status ' => $ orderModel ->getStatusLabel (),
5557 'email ' => $ orderModel ->getCustomerEmail (),
Original file line number Diff line number Diff line change 1212use Magento \Framework \GraphQl \Config \Element \Field ;
1313use Magento \Framework \GraphQl \Query \ResolverInterface ;
1414use Magento \Framework \GraphQl \Schema \Type \ResolveInfo ;
15+ use Magento \Framework \Stdlib \DateTime ;
1516use Magento \Framework \Stdlib \DateTime \TimezoneInterface ;
1617use Magento \Sales \Api \Data \CreditmemoInterface ;
1718
@@ -51,6 +52,7 @@ public function resolve(
5152 $ comments [] = [
5253 'message ' => $ comment ->getComment (),
5354 'timestamp ' => $ this ->timezone ->date ($ comment ->getCreatedAt ())
55+ ->format (DateTime::DATETIME_PHP_FORMAT )
5456 ];
5557 }
5658 }
Original file line number Diff line number Diff line change 1212use Magento \Framework \GraphQl \Config \Element \Field ;
1313use Magento \Framework \GraphQl \Query \ResolverInterface ;
1414use Magento \Framework \GraphQl \Schema \Type \ResolveInfo ;
15+ use Magento \Framework \Stdlib \DateTime ;
1516use Magento \Framework \Stdlib \DateTime \TimezoneInterface ;
1617use Magento \Sales \Api \Data \OrderInterface ;
1718use Magento \Sales \Api \Data \InvoiceInterface ;
@@ -71,7 +72,8 @@ private function getInvoiceComments(InvoiceInterface $invoice): array
7172 foreach ($ invoice ->getComments () as $ comment ) {
7273 if ($ comment ->getIsVisibleOnFront ()) {
7374 $ comments [] = [
74- 'timestamp ' => $ this ->timezone ->date ($ comment ->getCreatedAt ()),
75+ 'timestamp ' => $ this ->timezone ->date ($ comment ->getCreatedAt ())
76+ ->format (DateTime::DATETIME_PHP_FORMAT ),
7577 'message ' => $ comment ->getComment ()
7678 ];
7779 }
Original file line number Diff line number Diff line change 1212use Magento \Framework \GraphQl \Config \Element \Field ;
1313use Magento \Framework \GraphQl \Query \ResolverInterface ;
1414use Magento \Framework \GraphQl \Schema \Type \ResolveInfo ;
15+ use Magento \Framework \Stdlib \DateTime ;
1516use Magento \Framework \Stdlib \DateTime \TimezoneInterface ;
1617use Magento \Sales \Api \Data \ShipmentInterface ;
1718use Magento \Sales \Model \Order ;
@@ -72,7 +73,8 @@ private function getShipmentComments(ShipmentInterface $shipment): array
7273 foreach ($ shipment ->getComments () as $ comment ) {
7374 if ($ comment ->getIsVisibleOnFront ()) {
7475 $ comments [] = [
75- 'timestamp ' => $ this ->timezone ->date ($ comment ->getCreatedAt ()),
76+ 'timestamp ' => $ this ->timezone ->date ($ comment ->getCreatedAt ())
77+ ->format (DateTime::DATETIME_PHP_FORMAT ),
7678 'message ' => $ comment ->getComment ()
7779 ];
7880 }
You can’t perform that action at this time.
0 commit comments