restricting depart date selection off canvas booking widget
authorAnthony Talarico <talarico@gaslightmedia.com>
Thu, 21 Jan 2016 18:45:21 +0000 (13:45 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Thu, 21 Jan 2016 18:45:21 +0000 (13:45 -0500)
js/app.js
js/custom/pageSetup.js

index aa64c1e..30e0c9b 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -168,7 +168,6 @@ $(document).ready(function () {
             minDays = $("#arriveOff").attr("min");
             $("#arriveOff").val(minDays);
         }
-//       $("#departOff").val(minDays);
 
     });
     // restrict departure date ///////////////////////////////
@@ -177,5 +176,8 @@ $(document).ready(function () {
         currentDate2 = new Date(currentDate2);
         currentDate2 = new Date(currentDate2.getUTCFullYear(), currentDate2.getUTCMonth(),currentDate2.getUTCDate());
         currentDate2.setDate(currentDate2.getDate());
+        if($("#departOff").val() < requiredDate){
+            $("#departOff").val(minDays);
+        }
     });
 });
index 49dde93..4cb8e60 100644 (file)
@@ -159,7 +159,6 @@ $(document).ready(function () {
             minDays = $("#arriveOff").attr("min");
             $("#arriveOff").val(minDays);
         }
-//       $("#departOff").val(minDays);
 
     });
     // restrict departure date ///////////////////////////////
@@ -168,5 +167,8 @@ $(document).ready(function () {
         currentDate2 = new Date(currentDate2);
         currentDate2 = new Date(currentDate2.getUTCFullYear(), currentDate2.getUTCMonth(),currentDate2.getUTCDate());
         currentDate2.setDate(currentDate2.getDate());
+        if($("#departOff").val() < requiredDate){
+            $("#departOff").val(minDays);
+        }
     });
 });