// no need to declare beginingOfLastWeek if you won't need it any more - tempDate will be enough just fix the code
var now = new Date(),
beginingOfLastWeek = new Date(),
tempDate = new Date();
beginingOfLastWeek.setDate(now.getDate() - 7 - now.getDay());
tempDate.setTime(beginingOfLastWeek.getTime());
// format it, print it, do anything you want with it
for(var i = 0; i < 7; i++) {
tempDate.setDate(beginingOfLastWeek.getDate() + i);
console.log(tempDate);
}
// and print today for whatever reason you need it
console.log(now);
this would display last weeks 7 days (monday till sunday) + today
if you need 7 days from 7 days ago till today just remove from this line
beginingOfLastWeek.setDate(now.getDate() - 7 - now.getDay() - 1);
the "now.getDay() - 1" bit and increase the iterator from 7 to 8.
cheers
Tom