Skip to content

Instantly share code, notes, and snippets.

@marcusandre
Created March 5, 2014 13:23
Show Gist options
  • Save marcusandre/9367067 to your computer and use it in GitHub Desktop.
Save marcusandre/9367067 to your computer and use it in GitHub Desktop.
Do something every day from today for one week.
/**
* Module dependencies.
*/
var moment = require('moment');
// weekdays
var weekdays = [
'sunday',
'monday',
'tuesday',
'wednesday',
'thursday',
'friday',
'saturday'
];
// timers
var now = moment();
var today = weekdays[now.weekday()];
var n = 6; // monday + 6 == sunday
console.log(today);
while (n--){
now = now.add('days', 1);
today = weekdays[now.weekday()];
console.log(today);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment