//得到每周的第一天(周日)
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; 
}

posted on 2013-08-17 16:38  dancser  阅读(791)  评论(0编辑  收藏  举报