Given a date object, how to get its previous month\'s first day in javascript
It will help to get the previous month first and last date.
function getLastMonth(){
var now = new Date();
var lastday = new Date(now.getFullYear(), now.getMonth(), 0);
var firstday = new Date(lastday.getFullYear(), lastday.getMonth(), 1);
var lastMonth = firstday.getDate()+'/'+(firstday.getMonth()+1)+'/'+firstday.getFullYear()+' - '+lastday.getDate()+'/'+(firstday.getMonth()+1)+'/'+lastday.getFullYear();
return lastMonth;
}