In below code when I subtract day from date I get day as well as month subtracted by one.
var today = new Date();
today.setDate(today.getDate() - 1);
var dd = today.getDate();
var mm = today.getMonth() + 1; //Here is the problem so I have to do +1 to get to current month
var yyyy = today.getFullYear();
Anyone any idea why does this happen? Or if I am doing it in the wrong way can anyone suggest the right way?