Skip to content

Commit

Permalink
fix(order-list): make single digit min/sec show as two
Browse files Browse the repository at this point in the history
Casts to string, then uses the padStart function to make sure the
minute and second show up as two digits

Fixes #2
  • Loading branch information
JimOtermat committed Aug 6, 2022
1 parent 1018bf5 commit 96848f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion application/src/components/view-orders/ordersList.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const OrdersList = (props) => {
<p>Ordered by: {order.ordered_by || ''}</p>
</div>
<div className="col-md-4 d-flex view-order-middle-col">
<p>Order placed at {`${createdDate.getHours()}:${createdDate.getMinutes()}:${createdDate.getSeconds()}`}</p>
<p>Order placed at {`${createdDate.getHours()}:${String(createdDate.getMinutes()).padStart(2,'0')}:${String(createdDate.getSeconds()).padStart(2,'0')}`}</p>
<p>Quantity: {order.quantity}</p>
</div>
<div className="col-md-4 view-order-right-col">
Expand Down

0 comments on commit 96848f3

Please sign in to comment.