diff --git a/vendor/magento/module-sales-graph-ql/Model/Formatter/Order.php b/vendor/magento/module-sales-graph-ql/Model/Formatter/Order.php index 06afec2ac2ef8..9f0cd1a2981fe 100644 --- a/vendor/magento/module-sales-graph-ql/Model/Formatter/Order.php +++ b/vendor/magento/module-sales-graph-ql/Model/Formatter/Order.php @@ -48,8 +48,15 @@ public function format(OrderInterface $orderModel): array 'id' => base64_encode((string)$orderModel->getEntityId()), 'increment_id' => $orderModel->getIncrementId(), 'number' => $orderModel->getIncrementId(), - 'order_date' => $this->timezone->date($orderModel->getCreatedAt()) - ->format(DateTime::DATETIME_PHP_FORMAT), + 'order_date' => $this->timezone->date( + $orderModel->getCreatedAt() + ? \DateTime::createFromFormat( + DateTime::DATETIME_PHP_FORMAT, + $orderModel->getCreatedAt(), + new \DateTimeZone('UTC') + ) + : null + )->format(DateTime::DATETIME_PHP_FORMAT), 'order_number' => $orderModel->getIncrementId(), 'status' => $orderModel->getStatusLabel(), 'email' => $orderModel->getCustomerEmail(), diff --git a/vendor/magento/module-sales-graph-ql/Model/Resolver/CreditMemo/CreditMemoComments.php b/vendor/magento/module-sales-graph-ql/Model/Resolver/CreditMemo/CreditMemoComments.php index f243024174491..8fd625de44549 100644 --- a/vendor/magento/module-sales-graph-ql/Model/Resolver/CreditMemo/CreditMemoComments.php +++ b/vendor/magento/module-sales-graph-ql/Model/Resolver/CreditMemo/CreditMemoComments.php @@ -52,8 +52,15 @@ public function resolve( if ($comment->getIsVisibleOnFront()) { $comments[] = [ 'message' => $comment->getComment(), - 'timestamp' => $this->timezone->date($comment->getCreatedAt()) - ->format(DateTime::DATETIME_PHP_FORMAT) + 'timestamp' => $this->timezone->date( + $comment->getCreatedAt() + ? \DateTime::createFromFormat( + DateTime::DATETIME_PHP_FORMAT, + $comment->getCreatedAt(), + new \DateTimeZone('UTC') + ) + : null + )->format(DateTime::DATETIME_PHP_FORMAT) ]; } } diff --git a/vendor/magento/module-sales-graph-ql/Model/Resolver/Invoices.php b/vendor/magento/module-sales-graph-ql/Model/Resolver/Invoices.php index d08f2d6d1a8ba..cdaae62dd8fc6 100644 --- a/vendor/magento/module-sales-graph-ql/Model/Resolver/Invoices.php +++ b/vendor/magento/module-sales-graph-ql/Model/Resolver/Invoices.php @@ -73,8 +73,15 @@ private function getInvoiceComments(InvoiceInterface $invoice): array foreach ($invoice->getComments() as $comment) { if ($comment->getIsVisibleOnFront()) { $comments[] = [ - 'timestamp' => $this->timezone->date($comment->getCreatedAt()) - ->format(DateTime::DATETIME_PHP_FORMAT), + 'timestamp' => $this->timezone->date( + $comment->getCreatedAt() + ? \DateTime::createFromFormat( + DateTime::DATETIME_PHP_FORMAT, + $comment->getCreatedAt(), + new \DateTimeZone('UTC') + ) + : null + )->format(DateTime::DATETIME_PHP_FORMAT), 'message' => $comment->getComment() ]; } diff --git a/vendor/magento/module-sales-graph-ql/Model/Resolver/Shipments.php b/vendor/magento/module-sales-graph-ql/Model/Resolver/Shipments.php index b923b1e9e2fc0..cb02217ebe05c 100644 --- a/vendor/magento/module-sales-graph-ql/Model/Resolver/Shipments.php +++ b/vendor/magento/module-sales-graph-ql/Model/Resolver/Shipments.php @@ -74,8 +74,15 @@ private function getShipmentComments(ShipmentInterface $shipment): array foreach ($shipment->getComments() as $comment) { if ($comment->getIsVisibleOnFront()) { $comments[] = [ - 'timestamp' => $this->timezone->date($comment->getCreatedAt()) - ->format(DateTime::DATETIME_PHP_FORMAT), + 'timestamp' => $this->timezone->date( + $comment->getCreatedAt() + ? \DateTime::createFromFormat( + DateTime::DATETIME_PHP_FORMAT, + $comment->getCreatedAt(), + new \DateTimeZone('UTC') + ) + : null + )->format(DateTime::DATETIME_PHP_FORMAT), 'message' => $comment->getComment() ]; }