From 6b5ee6e8691e4b5a8358fe6171c88265da2a532f Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Wed, 2 Dec 2015 16:04:40 -0500 Subject: [PATCH] fixed off canvas datepicker and added shadow to properties menu --- css/app.css | 3 +- js/app.js | 78 ++++++++++++++++++++++++++++++++---------- js/custom/pageSetup.js | 78 ++++++++++++++++++++++++++++++++---------- scss/_topbar.scss | 1 + 4 files changed, 121 insertions(+), 39 deletions(-) diff --git a/css/app.css b/css/app.css index edacc21..e2fc1a0 100644 --- a/css/app.css +++ b/css/app.css @@ -6807,7 +6807,8 @@ header .searchform input[type="submit"]:hover { width: 245px; height: 40px; border-left: 2px solid #FFFFFF; - border-right: 2px solid #FFFFFF; } + border-right: 2px solid #FFFFFF; + box-shadow: 0px -7px 10px -9px rgba(0, 0, 0, 0.5) inset; } #properties .top-bar .top-bar-section ul#menu-properties li a { color: #6c4f53; text-transform: uppercase; diff --git a/js/app.js b/js/app.js index ede0453..16aa146 100644 --- a/js/app.js +++ b/js/app.js @@ -36,13 +36,41 @@ $(document).ready(function () { kids, perry = 'RtXm7mjas4tWRxEAkt8ienQMPRR5EbsZGSOalE8V63s%3d&'; + + + + + + + + + + + + + + + + + + + + + + + + + ///////off canvas date picker logic ////////////////////////////////////////////// // restrict arrival date //////////////////////////////// + $("#arriveOff").val("Arrival Date"); + $("#departOff").val("Departure Date"); $(document).on('change', '#arriveOff', function () { currentDate = $("#arriveOff").val(); currentDate = new Date(currentDate); currentDate = new Date(currentDate.getUTCFullYear(), currentDate.getUTCMonth(), currentDate.getUTCDate()); currentDate.setDate(currentDate.getDate()); + console.log(currentDate); d = currentDate.getDate(); dd = currentDate.getDate() + 1; if (d <= 9) { @@ -54,10 +82,7 @@ $(document).ready(function () { } y = currentDate.getFullYear(); requiredDate = y + '-' + m + '-' + d; - arrival = d + '-' + m + '-' + y; - arrival.toString(); - arrival = arrival.replace(/\//g, ""); - arrival = parseInt(arrival, 10); + minDays = y + '-' + m + '-' + dd; $("#departOff").attr("min", minDays); start = "arrival_date=" + y + '-' + m + '-' + d + '&'; @@ -86,11 +111,15 @@ $(document).ready(function () { currentDate2 = new Date(currentDate2); currentDate2 = new Date(currentDate2.getUTCFullYear(), currentDate2.getUTCMonth(), currentDate2.getUTCDate()); currentDate2.setDate(currentDate2.getDate()); - dd = currentDate2.getDate() + 1; - if (dd <= 9) { - dd = '0' + dd; + console.log(currentDate2); + $("#nightsOff").val(Math.ceil(currentDate2 - currentDate) / (1000 * 60 * 60 * 24)); + if ($("#nightsOff").val() <= 0) { + $("#departOff").val("Minimum 1 Night"); + $("#nightsOff").val(""); } - d = currentDate2.getDate(); + console.log($("#nightsOff").val()); + + d = currentDate2.getDate() + 1; if (d <= 9) { d = '0' + d; } @@ -101,21 +130,32 @@ $(document).ready(function () { y = currentDate2.getFullYear(); requiredDate1 = y + '-' + m + '-' + dd; departure = d + '-' + m + '-' + y; - departure.toString(); - departure = departure.replace(/\//g, ""); - departure = parseInt(departure, 10); - stay = (departure - arrival); - if (stay < 0) { - stay = 0; - } else { - $("#nightsOff").val(Math.ceil(departure - currentDate) / (1000 * 60 * 60 * 24)); - } - stay = 'stay_nights=' + (departure - arrival) + '&'; + stay = 'stay_nights=' + $('#nightsOff').val() + '&'; if ($("#departOff").val() < $('#departOff').attr("min")) { // $("#departOff").val(requiredDate); } }); ///// end of canvas datepicker logic ^ ////////////////////////////////////////////// + + + + + + + + + + + + + + + + + + + + /// top bar reservation form dropdown logic //////////////////////////// $("#arrive").datepicker({ @@ -151,7 +191,7 @@ $(document).ready(function () { stay = 'stay_nights=' + $('#nights').val() + '&'; } - }); + }); $("#arriveCal").click(function () { $("#arrive").datepicker("show"); }); diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index 0b6970e..470ee5f 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -27,13 +27,41 @@ $(document).ready(function () { kids, perry = 'RtXm7mjas4tWRxEAkt8ienQMPRR5EbsZGSOalE8V63s%3d&'; + + + + + + + + + + + + + + + + + + + + + + + + + ///////off canvas date picker logic ////////////////////////////////////////////// // restrict arrival date //////////////////////////////// + $("#arriveOff").val("Arrival Date"); + $("#departOff").val("Departure Date"); $(document).on('change', '#arriveOff', function () { currentDate = $("#arriveOff").val(); currentDate = new Date(currentDate); currentDate = new Date(currentDate.getUTCFullYear(), currentDate.getUTCMonth(), currentDate.getUTCDate()); currentDate.setDate(currentDate.getDate()); + console.log(currentDate); d = currentDate.getDate(); dd = currentDate.getDate() + 1; if (d <= 9) { @@ -45,10 +73,7 @@ $(document).ready(function () { } y = currentDate.getFullYear(); requiredDate = y + '-' + m + '-' + d; - arrival = d + '-' + m + '-' + y; - arrival.toString(); - arrival = arrival.replace(/\//g, ""); - arrival = parseInt(arrival, 10); + minDays = y + '-' + m + '-' + dd; $("#departOff").attr("min", minDays); start = "arrival_date=" + y + '-' + m + '-' + d + '&'; @@ -77,11 +102,15 @@ $(document).ready(function () { currentDate2 = new Date(currentDate2); currentDate2 = new Date(currentDate2.getUTCFullYear(), currentDate2.getUTCMonth(), currentDate2.getUTCDate()); currentDate2.setDate(currentDate2.getDate()); - dd = currentDate2.getDate() + 1; - if (dd <= 9) { - dd = '0' + dd; + console.log(currentDate2); + $("#nightsOff").val(Math.ceil(currentDate2 - currentDate) / (1000 * 60 * 60 * 24)); + if ($("#nightsOff").val() <= 0) { + $("#departOff").val("Minimum 1 Night"); + $("#nightsOff").val(""); } - d = currentDate2.getDate(); + console.log($("#nightsOff").val()); + + d = currentDate2.getDate() + 1; if (d <= 9) { d = '0' + d; } @@ -92,21 +121,32 @@ $(document).ready(function () { y = currentDate2.getFullYear(); requiredDate1 = y + '-' + m + '-' + dd; departure = d + '-' + m + '-' + y; - departure.toString(); - departure = departure.replace(/\//g, ""); - departure = parseInt(departure, 10); - stay = (departure - arrival); - if (stay < 0) { - stay = 0; - } else { - $("#nightsOff").val(Math.ceil(departure - currentDate) / (1000 * 60 * 60 * 24)); - } - stay = 'stay_nights=' + (departure - arrival) + '&'; + stay = 'stay_nights=' + $('#nightsOff').val() + '&'; if ($("#departOff").val() < $('#departOff').attr("min")) { // $("#departOff").val(requiredDate); } }); ///// end of canvas datepicker logic ^ ////////////////////////////////////////////// + + + + + + + + + + + + + + + + + + + + /// top bar reservation form dropdown logic //////////////////////////// $("#arrive").datepicker({ @@ -142,7 +182,7 @@ $(document).ready(function () { stay = 'stay_nights=' + $('#nights').val() + '&'; } - }); + }); $("#arriveCal").click(function () { $("#arrive").datepicker("show"); }); diff --git a/scss/_topbar.scss b/scss/_topbar.scss index db4d8f0..d8efc65 100644 --- a/scss/_topbar.scss +++ b/scss/_topbar.scss @@ -463,6 +463,7 @@ height: 40px; border-left: 2px solid $white; border-right: 2px solid $white; + box-shadow: 0px -7px 10px -9px rgba(0, 0, 0, 0.5) inset; a { color: $purple; text-transform: uppercase; -- 2.17.1