From 40cac1cdec2f62549c9ce7974733dc96a09e20d4 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Mon, 2 Nov 2015 12:34:24 -0500 Subject: [PATCH] Used php to filter min days for off canvas booking form --- js/app.js | 9 ++++++++- js/custom/pageSetup.js | 9 ++++++++- parts/off-canvas-menu.php | 6 ++++-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/js/app.js b/js/app.js index ea89e1d..9d6bb6d 100644 --- a/js/app.js +++ b/js/app.js @@ -76,10 +76,17 @@ $(document).ready(function () { m = today.getMonth() + 1; y = today.getFullYear(); requiredDate = y + '-' + m + '-' + d; - $("#dateOff1").attr("min", requiredDate); + // $("#dateOff1").attr("min", requiredDate); $("#dateOff1").change(function () { currentDate = this.value; + today = new Date(currentDate); + d = today.getDate() + 2; + m = today.getMonth() + 1; + y = today.getFullYear(); + requiredDate = y + '-' + m + '-' + d; + alert(requiredDate); + }); // $("#date1").val(requiredDate); $("#date1").datepicker({ diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index d97de7b..d60f8f4 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -67,10 +67,17 @@ $(document).ready(function () { m = today.getMonth() + 1; y = today.getFullYear(); requiredDate = y + '-' + m + '-' + d; - $("#dateOff1").attr("min", requiredDate); + // $("#dateOff1").attr("min", requiredDate); $("#dateOff1").change(function () { currentDate = this.value; + today = new Date(currentDate); + d = today.getDate() + 2; + m = today.getMonth() + 1; + y = today.getFullYear(); + requiredDate = y + '-' + m + '-' + d; + alert(requiredDate); + }); // $("#date1").val(requiredDate); $("#date1").datepicker({ diff --git a/parts/off-canvas-menu.php b/parts/off-canvas-menu.php index f7a5bcb..803fd70 100644 --- a/parts/off-canvas-menu.php +++ b/parts/off-canvas-menu.php @@ -16,17 +16,19 @@ Book Now + +
- +
- " placeholder="Depart" name="DepartureDate" required="required"> +
-- 2.17.1