From e078cd216efe401e9d48917d43246bb249782830 Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Tue, 1 Feb 2022 20:12:30 -0700 Subject: [PATCH] Add weekend and time of day warnings for pickups --- www/pages/dropandsend.html | 8 ++++++++ www/pages/pickup.html | 8 ++++++++ www/routes.js | 22 ++++++++++++++++++++++ 3 files changed, 38 insertions(+) diff --git a/www/pages/dropandsend.html b/www/pages/dropandsend.html index d4f89d1..df0df2b 100644 --- a/www/pages/dropandsend.html +++ b/www/pages/dropandsend.html @@ -36,6 +36,14 @@ You need an account with a linked credit card to send packages with Drop and Send. TapClick the button to update your account. My Account + +
  • + +
  • Pickup Address
    diff --git a/www/routes.js b/www/routes.js index 86a10da..60b5578 100644 --- a/www/routes.js +++ b/www/routes.js @@ -188,6 +188,17 @@ var routes = [ }, function (error) { $("#addPaymentMethodNag").css("display", ""); }); + var dayofweek = formatTimestamp("l"); + switch (dayofweek) { + case "Saturday": + case "Sunday": + $("#pickupWeekendWarning").css("display", ""); + break; + } + var hourofday = formatTimestamp("H"); + if (hourofday > 12 + 4) { + $("#pickupLateInDayWarning").css("display", ""); + } }, pageAfterOut: function () { dropboxMap = null; @@ -214,6 +225,17 @@ var routes = [ }, function (error) { $("#addPaymentMethodNag").css("display", ""); }); + var dayofweek = formatTimestamp("l"); + switch (dayofweek) { + case "Saturday": + case "Sunday": + $("#pickupWeekendWarning").css("display", ""); + break; + } + var hourofday = formatTimestamp("H"); + if (hourofday > 12 + 4) { + $("#pickupLateInDayWarning").css("display", ""); + } } } },