你的问题更多的是关注 JS 怎么实现日期计算。计算的思路可参考下面代码:
var currentTime=new Date().getTime();
var currentWeekDay=new Date().getDay();
var dayLongTime=24*60*60*1000;
//计算周六距离当前时间的差值
var furtureSundayTimes = currentTime + (7 – currentWeekDay) * dayLongTime;
//计算周日距离当前时间的差值
var furtureSaturdayTimes = currentTime + (6 – currentWeekDay) * dayLongTime;
//转换为日期对象
var furtureSaturday = new Date(furtureSaturdayTimes);
var furtureSunday = new Date(furtureSundayTimes);
//查询范围:周六0点0分0秒,周日23点59分59秒
furtureSaturday.setHours(0);
furtureSaturday.setMinutes(0);
furtureSaturday.setSeconds(0);
furtureSaturday.setMilliseconds(0);
furtureSunday.setHours(23);
furtureSunday.setMinutes(59);
furtureSunday.setSeconds(59);
furtureSunday.setMilliseconds(999);
//打印
print(furtureSaturday);
print(furtureSunday);