Commit 73e9863c authored by Kevin Kaminski's avatar Kevin Kaminski

Merge branch 'fix-frontend-issues' into 'dev'

[AFP-NA] fix order date display and order created date display

See merge request !12
parents 68388055 95fcb0be
...@@ -21,7 +21,7 @@ const OrderDetails = (props: any) => { ...@@ -21,7 +21,7 @@ const OrderDetails = (props: any) => {
const status = props.status const status = props.status
return ( return (
<> <>
<Td><Link to={"/orders/" + orderNumber}>{orderNumber}</Link></Td> <Td><Link to={"/orders/" + orderNumber}>{orderNumber.slice(orderNumber.length - 7).toUpperCase()}</Link></Td>
<Td>{date}</Td> <Td>{date}</Td>
<Td>{status}</Td> <Td>{status}</Td>
</> </>
......
...@@ -20,7 +20,7 @@ const OrderIndexPage = () => { ...@@ -20,7 +20,7 @@ const OrderIndexPage = () => {
const orderDetailsArrCreator = (orders: Order[]) => { const orderDetailsArrCreator = (orders: Order[]) => {
return orders.map((order: Order, idx: any) => { return orders.map((order: Order, idx: any) => {
return <Tr key={idx}><OrderDetails return <Tr key={idx}><OrderDetails
date={order.orderCreatedAt} date={new Date(order.orderCreatedAt).toLocaleDateString()}
orderNumber={order.id} orderNumber={order.id}
status={order.orderStatus} status={order.orderStatus}
/></Tr> /></Tr>
...@@ -72,7 +72,7 @@ const OrderIndexPage = () => { ...@@ -72,7 +72,7 @@ const OrderIndexPage = () => {
<Thead> <Thead>
<Tr> <Tr>
<Th>Order number</Th> <Th>Order number</Th>
<Th>Created</Th> <Th>Order Date</Th>
<Th>Order Status</Th> <Th>Order Status</Th>
</Tr> </Tr>
</Thead> </Thead>
......
...@@ -35,8 +35,8 @@ const OrderShowPage = (props: any) => { ...@@ -35,8 +35,8 @@ const OrderShowPage = (props: any) => {
<> <>
<div className="show-div"> <div className="show-div">
<Flex justify="space-around"> <Flex justify="space-around">
<Box><strong>Order Date:</strong> {order.orderCreatedAt}</Box> <Box><strong>Order Date:</strong> {new Date(order.orderCreatedAt).toLocaleDateString()}</Box>
<Box><strong>Order Number:</strong> {order.id}</Box> <Box><strong>Order Number:</strong> {order.id.slice(order.id.length - 7).toUpperCase()}</Box>
<Box><strong>Order Status:</strong> {order.orderStatus}</Box> <Box><strong>Order Status:</strong> {order.orderStatus}</Box>
</Flex> </Flex>
<br/> <br/>
......
...@@ -29,5 +29,3 @@ const MainRouter: React.FC = () => { ...@@ -29,5 +29,3 @@ const MainRouter: React.FC = () => {
} }
export default MainRouter export default MainRouter
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment