Skip to content

Instantly share code, notes, and snippets.

@cjbrown822
Created December 4, 2019 16:27
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 cjbrown822/69020a4c46647b85166624bbbacc43e9 to your computer and use it in GitHub Desktop.
Save cjbrown822/69020a4c46647b85166624bbbacc43e9 to your computer and use it in GitHub Desktop.
Day Offset
const dayOffset = (day, offset) => {
var days = ["Monday", "Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"];
return days[(days.indexOf(day) + offset) % 7];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment