min date for html5 not functioning properly
authorAnthony Talarico <talarico@gaslightmedia.com>
Mon, 2 Nov 2015 17:54:53 +0000 (12:54 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Mon, 2 Nov 2015 17:54:53 +0000 (12:54 -0500)
js/app.js
js/custom/pageSetup.js
parts/off-canvas-menu.php

index 03c598d..a2770d2 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -79,15 +79,9 @@ $(document).ready(function () {
    // $("#dateOff1").attr("min", requiredDate);
     
     $("#dateOff1").change(function () {
-        currentDate = this.value;
-        today = new Date(currentDate);
-        d = today.getDate() + 2;
-        m = today.getMonth() + 1;
-        y = today.getFullYear();
-        requiredDate = y + '-' + m + '-' + d;
-  
-
+                          
     });
+    $("dateOff1").validate();
    // $("#date1").val(requiredDate);
     $("#date1").datepicker({
         minDate: 2,
index 64b5403..c61265d 100644 (file)
@@ -70,15 +70,9 @@ $(document).ready(function () {
    // $("#dateOff1").attr("min", requiredDate);
     
     $("#dateOff1").change(function () {
-        currentDate = this.value;
-        today = new Date(currentDate);
-        d = today.getDate() + 2;
-        m = today.getMonth() + 1;
-        y = today.getFullYear();
-        requiredDate = y + '-' + m + '-' + d;
-  
-
+                          
     });
+    $("dateOff1").validate();
    // $("#date1").val(requiredDate);
     $("#date1").datepicker({
         minDate: 2,
index 5eef5d7..803fd70 100644 (file)
@@ -16,8 +16,8 @@
             <span>Book Now</span>
         </div>
     </div>
-    <?php $requiredDate = date('d-m-Y', strtotime("+2 days")); ?>
-    <?php $minStay = date('d-m-Y', strtotime($requiredDate. "+2 days" )); ?>
+    <?php $requiredDate = date('Y-m-d', strtotime("+2 days")); ?>
+    <?php $minStay = date('Y-m-d', strtotime($requiredDate. "+2 days" )); ?>
     <form method="post" action="<?php echo get_permalink(150); ?>">
         <div class="row">
             <div class="small-12 res-search columns">