Grails

Iterate through two distinct dates – Groovy 2.2

Hi everyone, Ever wished for a 'groovier' way to iterate through two distinct dates? Well, Groovy 2.2 gives you two methods via the 'DateGroovyMethods' class to do exactly that: upto() and downto(). Here is the code showing the usage: [java] Date startDate = new Date() - 7 Date endDate = new Date() startDate.upto(endDate) { it...

by Abhishek Tejpaul
Tag: Calendar
13-Apr-2014