Changed off canvas menu from datepicker to html5 date type
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 10 Nov 2015 13:53:18 +0000 (08:53 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 10 Nov 2015 13:53:18 +0000 (08:53 -0500)
js/app.js
js/custom/pageSetup.js
parts/reservation-form-off-canvas.php

index 0b98e7d..7f03c2b 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -22,20 +22,12 @@ $(document).ready(function () {
     
     // Custom js and jquery for staffords ///////////////////
     // reservation for toggle click function ///////////////
-   /* $("#res-tab a").on('click', function () {
-        if ($("#res-tab li ul").css("display") === "none") {
-            $("#res-tab li ul").css("display", "inherit");
-        } else {
-            $("#res-tab li ul").css("display", "none");
-        }
-    }); */
     $("#res-tab a").on('click', function () {
         if ($("#res-tab").attr("id") === "res-tab") {
             $("#res-tab").attr("id", "res-tab-open");
         } else {
             $("#res-tab-open").attr("id", "res-tab");
-        }
-                             
+        }                 
     });
     var start, end, arrival, departure, stay, d, m, y, bayView = 'vD4ZpIFk4%2b7FyPsaBnkCqP1cBHWnJili9k5D83MqJq4%3d&',
         crookedRiver = 'ZhWXD46i2%2fq319vcR%2fcw69rZvA2bz%2fttOOxO9t1%2fBJ0%3d&',
@@ -44,7 +36,7 @@ $(document).ready(function () {
         perry = 'RtXm7mjas4tWRxEAkt8ienQMPRR5EbsZGSOalE8V63s%3d&';
     
     ///////off canvas date picker logic //////////////////////////////////////////////
-    $("#arriveOff").datepicker({
+  /*  $("#arriveOff").datepicker({
         onSelect: function (date) {
             $("#arriveOff").datepicker({dateFormat: 'mm/dd/yy'}).val();
             arrival = $("#arriveOff").datepicker('getDate');
@@ -73,7 +65,7 @@ $(document).ready(function () {
             $("#nightsOff").val(departure - arrival);
             stay = 'stay_nights=' + (departure - arrival) + '&';
         }
-    });
+    }); */
     ///// end of canvas datepicker logic ^ //////////////////////////////////////////////
     
     /// top bar reservation form dropdown logic ////////////////////////////
@@ -92,6 +84,7 @@ $(document).ready(function () {
         }
     });
     $("#depart").datepicker({
+        minDate: new Date(arrival),
         onSelect: function (date) {
             $("#depart").datepicker({dateFormat: 'mm/dd/yy'}).val();
             departure = $("#depart").datepicker('getDate');
@@ -133,7 +126,6 @@ $(document).ready(function () {
         } else {
             
         }
-
     });
     // top bar reservation dropdown button submission //////////////////////////////////////////
     $('.res-button').on('click', function () {
index 902613a..1079ab1 100644 (file)
@@ -13,20 +13,12 @@ $(document).ready(function () {
     
     // Custom js and jquery for staffords ///////////////////
     // reservation for toggle click function ///////////////
-   /* $("#res-tab a").on('click', function () {
-        if ($("#res-tab li ul").css("display") === "none") {
-            $("#res-tab li ul").css("display", "inherit");
-        } else {
-            $("#res-tab li ul").css("display", "none");
-        }
-    }); */
     $("#res-tab a").on('click', function () {
         if ($("#res-tab").attr("id") === "res-tab") {
             $("#res-tab").attr("id", "res-tab-open");
         } else {
             $("#res-tab-open").attr("id", "res-tab");
-        }
-                             
+        }                 
     });
     var start, end, arrival, departure, stay, d, m, y, bayView = 'vD4ZpIFk4%2b7FyPsaBnkCqP1cBHWnJili9k5D83MqJq4%3d&',
         crookedRiver = 'ZhWXD46i2%2fq319vcR%2fcw69rZvA2bz%2fttOOxO9t1%2fBJ0%3d&',
@@ -35,7 +27,7 @@ $(document).ready(function () {
         perry = 'RtXm7mjas4tWRxEAkt8ienQMPRR5EbsZGSOalE8V63s%3d&';
     
     ///////off canvas date picker logic //////////////////////////////////////////////
-    $("#arriveOff").datepicker({
+  /*  $("#arriveOff").datepicker({
         onSelect: function (date) {
             $("#arriveOff").datepicker({dateFormat: 'mm/dd/yy'}).val();
             arrival = $("#arriveOff").datepicker('getDate');
@@ -64,7 +56,7 @@ $(document).ready(function () {
             $("#nightsOff").val(departure - arrival);
             stay = 'stay_nights=' + (departure - arrival) + '&';
         }
-    });
+    }); */
     ///// end of canvas datepicker logic ^ //////////////////////////////////////////////
     
     /// top bar reservation form dropdown logic ////////////////////////////
@@ -83,6 +75,7 @@ $(document).ready(function () {
         }
     });
     $("#depart").datepicker({
+        minDate: new Date(arrival),
         onSelect: function (date) {
             $("#depart").datepicker({dateFormat: 'mm/dd/yy'}).val();
             departure = $("#depart").datepicker('getDate');
@@ -124,7 +117,6 @@ $(document).ready(function () {
         } else {
             
         }
-
     });
     // top bar reservation dropdown button submission //////////////////////////////////////////
     $('.res-button').on('click', function () {
index caed21f..cf7dbc5 100644 (file)
@@ -9,10 +9,10 @@
                                 </select>
             </div>
             <div class="small-12 res-date columns">
-                <input id="arriveOff" type="text" placeholder="Arrive" name="datepicker1" required="required"><img id="arriveCalOff" src="<?php echo get_template_directory_uri(); ?>/assets/calendar-icon.jpg">
+                <input id="arriveOff" type="date" placeholder="Arrive" name="datepicker1" required="required"><img id="arriveCalOff" src="<?php echo get_template_directory_uri(); ?>/assets/calendar-icon.jpg">
             </div>
             <div class="small-12 res-date columns">
-                <input id="departOff" type="text" placeholder="Depart" name="datepicker2" required="required"><img id="departCalOff" src="<?php echo get_template_directory_uri(); ?>/assets/calendar-icon.jpg">
+                <input id="departOff" type="date" placeholder="Depart" name="datepicker2" required="required"><img id="departCalOff" src="<?php echo get_template_directory_uri(); ?>/assets/calendar-icon.jpg">
             </div>
             <div class="small-12 columns">
                 <input id="nightsOff" type="text" placeholder="Number of Nights">