更新时间:2023-10-05 16:16:10
您可以使用以下方法将日期设置为一周的开始:
You can set the date to the start of the week with this:
var d = new Date();
d.setDate(d.getDate() - d.getDay());
然后使用 .setHours(0)
, .setMinutes(0)
等来清除时间.
Then use .setHours(0)
, .setMinutes(0)
, etc. to clear out the time.