releasing the changes to the reservation widgets for desktop and off canvas
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 14 Aug 2018 16:30:18 +0000 (12:30 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 14 Aug 2018 16:30:18 +0000 (12:30 -0400)
automatically setting the property name when a visitor is on a proprerty page

header.php
js/app.js
js/custom/pageSetup.js
style.css

index f1caa80..6011107 100644 (file)
@@ -4,7 +4,7 @@
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
     <title><?php wp_title(); ?></title>
-    <link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri() ; ?>/css/app.css?v=1.0.47">
+    <link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri() ; ?>/css/app.css?v=1.0.49">
     <link rel="shortcut icon" href="<?php echo get_stylesheet_directory_uri() ; ?>/favicon.ico?v=2">
 <!--
     <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,400italic,700' rel='stylesheet' type='text/css'>
index 054a485..db64f14 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -131,35 +131,13 @@ $(document).ready(function () {
         let formattedDate = `${year}-${month}-${day}`;
         _.val(formattedDate);
         let arrivalDate = new Date($("#arriveOff").val());
-        console.log( getNights(departDate,arrivalDate) < 0 );
         if( !isNaN( getNights(departDate,arrivalDate) ) && !getNights(departDate,arrivalDate) < 0){
             $("#nightsOff").val( getNights(departDate,arrivalDate) ) 
             stay = `stay_nights=${getNights(departDate,arrivalDate)}&`;
-            console.log(" ASDFASDF")
         }else {
             $("#nightsOff").val( 1 ) 
             stay = `stay_nights=1&`;
         }
-
-        
-        // weird date incrementer is the only way in vanilla js to roll over to next month instead of going to 8-32-2018 for example
-        // let minDate  = ((new Date(arrivalDate).valueOf() + + 1000*3600*24) > 9) ? (new Date(arrivalDate).valueOf() + + 1000*3600*24) : `0${(new Date(arrivalDate).valueOf() + + 1000*3600*24)}`;    
-        // minDate = new Date(minDate);
-        // month   = (minDate.getMonth() +1 > 9) ? minDate.getMonth() +1 : `0${minDate.getMonth() +1}`;
-        // day     = (minDate.getDate() > 9) ? minDate.getDate() : `0${minDate.getDate()}`;
-        // year    = minDate.getUTCFullYear();   
-        // formattedDate = `${year}-${month}-${day}`;
-        // $("#departOff").val(formattedDate);
-        // currentDate2 = $("#departOff").val();
-        // currentDate2 = new Date(currentDate2);
-        // currentDate2 = new Date(currentDate2.getUTCFullYear(), currentDate2.getUTCMonth(), currentDate2.getUTCDate());
-        // currentDate2.setDate(currentDate2.getDate());
-        // $("#nightsOff").val(Math.ceil(currentDate2 - currentDate) / (1000 * 60 * 60 * 24));
-        // if ($("#nightsOff").val() <= 0) {
-        //     // $("#departOff").val("Minimum 1 Night");
-        //     $("#nightsOff").val("");
-        // }
-        // stay = 'stay_nights=' + $('#nightsOff').val() + '&';
     });
     // ///// end of canvas datepicker logic ^ //////////////////////////////////////////////
     // /// top bar reservation form dropdown logic ////////////////////////////
index ae28d03..695a86c 100644 (file)
@@ -122,35 +122,13 @@ $(document).ready(function () {
         let formattedDate = `${year}-${month}-${day}`;
         _.val(formattedDate);
         let arrivalDate = new Date($("#arriveOff").val());
-        console.log( getNights(departDate,arrivalDate) < 0 );
         if( !isNaN( getNights(departDate,arrivalDate) ) && !getNights(departDate,arrivalDate) < 0){
             $("#nightsOff").val( getNights(departDate,arrivalDate) ) 
             stay = `stay_nights=${getNights(departDate,arrivalDate)}&`;
-            console.log(" ASDFASDF")
         }else {
             $("#nightsOff").val( 1 ) 
             stay = `stay_nights=1&`;
         }
-
-        
-        // weird date incrementer is the only way in vanilla js to roll over to next month instead of going to 8-32-2018 for example
-        // let minDate  = ((new Date(arrivalDate).valueOf() + + 1000*3600*24) > 9) ? (new Date(arrivalDate).valueOf() + + 1000*3600*24) : `0${(new Date(arrivalDate).valueOf() + + 1000*3600*24)}`;    
-        // minDate = new Date(minDate);
-        // month   = (minDate.getMonth() +1 > 9) ? minDate.getMonth() +1 : `0${minDate.getMonth() +1}`;
-        // day     = (minDate.getDate() > 9) ? minDate.getDate() : `0${minDate.getDate()}`;
-        // year    = minDate.getUTCFullYear();   
-        // formattedDate = `${year}-${month}-${day}`;
-        // $("#departOff").val(formattedDate);
-        // currentDate2 = $("#departOff").val();
-        // currentDate2 = new Date(currentDate2);
-        // currentDate2 = new Date(currentDate2.getUTCFullYear(), currentDate2.getUTCMonth(), currentDate2.getUTCDate());
-        // currentDate2.setDate(currentDate2.getDate());
-        // $("#nightsOff").val(Math.ceil(currentDate2 - currentDate) / (1000 * 60 * 60 * 24));
-        // if ($("#nightsOff").val() <= 0) {
-        //     // $("#departOff").val("Minimum 1 Night");
-        //     $("#nightsOff").val("");
-        // }
-        // stay = 'stay_nights=' + $('#nightsOff').val() + '&';
     });
     // ///// end of canvas datepicker logic ^ //////////////////////////////////////////////
     // /// top bar reservation form dropdown logic ////////////////////////////
index 704e56b..679e899 100644 (file)
--- a/style.css
+++ b/style.css
@@ -3,5 +3,5 @@ Theme Name: Staffords
 Author: Gaslight Media
 Author URI: http://www.gaslightmedia.com
 Description: A theme for Staffords
-Version: 1.0.48
+Version: 1.0.49
 */