Skip to content

Instantly share code, notes, and snippets.

@jesusalber1
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jesusalber1/0cef04fc46ab418e8811 to your computer and use it in GitHub Desktop.
Save jesusalber1/0cef04fc46ab418e8811 to your computer and use it in GitHub Desktop.
Weekdays and months
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