public static void upto(Date self,Date to,Closure closure){
  if (self.compareTo(to) <= 0) {
    for (Date i=(Date)self.clone(); i.compareTo(to) <= 0; i=next(i)) {
      closure.call(i);
    }
  }
 else   throw new GroovyRuntimeException("The argument (" + to + ") to upto() cannot be earlier than the value ("+ self+ ") it's called on.");
}

public static void upto ( Date self , Date to , Closure closure ) { if ( self . compareTo ( to ) <= 0 ) { for ( Date i = ( Date ) self . clone ( ) ; i . compareTo ( to ) <= 0 ; i = next ( i ) ) { closure . call ( i ) ; } } else throw new GroovyRuntimeException ( "The argument (" + to + ") to upto() cannot be earlier than the value (" + self + ") it's called on." ) ; }
iterates from this date up to the given date , inclusive , incrementing by one day each time .
