def dates(date_range, limit=0)
    result = []
    date_range.each do |date|
      result << date if self.include? date
      if limit > 0 and result.size == limit
        break
      end
    end
    result
  end
def dates(date_range, limit=0)
    result = []
    date_range.each do |date|
      result << date if self.include? date
      if limit > 0 and result.size == limit
        break
      end
    end
    result
  end
Contributed by Emmett Shear:
 Returns an Array of Date-like objects which occur within the supplied
 DateRange.  Will stop calculating dates once a number of dates equal
 to the optional attribute limit are found. (A limit of zero will collect
 all matching dates in the date range.)