added a minimum of one day to the departure day for the reservation widget on pc...
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 26 Jul 2016 20:37:17 +0000 (16:37 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 26 Jul 2016 20:37:17 +0000 (16:37 -0400)
js/app.js
js/custom/pageSetup.js

index 3e54dd7..0419507 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -66,7 +66,15 @@ $(document).ready(function () {
 
     });
     
-     $("#arriveCal").click(function () {
+    // add a minimum of 1 day to the reservation length
+    $(arrival_date).change( function () {
+       var min_date = $(this).datepicker('getDate', '+1d');
+        min_date.setDate(min_date.getDate() + 1);
+        $(departure_date).datepicker('setDate', min_date);
+    });
+    
+    // set the cal icons to be show the datepicker when clicked
+    $("#arriveCal").click(function () {
         $(arrival_date).datepicker("show");
     });
     $("#departCal").click(function () {
index d0a0572..8adf876 100644 (file)
@@ -57,7 +57,15 @@ $(document).ready(function () {
 
     });
     
-     $("#arriveCal").click(function () {
+    // add a minimum of 1 day to the reservation length
+    $(arrival_date).change( function () {
+       var min_date = $(this).datepicker('getDate', '+1d');
+        min_date.setDate(min_date.getDate() + 1);
+        $(departure_date).datepicker('setDate', min_date);
+    });
+    
+    // set the cal icons to be show the datepicker when clicked
+    $("#arriveCal").click(function () {
         $(arrival_date).datepicker("show");
     });
     $("#departCal").click(function () {