Skip to content

Instantly share code, notes, and snippets.

@ben-bradley
Created January 15, 2015 19:59
Show Gist options
  • Save ben-bradley/db20dc4583f4e4596ac7 to your computer and use it in GitHub Desktop.
Save ben-bradley/db20dc4583f4e4596ac7 to your computer and use it in GitHub Desktop.
Determine week start & end in javascript
var now = new Date();
var lastSunday = new Date();
var nextSunday = new Date();
lastSunday.setDate(now.getDate() - now.getDay());
nextSunday.setDate(lastSunday.getDate() + 7);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment