Adjusting getDate method for accurate date appendages. Correcting time zone errors
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 3 Nov 2015 15:33:06 +0000 (10:33 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 3 Nov 2015 15:33:06 +0000 (10:33 -0500)
js/app.js
js/custom/pageSetup.js

index e9b5bb4..f8a3078 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -89,19 +89,20 @@ $(document).ready(function () {
             minDays = $('#dateOff1').attr("min");
             $("#dateOff1").val(minDays);
             $("#dateOff2").val($('#dateOff2').attr("min"));
-        } else {
-            d = currentDate.getDate() + 2;
-            if (d <= 9) {
-                d = '0' + d;
-            }
-            m = currentDate.getMonth() + 1;
-            if (m <= 9) {
-                m = '0' + m;
-            }
-            y = currentDate.getFullYear();
-            requiredDate = y + '-' + m + '-' + d;
-            $("#dateOff2").val(requiredDate);
+        }else{
+        d = currentDate.getDate() + 2;
+        if (d <= 9) {
+            d = '0' + d;
+        }
+        m = currentDate.getMonth() + 1;
+        if (m <= 9) {
+            m = '0' + m;
+        }
+        y = currentDate.getFullYear();
+        requiredDate = y + '-' + m + '-' + d;
+        $("#dateOff2").val(requiredDate);
         }
+        
     });
     // restrict departure date ///////////////////////////////
     $(document).on('change', '#dateOff2', function () {
index 605b260..98829c2 100644 (file)
@@ -80,19 +80,20 @@ $(document).ready(function () {
             minDays = $('#dateOff1').attr("min");
             $("#dateOff1").val(minDays);
             $("#dateOff2").val($('#dateOff2').attr("min"));
-        } else {
-            d = currentDate.getDate() + 2;
-            if (d <= 9) {
-                d = '0' + d;
-            }
-            m = currentDate.getMonth() + 1;
-            if (m <= 9) {
-                m = '0' + m;
-            }
-            y = currentDate.getFullYear();
-            requiredDate = y + '-' + m + '-' + d;
-            $("#dateOff2").val(requiredDate);
+        }else{
+        d = currentDate.getDate() + 2;
+        if (d <= 9) {
+            d = '0' + d;
+        }
+        m = currentDate.getMonth() + 1;
+        if (m <= 9) {
+            m = '0' + m;
+        }
+        y = currentDate.getFullYear();
+        requiredDate = y + '-' + m + '-' + d;
+        $("#dateOff2").val(requiredDate);
         }
+        
     });
     // restrict departure date ///////////////////////////////
     $(document).on('change', '#dateOff2', function () {