//得到每周的第一天(周日)
function getFirstDateOfWeek(theDate){
var firstDateOfWeek;
theDate.setDate(theDate.getDate() - theDate.getDay()); //
firstDateOfWeek = theDate;
return firstDateOfWeek;
}
//得到每周的最后一天(周六)
function getLastDateOfWeek(theDate){
var lastDateOfWeek;
theDate.setDate(theDate.getDate() + 6 - theDate.getDay()); //
lastDateOfWeek = theDate;
return lastDateOfWeek;
}