From: Anthony Talarico Date: Mon, 2 Nov 2015 20:20:41 +0000 (-0500) Subject: Converting string date into date object and matching to RFC 3339 standard X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=cd576810c3b9f8b0e80e53e370555b9ed4a81909;p=WP-Themes%2Fglmthemes%2Fbpla-theme.git Converting string date into date object and matching to RFC 3339 standard --- diff --git a/js/app.js b/js/app.js index 34805bf..4c64497 100644 --- a/js/app.js +++ b/js/app.js @@ -80,7 +80,11 @@ $(document).ready(function () { $("#dateOff1").change(function () { currentDate = this.value; currentDate = new Date(currentDate); - alert(currentDate); + d = currentDate.getDate(); + m = currentDate.getMonth() + 1; + y = currentDate.getFullYear(); + requiredDate = y + '-' + m + '-' + d; + alert(requiredDate); }); $("#date1").datepicker({ minDate: 2, diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index 763239f..798b5ba 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -71,7 +71,11 @@ $(document).ready(function () { $("#dateOff1").change(function () { currentDate = this.value; currentDate = new Date(currentDate); - alert(currentDate); + d = currentDate.getDate(); + m = currentDate.getMonth() + 1; + y = currentDate.getFullYear(); + requiredDate = y + '-' + m + '-' + d; + alert(requiredDate); }); $("#date1").datepicker({ minDate: 2,