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 8
8
namespace Magento \SalesGraphQl \Model \Formatter ;
9
9
10
10
use Magento \Framework \App \ObjectManager ;
11
+ use Magento \Framework \Stdlib \DateTime ;
11
12
use Magento \Framework \Stdlib \DateTime \TimezoneInterface ;
12
13
use Magento \Framework \Exception \LocalizedException ;
13
14
use Magento \Sales \Api \Data \OrderInterface ;
@@ -49,7 +50,8 @@ public function format(OrderInterface $orderModel): array
49
50
'id ' => base64_encode ((string )$ orderModel ->getEntityId ()),
50
51
'increment_id ' => $ orderModel ->getIncrementId (),
51
52
'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 ),
53
55
'order_number ' => $ orderModel ->getIncrementId (),
54
56
'status ' => $ orderModel ->getStatusLabel (),
55
57
'email ' => $ orderModel ->getCustomerEmail (),
Original file line number Diff line number Diff line change 12
12
use Magento \Framework \GraphQl \Config \Element \Field ;
13
13
use Magento \Framework \GraphQl \Query \ResolverInterface ;
14
14
use Magento \Framework \GraphQl \Schema \Type \ResolveInfo ;
15
+ use Magento \Framework \Stdlib \DateTime ;
15
16
use Magento \Framework \Stdlib \DateTime \TimezoneInterface ;
16
17
use Magento \Sales \Api \Data \CreditmemoInterface ;
17
18
@@ -51,6 +52,7 @@ public function resolve(
51
52
$ comments [] = [
52
53
'message ' => $ comment ->getComment (),
53
54
'timestamp ' => $ this ->timezone ->date ($ comment ->getCreatedAt ())
55
+ ->format (DateTime::DATETIME_PHP_FORMAT )
54
56
];
55
57
}
56
58
}
Original file line number Diff line number Diff line change 12
12
use Magento \Framework \GraphQl \Config \Element \Field ;
13
13
use Magento \Framework \GraphQl \Query \ResolverInterface ;
14
14
use Magento \Framework \GraphQl \Schema \Type \ResolveInfo ;
15
+ use Magento \Framework \Stdlib \DateTime ;
15
16
use Magento \Framework \Stdlib \DateTime \TimezoneInterface ;
16
17
use Magento \Sales \Api \Data \OrderInterface ;
17
18
use Magento \Sales \Api \Data \InvoiceInterface ;
@@ -71,7 +72,8 @@ private function getInvoiceComments(InvoiceInterface $invoice): array
71
72
foreach ($ invoice ->getComments () as $ comment ) {
72
73
if ($ comment ->getIsVisibleOnFront ()) {
73
74
$ comments [] = [
74
- 'timestamp ' => $ this ->timezone ->date ($ comment ->getCreatedAt ()),
75
+ 'timestamp ' => $ this ->timezone ->date ($ comment ->getCreatedAt ())
76
+ ->format (DateTime::DATETIME_PHP_FORMAT ),
75
77
'message ' => $ comment ->getComment ()
76
78
];
77
79
}
Original file line number Diff line number Diff line change 12
12
use Magento \Framework \GraphQl \Config \Element \Field ;
13
13
use Magento \Framework \GraphQl \Query \ResolverInterface ;
14
14
use Magento \Framework \GraphQl \Schema \Type \ResolveInfo ;
15
+ use Magento \Framework \Stdlib \DateTime ;
15
16
use Magento \Framework \Stdlib \DateTime \TimezoneInterface ;
16
17
use Magento \Sales \Api \Data \ShipmentInterface ;
17
18
use Magento \Sales \Model \Order ;
@@ -72,7 +73,8 @@ private function getShipmentComments(ShipmentInterface $shipment): array
72
73
foreach ($ shipment ->getComments () as $ comment ) {
73
74
if ($ comment ->getIsVisibleOnFront ()) {
74
75
$ comments [] = [
75
- 'timestamp ' => $ this ->timezone ->date ($ comment ->getCreatedAt ()),
76
+ 'timestamp ' => $ this ->timezone ->date ($ comment ->getCreatedAt ())
77
+ ->format (DateTime::DATETIME_PHP_FORMAT ),
76
78
'message ' => $ comment ->getComment ()
77
79
];
78
80
}
You can’t perform that action at this time.
0 commit comments