select date by today yesterday this week this month javascript code example
Example 1: js yesterday date
var yesterday = new Date((new Date()).valueOf() - 1000*60*60*24);
Example 2: js yesterday date
var d = new Date();
d.setDate(d.getDate() - 1);