Loop over Calendar

This is an example with a GregorianCalendar.

def start_date = new GregorianCalendar(1977,3,12)
def end_date = new GregorianCalendar(1977,3,22)
// loop trough the dates
(start_date.getTime()..end_date.getTime()).each() { date ->
println date.toString()
}

Which will print out:

Tue Apr 12 00:00:00 CET 1977
Wed Apr 13 00:00:00 CET 1977
Thu Apr 14 00:00:00 CET 1977
Fri Apr 15 00:00:00 CET 1977
Sat Apr 16 00:00:00 CET 1977
Sun Apr 17 00:00:00 CET 1977
Mon Apr 18 00:00:00 CET 1977
Tue Apr 19 00:00:00 CET 1977
Wed Apr 20 00:00:00 CET 1977
Thu Apr 21 00:00:00 CET 1977
Fri Apr 22 00:00:00 CET 1977