From: Anthony Talarico Date: Tue, 26 Jul 2016 20:37:17 +0000 (-0400) Subject: added a minimum of one day to the departure day for the reservation widget on pc... X-Git-Tag: v1.0.0^2~259 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=141fc0a356697c8dddf7ac30e53d30e84168a402;p=WP-Themes%2Fpetoskeyarea.git added a minimum of one day to the departure day for the reservation widget on pc view --- diff --git a/js/app.js b/js/app.js index 3e54dd7..0419507 100644 --- 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 () { diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index d0a0572..8adf876 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -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 () {