You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
function startOfWeek(date)
|
|
{
|
|
var diff = date.getDate() - date.getDay() + (date.getDay() === 0 ? -6 : 1);
|
|
|
|
return new Date(date.setDate(diff));
|
|
|
|
}
|
|
|
|
dt = new Date();
|
|
|
|
console.log(startOfWeek(dt).toString());
|