Skip to content

Commit

Permalink
fix: bun1984 show order cearte time
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianJiang2021 authored and libruce committed Feb 22, 2024
1 parent 116d2e1 commit 648b860
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ export default function OrderAction(props: OrderActionProps) {
const {
money,
orderSummary: { createAt, name, priceData } = {},
payment: { updatedAt, billingAddress, paymentMethod } = {},
payment: { billingAddress, paymentMethod, dateCreateAt } = {},
orderComments = '',
products,
orderId,
Expand Down Expand Up @@ -398,10 +398,10 @@ export default function OrderAction(props: OrderActionProps) {
header: b3Lang('orderDetail.summary'),
key: 'order-summary',
subtitle:
updatedAt && name
dateCreateAt && name
? b3Lang('orderDetail.purchaseDetails', {
name,
updatedAt: displayFormat(+updatedAt),
updatedAt: displayFormat(+dateCreateAt),
})
: '',
buttons,
Expand Down
4 changes: 3 additions & 1 deletion apps/storefront/src/pages/orderDetail/shared/B2BOrderData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,14 @@ const getOrderSummary = (data: B2BOrderData, b3Lang: LangFormatFunction) => {
}

const getPaymentData = (data: B2BOrderData) => {
const { updatedAt, billingAddress, paymentMethod } = data
const { updatedAt, billingAddress, paymentMethod, dateCreated } = data
const dateCreateAt = new Date(dateCreated).getTime() / 1000

return {
updatedAt,
billingAddress,
paymentMethod,
dateCreateAt: JSON.stringify(dateCreateAt),
}
}

Expand Down
1 change: 1 addition & 0 deletions apps/storefront/src/types/orderDetail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ export interface OrderPayment {
updatedAt?: string
billingAddress?: Address
paymentMethod?: string
dateCreateAt?: string | number
}

export interface OrderBillings {
Expand Down

0 comments on commit 648b860

Please sign in to comment.