Skip to content

Instantly share code, notes, and snippets.

@dmmoelle
Created December 17, 2014 22:09
Show Gist options
  • Save dmmoelle/434a27ae635e215d31e5 to your computer and use it in GitHub Desktop.
Save dmmoelle/434a27ae635e215d31e5 to your computer and use it in GitHub Desktop.
Find beginning of week date
var someDate = new Date();
var n = someDate.getDay();
someDate.setDate(someDate.getDate()-n);
var dd = someDate.getDate();
var mm = someDate.getMonth() + 1;
var y = someDate.getFullYear();
var someFormattedDate = mm + '/'+ dd + '/'+ y;
alert('start week: '+someFormattedDate);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment