Created
October 6, 2015 22:31
-
-
Save bencevans/27622879f7da3d8159b4 to your computer and use it in GitHub Desktop.
Get the Brunel Week Number in JavaScript
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 today = new Date() | |
var secondsInAWeek = 604800 | |
var startDate = new Date(2015, 8, 20) | |
var weekNo = Math.ceil((today - startDate) / (secondsInAWeek * 1000)) | |
console.log('Current Week Number: ' + weekNo) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment