Created
July 22, 2015 19:07
-
-
Save drdrang/572c9cb3c16a77a21e1c to your computer and use it in GitHub Desktop.
This file contains hidden or 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 oneday = 60*60*24*1000; | |
var today = new Date(); | |
var wToday = today.getDay(); | |
var away = 1 - wToday; | |
if (away <= 0) { away += 7; } | |
var nextMonday = new Date(today.getTime() + away*oneday ) | |
var theFriday = new Date(nextMonday.getTime() + 4*oneday) | |
nextMonday.toDateString() + ' to ' + theFriday.toDateString(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment