Created
January 12, 2014 22:11
-
-
Save robpurcell/8391335 to your computer and use it in GitHub Desktop.
Iterate through days in a Joda-Time Interval using Groovy
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
DateTime.metaClass.next << { -> delegate.plusDays(1) } | |
Interval interval = ... | |
def start = interval.start | |
def finish = interval.end | |
for (day in start..finish) { | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment