Created
June 8, 2016 15:46
-
-
Save Viroide/ae7d611c0ba4b7b328f166e24dcb3044 to your computer and use it in GitHub Desktop.
returns the current week
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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