code: function icalrecur_iterator_next() {
        var before = (this.last ? this.last.clone() : null);
  
        if ((this.rule.count && this.occurrence_number >= this.rule.count) ||
            (this.rule.until && this.last.compare(this.rule.until) > 0)) {
  
          //XXX: right now this is just a flag and has no impact
          //     we can simplify the above case to check for completed later.
          this.completed = true;
  
          return null;
        }
  
        if (this.occurrence_number == 0 && this.last.compare(this.dtstart) >= 0) {
          // First of all, give the instance that was initialized
          this.occurrence_number++;
          return this.last;
        }
  
  
        var valid;
        do {
          valid = 1;
  
          switch (this.rule.freq) {
          case "SECONDLY":
            this.next_second();
            break;
          case "MINUTELY":
            this.next_minute();
            break;
          case "HOURLY":
            this.next_hour();
            break;
          case "DAILY":
            this.next_day();
            break;
          case "WEEKLY":
            this.next_week();
            break;
          case "MONTHLY":
            valid = this.next_month();
            break;
          case "YEARLY":
            this.next_year();
            break;
  
          default:
            return null;
          }
        } while (!this.check_contracting_rules() ||
                 this.last.compare(this.dtstart) < 0 ||
                 !valid);
  
        // TODO is this valid?
        if (this.last.compare(before) == 0) {
          throw new Error("Same occurrence found twice, protecting " +
                          "you from death by recursion");
        }
  
        if (this.rule.until && this.last.compare(this.rule.until) > 0) {
          this.completed = true;
          return null;
        } else {
          this.occurrence_number++;
          return this.last;
        }
      }
docs: Retrieve the next occurrence from the iterator.
  @return {ICAL.Time}