var start = new Date();
var end = new Date();
var date = new Date();
var day = date.getDay() - 1;
// 因为星期天为0
if (day == -1) {
day = 6;
}
for (var index = 0; index < day; index++) {
start = start.add(Date.DAY, -1);
}
for (var index = 6; index > day; index--) {
end = end.add(Date.DAY, 1);
}