Created
December 17, 2014 22:09
-
-
Save dmmoelle/434a27ae635e215d31e5 to your computer and use it in GitHub Desktop.
Find beginning of week date
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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