From: Anthony Talarico Date: Mon, 13 Aug 2018 20:41:37 +0000 (-0400) Subject: testing date picker fix for the off canvas reservation widget X-Git-Tag: v1.0.49^2~6 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=6f54eef1b58df54234e52e4326c74259bb60bb57;p=WP-Themes%2Fstaffords.git testing date picker fix for the off canvas reservation widget --- diff --git a/js/app.js b/js/app.js index ac56d62..e3a4eb1 100644 --- a/js/app.js +++ b/js/app.js @@ -33,12 +33,12 @@ $(document).ready(function () { kids, perry = 'RtXm7mjas4tWRxEAkt8ienQMPRR5EbsZGSOalE8V63s%3d&'; - ///////off canvas date picker logic ////////////////////////////////////////////// - // Set inputs to default values /////// - $("#propertyNameOff").val(""); - $("#nightsOff").val(""); - $("#adultsOff").val(""); - $("#kidsOff").val(""); + // ///////off canvas date picker logic ////////////////////////////////////////////// + // // Set inputs to default values /////// + // $("#propertyNameOff").val(""); + // $("#nightsOff").val(""); + // $("#adultsOff").val(""); + // $("#kidsOff").val(""); $(document).on('change', '#arriveOff', function () { @@ -77,11 +77,11 @@ $(document).ready(function () { $("#nightsOff").val(Math.ceil(currentDate2 - currentDate) / (1000 * 60 * 60 * 24)); } if ($("#nightsOff").val() <= 0) { - $("#departOff").val("Minimum 1 Night"); + // $("#departOff").val("Minimum 1 Night"); $("#nightsOff").val(""); } }); - // restrict departure date /////////////////////////////// + // // restrict departure date /////////////////////////////// $(document).on('change', '#departOff', function () { currentDate2 = $("#departOff").val(); currentDate2 = new Date(currentDate2); @@ -89,13 +89,13 @@ $(document).ready(function () { currentDate2.setDate(currentDate2.getDate()); $("#nightsOff").val(Math.ceil(currentDate2 - currentDate) / (1000 * 60 * 60 * 24)); if ($("#nightsOff").val() <= 0) { - $("#departOff").val("Minimum 1 Night"); + // $("#departOff").val("Minimum 1 Night"); $("#nightsOff").val(""); } stay = 'stay_nights=' + $('#nightsOff').val() + '&'; }); - ///// end of canvas datepicker logic ^ ////////////////////////////////////////////// - /// top bar reservation form dropdown logic //////////////////////////// + // ///// end of canvas datepicker logic ^ ////////////////////////////////////////////// + // /// top bar reservation form dropdown logic //////////////////////////// $("#arrive").datepicker({ minDate: 0, dateFormat: 'mm/dd/yy', @@ -143,22 +143,23 @@ $(document).ready(function () { $("#departCalOff").click(function () { $("#departOff").datepicker("show"); }); - // form submission logic - // off canvas resevation form submission /////////////////////////////////////////// + // // form submission logic + // // off canvas resevation form submission /////////////////////////////////////////// $('.res-buttonOff').on('click', function () { + console.log($('#propertyNameOff option:selected').text()) adults = "adults=" + $("#adultsOff").val() + "&"; kids = "children=" + $("#kidsOff").val(); - if ($('#propertyNameOff option:selected').text() === "Bay View Inn") { + if ($('#propertyNameOff option:selected').text() === " Bay View Inn") { window.open("https://www.bookonthenet.net/east/premium/eresmain.aspx?id=" + bayView + start + stay + adults + kids); - } else if ($('#propertyNameOff option:selected').text() === "Crooked River Lodge") { + } else if ($('#propertyNameOff option:selected').text() === " Crooked River Lodge") { window.open("https://www.bookonthenet.net/east/premium/eresmain.aspx?id=" + crookedRiver + start + stay + adults + kids); - } else if ($('#propertyNameOff option:selected').text() === "Perry Hotel") { + } else if ($('#propertyNameOff option:selected').text() === " Perry Hotel") { window.open("https://www.bookonthenet.net/east/premium/eresmain.aspx?id=" + perry + start + stay + adults + kids); } else if ($('#propertyName option:selected').text() === "Property") { alert("Please Select a Property"); } }); - // top bar reservation dropdown button submission ////////////////////////////////////////// + // // top bar reservation dropdown button submission ////////////////////////////////////////// $('.res-button').on('click', function () { adults = "adults=" + $("#adults").val() + "&"; kids = "children=" + $("#kids").val(); diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index 79bec87..05b5543 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -24,12 +24,12 @@ $(document).ready(function () { kids, perry = 'RtXm7mjas4tWRxEAkt8ienQMPRR5EbsZGSOalE8V63s%3d&'; - ///////off canvas date picker logic ////////////////////////////////////////////// - // Set inputs to default values /////// - $("#propertyNameOff").val(""); - $("#nightsOff").val(""); - $("#adultsOff").val(""); - $("#kidsOff").val(""); + // ///////off canvas date picker logic ////////////////////////////////////////////// + // // Set inputs to default values /////// + // $("#propertyNameOff").val(""); + // $("#nightsOff").val(""); + // $("#adultsOff").val(""); + // $("#kidsOff").val(""); $(document).on('change', '#arriveOff', function () { @@ -68,11 +68,11 @@ $(document).ready(function () { $("#nightsOff").val(Math.ceil(currentDate2 - currentDate) / (1000 * 60 * 60 * 24)); } if ($("#nightsOff").val() <= 0) { - $("#departOff").val("Minimum 1 Night"); + // $("#departOff").val("Minimum 1 Night"); $("#nightsOff").val(""); } }); - // restrict departure date /////////////////////////////// + // // restrict departure date /////////////////////////////// $(document).on('change', '#departOff', function () { currentDate2 = $("#departOff").val(); currentDate2 = new Date(currentDate2); @@ -80,13 +80,13 @@ $(document).ready(function () { currentDate2.setDate(currentDate2.getDate()); $("#nightsOff").val(Math.ceil(currentDate2 - currentDate) / (1000 * 60 * 60 * 24)); if ($("#nightsOff").val() <= 0) { - $("#departOff").val("Minimum 1 Night"); + // $("#departOff").val("Minimum 1 Night"); $("#nightsOff").val(""); } stay = 'stay_nights=' + $('#nightsOff').val() + '&'; }); - ///// end of canvas datepicker logic ^ ////////////////////////////////////////////// - /// top bar reservation form dropdown logic //////////////////////////// + // ///// end of canvas datepicker logic ^ ////////////////////////////////////////////// + // /// top bar reservation form dropdown logic //////////////////////////// $("#arrive").datepicker({ minDate: 0, dateFormat: 'mm/dd/yy', @@ -134,22 +134,23 @@ $(document).ready(function () { $("#departCalOff").click(function () { $("#departOff").datepicker("show"); }); - // form submission logic - // off canvas resevation form submission /////////////////////////////////////////// + // // form submission logic + // // off canvas resevation form submission /////////////////////////////////////////// $('.res-buttonOff').on('click', function () { + console.log($('#propertyNameOff option:selected').text()) adults = "adults=" + $("#adultsOff").val() + "&"; kids = "children=" + $("#kidsOff").val(); - if ($('#propertyNameOff option:selected').text() === "Bay View Inn") { + if ($('#propertyNameOff option:selected').text() === " Bay View Inn") { window.open("https://www.bookonthenet.net/east/premium/eresmain.aspx?id=" + bayView + start + stay + adults + kids); - } else if ($('#propertyNameOff option:selected').text() === "Crooked River Lodge") { + } else if ($('#propertyNameOff option:selected').text() === " Crooked River Lodge") { window.open("https://www.bookonthenet.net/east/premium/eresmain.aspx?id=" + crookedRiver + start + stay + adults + kids); - } else if ($('#propertyNameOff option:selected').text() === "Perry Hotel") { + } else if ($('#propertyNameOff option:selected').text() === " Perry Hotel") { window.open("https://www.bookonthenet.net/east/premium/eresmain.aspx?id=" + perry + start + stay + adults + kids); } else if ($('#propertyName option:selected').text() === "Property") { alert("Please Select a Property"); } }); - // top bar reservation dropdown button submission ////////////////////////////////////////// + // // top bar reservation dropdown button submission ////////////////////////////////////////// $('.res-button').on('click', function () { adults = "adults=" + $("#adults").val() + "&"; kids = "children=" + $("#kids").val(); diff --git a/parts/reservation-form-off-canvas.php b/parts/reservation-form-off-canvas.php index 4941735..0a09aff 100644 --- a/parts/reservation-form-off-canvas.php +++ b/parts/reservation-form-off-canvas.php @@ -1,4 +1,5 @@ - "Stafford's Bay View Inn", 188 => "Stafford's Crooked River Lodge", @@ -9,13 +10,13 @@ $oc_properties = array(