Skip to content

Instantly share code, notes, and snippets.

@bdkosher
Created November 22, 2013 18:47
Show Gist options
  • Save bdkosher/7604890 to your computer and use it in GitHub Desktop.
Save bdkosher/7604890 to your computer and use it in GitHub Desktop.
// We can loop from today to next week and invoke a closure for each day.
def today = new Date().clearTime()
def nextWeek = today + 7
today.upto(nextWeek) {
// Print day of the week.
println it.format('EEEE')
}
println()
nextweek.downto(today) {
prinltn it.format('EEEE')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment