Skip to content

Instantly share code, notes, and snippets.

@Viroide
Created June 8, 2016 15:46
Show Gist options
  • Select an option

  • Save Viroide/ae7d611c0ba4b7b328f166e24dcb3044 to your computer and use it in GitHub Desktop.

Select an option

Save Viroide/ae7d611c0ba4b7b328f166e24dcb3044 to your computer and use it in GitHub Desktop.
returns the current week
def private static currentWeek() {
def current = new Date().clearTime()
int currentDay = Calendar.instance.with {
time = current
get(DAY_OF_WEEK)
}
def listOfDays = (current - currentDay + 2)..(current - currentDay + 8)
listOfDays.collect {
"date" : it.format("yyyyMMdd")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment