From 76399713aa7b21173287b12de54472db1c6b24b2 Mon Sep 17 00:00:00 2001 From: SuperSimpleDev Date: Wed, 1 May 2024 01:11:56 -0400 Subject: [PATCH] 18o Solution --- 2-copy-of-code/lesson-18/scripts/tracking.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) 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
-
+
`;