code: static Generator serialDayGenerator(
              final int interval, final DateValue dtStart) {
          return new Generator() {
              int year, month, date;
              /** ndays in the last month encountered */
              int nDays;
  
              {
                  // step back one interval
                  DTBuilder dtStartMinus1B = new DTBuilder(dtStart);
                  dtStartMinus1B.day -= interval;
                  DateValue dtStartMinus1 = dtStartMinus1B.toDate();
                  year = dtStartMinus1.year();
                  month = dtStartMinus1.month();
                  date = dtStartMinus1.day();
                  nDays = TimeUtils.monthLength(year, month);
              }
  
              @Override
              boolean generate(DTBuilder builder) {
                  int ndate;
                  if (year == builder.year && month == builder.month) {
                      ndate = date + interval;
                      if (ndate > nDays) {
                          return false;
                      }
                  } else {
                      nDays = TimeUtils.monthLength(builder.year, builder.month);
                      if (interval != 1) {
                          // Calculate the number of days between the first of the new
                          // month andthe old date and extend it to make it an integer
                          // multiple of interval
                          int daysBetween = TimeUtils.daysBetween(
                                  new DateValueImpl(builder.year, builder.month, 1),
                                  new DateValueImpl(year, month, date));
                          ndate = ((interval - (daysBetween % interval)) % interval) + 1;
                          if (ndate > nDays) {
                              // need to early out without updating year or month so that the
                              // next time we enter, with a different month, the daysBetween
                              // call above compares against the proper last date
                              return false;
                          }
                      } else {
                          ndate = 1;
                      }
                      year = builder.year;
                      month = builder.month;
                  }
                  date = builder.day = ndate;
                  return true;
              }
  
              @Override
              public String toString() {
                  return "serialDayGenerator:" + interval;
              }
          };
      }
docs: constructs a generator that generates every day in the current month that
  is an integer multiple of interval days from dtStart.