diff --git a/2-copy-of-code/lesson-18/scripts/tracking.js b/2-copy-of-code/lesson-18/scripts/tracking.js index 01bb36a..62f130c 100644 --- a/2-copy-of-code/lesson-18/scripts/tracking.js +++ b/2-copy-of-code/lesson-18/scripts/tracking.js @@ -21,6 +21,11 @@ async function loadPage() { } }); + const today = dayjs(); + const orderTime = dayjs(order.orderTime); + const deliveryTime = dayjs(productDetails.estimatedDeliveryTime); + const percentProgress = ((today - orderTime) / (deliveryTime - orderTime)) * 100; + const trackingHTML = ` View all orders @@ -43,19 +48,25 @@ async function loadPage() {
-
+
Preparing
-
+
Shipped
-
+
Delivered
-
+
`;