display yesterday today's javascript code example
Example 1: js yesterday date
var d = new Date();
d.setDate(d.getDate() - 1);
Example 2: javascript beginning of today and yesterday
var start = new Date();
start.setHours(0, 0, 0, 0);
start = start.getTime();
var end = new Date();
end.setHours(0, 0, 0, 0);
end.setDate(end.getDate() + 1);
end = end.getTime();