From 141fc0a356697c8dddf7ac30e53d30e84168a402 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Tue, 26 Jul 2016 16:37:17 -0400 Subject: [PATCH] added a minimum of one day to the departure day for the reservation widget on pc view --- js/app.js | 10 +++++++++- js/custom/pageSetup.js | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) 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 () { -- 2.17.1