Converting string date into date object and matching to RFC 3339 standard
authorAnthony Talarico <talarico@gaslightmedia.com>
Mon, 2 Nov 2015 20:20:41 +0000 (15:20 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Mon, 2 Nov 2015 20:20:41 +0000 (15:20 -0500)
js/app.js
js/custom/pageSetup.js

index 34805bf..4c64497 100644 (file)
--- 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,
index 763239f..798b5ba 100644 (file)
@@ -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,