Last active
August 29, 2015 14:22
-
-
Save jesusalber1/0cef04fc46ab418e8811 to your computer and use it in GitHub Desktop.
Weekdays and months
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 weekdays = ('Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday').split('|'); | |
var months = ('January|February|March|April|May|June|July|August|September|October|November|December').split('|'); | |
/* if weeks start on Monday... (var weekdays was declared before in global scope) */ | |
function weekStartsOnMonday() { | |
var sunday = weekdays.shift(); | |
weekdays.push(sunday); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment