From d2d9f5b0dd1f69c0de5ef4522aa01ba3e399c46b Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Tue, 3 Nov 2015 10:33:06 -0500 Subject: [PATCH] Adjusting getDate method for accurate date appendages. Correcting time zone errors --- js/app.js | 25 +++++++++++++------------ js/custom/pageSetup.js | 25 +++++++++++++------------ 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/js/app.js b/js/app.js index e9b5bb4..f8a3078 100644 --- 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 () { diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index 605b260..98829c2 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -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 () { -- 2.17.1