I am trying to parse the date to string that is input by a user using IBM's BPM Coach framework (input is in dd/MM/YYYY). I need parse the Date to String and pass it to an external service. I am getting desired results by using the following code snippet but for a few cases.
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1;
var yyyy = today.getFullYear();
if(dd<10){
dd='0'+dd;
}
if(mm<10){
mm='0'+mm;
}
var today = dd+'/'+mm+'/'+yyyy;
console.log(today)
While testing I provided the value on input say 01/01/1991, the javascript parser fails and the input captured is something like 32/12/1990.
I am not sure how to cater this. Any help would be highly appreciated.