I try to iterate over dates from start to finish every week. I am currently writing the following code.
def current=startDate while (current <= endDate) { log.debug "Week: ${current}" current=current+7 }
Is there a more expensive way?
Given that you have two dates startDateand endDatethis should complete the task:
startDate
endDate
(startDate..endDate).step(7) { println it }
groovier, right?