From: Anthony Talarico Date: Fri, 29 Jul 2016 12:26:39 +0000 (-0400) Subject: removing jquery datepicker and using native booking widget datepicker by removing... X-Git-Tag: v1.0.0^2~229 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=57950ff6fafc6992b485cab79820fc3485dfc1de;p=WP-Themes%2Fpetoskeyarea.git removing jquery datepicker and using native booking widget datepicker by removing the pc view datepicker id on certain window sizes --- diff --git a/js/app.js b/js/app.js index 1ed6a69..db3bffd 100644 --- a/js/app.js +++ b/js/app.js @@ -70,12 +70,12 @@ $(document).ready(function () { var off_canvas_arrival = $(".right-off-canvas-menu").find("#start-date"); var off_canvas_departure = $(".right-off-canvas-menu").find("#end-date"); - $(off_canvas_arrival).removeClass("date-pick").removeAttr("onclick").removeAttr("value"); - $(off_canvas_departure).removeClass("date-pick").removeAttr("onclick").removeAttr("value"); +// $(off_canvas_arrival).removeClass("date-pick").removeAttr("onclick").removeAttr("value"); +// $(off_canvas_departure).removeClass("date-pick").removeAttr("onclick").removeAttr("value"); - $(off_canvas_arrival).datepicker({ +// $(off_canvas_arrival).datepicker({ - minDate: 0, +// minDate: 0, // beforeShow: function (input, inst) { // setTimeout(function () { // inst.dpDiv.css({ @@ -84,29 +84,29 @@ $(document).ready(function () { // }); // }, 0); // } - }); +// }); var depart_min, min_date, y, m, d; - $(off_canvas_arrival).change( function () { - - min_date = $(this).datepicker('getDate', '+1d'); - min_date.setDate(min_date.getDate() + 1); +// $(off_canvas_arrival).change( function () { +// +// min_date = $(this).datepicker('getDate', '+1d'); +// min_date.setDate(min_date.getDate() + 1); // $(off_canvas_departure).datepicker('setDate', min_date); - $(off_canvas_departure).datepicker('option','minDate', min_date ); - - }); - $(off_canvas_departure).datepicker({ -// beforeShow: function (input, inst) { -// setTimeout(function () { -// inst.dpDiv.css({ -// top: 100, -// left: 50 -// }); -// }, 0); -// } - }); +// $(off_canvas_departure).datepicker('option','minDate', min_date ); +// +// }); +// $(off_canvas_departure).datepicker({ +//// beforeShow: function (input, inst) { +//// setTimeout(function () { +//// inst.dpDiv.css({ +//// top: 100, +//// left: 50 +//// }); +//// }, 0); +//// } +// }); @@ -126,21 +126,33 @@ $(document).ready(function () { // this section is to remove duplicate ID's preventing datepicker from working + var start_datepicker_large = $("#resContent").find("#start-jrdatepicker"); + var end_datepicker_large = $("#resContent").find("#end-jrdatepicker"); + if ($(window).width() < 1024) { $(start_date).attr("id", "none") $(end_date).attr("id", "none"); + $(start_datepicker_large).attr("id", "none"); + $(end_datepicker_large).attr("id", "none"); + } else { $(start_date).attr("id", "start-date") $(end_date).attr("id", "end-date"); + $(start_datepicker_large).attr("id", "start-jrdatepicker"); + $(end_datepicker_large).attr("id", "end-jrdatepicker"); } $(window).resize( function () { if ($(window).width() < 1024) { $(start_date).attr("id", "none"); $(end_date).attr("id", "none"); + $(start_datepicker_large).attr("id", "none"); + $(end_datepicker_large).attr("id", "none"); } else { $(start_date).attr("id", "start-date"); $(end_date).attr("id", "end-date"); + $(start_datepicker_large).attr("id", "start-jrdatepicker"); + $(end_datepicker_large).attr("id", "end-jrdatepicker"); } }); diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index fe8471f..2e4d710 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -61,12 +61,12 @@ $(document).ready(function () { var off_canvas_arrival = $(".right-off-canvas-menu").find("#start-date"); var off_canvas_departure = $(".right-off-canvas-menu").find("#end-date"); - $(off_canvas_arrival).removeClass("date-pick").removeAttr("onclick").removeAttr("value"); - $(off_canvas_departure).removeClass("date-pick").removeAttr("onclick").removeAttr("value"); +// $(off_canvas_arrival).removeClass("date-pick").removeAttr("onclick").removeAttr("value"); +// $(off_canvas_departure).removeClass("date-pick").removeAttr("onclick").removeAttr("value"); - $(off_canvas_arrival).datepicker({ +// $(off_canvas_arrival).datepicker({ - minDate: 0, +// minDate: 0, // beforeShow: function (input, inst) { // setTimeout(function () { // inst.dpDiv.css({ @@ -75,29 +75,29 @@ $(document).ready(function () { // }); // }, 0); // } - }); +// }); var depart_min, min_date, y, m, d; - $(off_canvas_arrival).change( function () { - - min_date = $(this).datepicker('getDate', '+1d'); - min_date.setDate(min_date.getDate() + 1); +// $(off_canvas_arrival).change( function () { +// +// min_date = $(this).datepicker('getDate', '+1d'); +// min_date.setDate(min_date.getDate() + 1); // $(off_canvas_departure).datepicker('setDate', min_date); - $(off_canvas_departure).datepicker('option','minDate', min_date ); - - }); - $(off_canvas_departure).datepicker({ -// beforeShow: function (input, inst) { -// setTimeout(function () { -// inst.dpDiv.css({ -// top: 100, -// left: 50 -// }); -// }, 0); -// } - }); +// $(off_canvas_departure).datepicker('option','minDate', min_date ); +// +// }); +// $(off_canvas_departure).datepicker({ +//// beforeShow: function (input, inst) { +//// setTimeout(function () { +//// inst.dpDiv.css({ +//// top: 100, +//// left: 50 +//// }); +//// }, 0); +//// } +// }); @@ -117,21 +117,33 @@ $(document).ready(function () { // this section is to remove duplicate ID's preventing datepicker from working + var start_datepicker_large = $("#resContent").find("#start-jrdatepicker"); + var end_datepicker_large = $("#resContent").find("#end-jrdatepicker"); + if ($(window).width() < 1024) { $(start_date).attr("id", "none") $(end_date).attr("id", "none"); + $(start_datepicker_large).attr("id", "none"); + $(end_datepicker_large).attr("id", "none"); + } else { $(start_date).attr("id", "start-date") $(end_date).attr("id", "end-date"); + $(start_datepicker_large).attr("id", "start-jrdatepicker"); + $(end_datepicker_large).attr("id", "end-jrdatepicker"); } $(window).resize( function () { if ($(window).width() < 1024) { $(start_date).attr("id", "none"); $(end_date).attr("id", "none"); + $(start_datepicker_large).attr("id", "none"); + $(end_datepicker_large).attr("id", "none"); } else { $(start_date).attr("id", "start-date"); $(end_date).attr("id", "end-date"); + $(start_datepicker_large).attr("id", "start-jrdatepicker"); + $(end_datepicker_large).attr("id", "end-jrdatepicker"); } }); diff --git a/parts/reservation-form-content.php b/parts/reservation-form-content.php index d708318..d88c670 100644 --- a/parts/reservation-form-content.php +++ b/parts/reservation-form-content.php @@ -1,6 +1,6 @@
-
+