fixed min date for departure range
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 10 Nov 2015 15:22:11 +0000 (10:22 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 10 Nov 2015 15:22:11 +0000 (10:22 -0500)
js/app.js
js/custom/pageSetup.js

index d75538d..5b01f3c 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -29,7 +29,7 @@ $(document).ready(function () {
             $("#res-tab-open").attr("id", "res-tab");
         }
     });
-    var start, end, arrival, currentDate, requiredDate, minDays, departure, stay, d, m, y, bayView = 'vD4ZpIFk4%2b7FyPsaBnkCqP1cBHWnJili9k5D83MqJq4%3d&',
+    var start, end, arrival, currentDate, requiredDate, minDays, departure, stay, d, dd,  m, y, bayView = 'vD4ZpIFk4%2b7FyPsaBnkCqP1cBHWnJili9k5D83MqJq4%3d&',
         crookedRiver = 'ZhWXD46i2%2fq319vcR%2fcw69rZvA2bz%2fttOOxO9t1%2fBJ0%3d&',
         adults,
         kids,
@@ -43,6 +43,7 @@ $(document).ready(function () {
         currentDate = new Date(currentDate.getUTCFullYear(), currentDate.getUTCMonth(), currentDate.getUTCDate());
         currentDate.setDate(currentDate.getDate());
         d = currentDate.getDate();
+        dd = currentDate.getDate() + 1;
         if (d <= 9) {
             d = '0' + d;
         }
@@ -52,6 +53,8 @@ $(document).ready(function () {
         }
         y = currentDate.getFullYear();
         requiredDate = y + '-' + m + '-' + d;
+        minDays = y + '-' + m + '-' + dd;
+        $("#departOff").attr("min", minDays);
         start = "arrival_date=" + y + '-' + m + '-' + d + '&';
         if (requiredDate < $('#arriveOff').attr("min")) {
             minDays = $('#arriveOff').attr("min");
@@ -68,6 +71,7 @@ $(document).ready(function () {
             }
             y = currentDate.getFullYear();
             requiredDate = y + '-' + m + '-' + d;
+            
             arrival = d + '-' + m + '-' + y;
             arrival.toString();
             arrival = arrival.replace(/\//g, "");
index 1b5fc07..ea79ca6 100644 (file)
@@ -20,7 +20,7 @@ $(document).ready(function () {
             $("#res-tab-open").attr("id", "res-tab");
         }
     });
-    var start, end, arrival, currentDate, requiredDate, minDays, departure, stay, d, m, y, bayView = 'vD4ZpIFk4%2b7FyPsaBnkCqP1cBHWnJili9k5D83MqJq4%3d&',
+    var start, end, arrival, currentDate, requiredDate, minDays, departure, stay, d, dd,  m, y, bayView = 'vD4ZpIFk4%2b7FyPsaBnkCqP1cBHWnJili9k5D83MqJq4%3d&',
         crookedRiver = 'ZhWXD46i2%2fq319vcR%2fcw69rZvA2bz%2fttOOxO9t1%2fBJ0%3d&',
         adults,
         kids,
@@ -34,6 +34,7 @@ $(document).ready(function () {
         currentDate = new Date(currentDate.getUTCFullYear(), currentDate.getUTCMonth(), currentDate.getUTCDate());
         currentDate.setDate(currentDate.getDate());
         d = currentDate.getDate();
+        dd = currentDate.getDate() + 1;
         if (d <= 9) {
             d = '0' + d;
         }
@@ -43,6 +44,8 @@ $(document).ready(function () {
         }
         y = currentDate.getFullYear();
         requiredDate = y + '-' + m + '-' + d;
+        minDays = y + '-' + m + '-' + dd;
+        $("#departOff").attr("min", minDays);
         start = "arrival_date=" + y + '-' + m + '-' + d + '&';
         if (requiredDate < $('#arriveOff').attr("min")) {
             minDays = $('#arriveOff').attr("min");
@@ -59,6 +62,7 @@ $(document).ready(function () {
             }
             y = currentDate.getFullYear();
             requiredDate = y + '-' + m + '-' + d;
+            
             arrival = d + '-' + m + '-' + y;
             arrival.toString();
             arrival = arrival.replace(/\//g, "");