build/ical.js
function() {
      var iter;
      var ruleOfDay;
      var next;
      var compare;

      var maxTries = 500;
      var currentTry = 0;

      while (true) {
        if (currentTry++ > maxTries) {
          throw new Error(
            'max tries have occured, rule may be impossible to forfill.'
          );
        }

        next = this.ruleDate;
        iter = this._nextRecurrenceIter(this.last);

        // no more matches
        // because we increment the rule day or rule
        // _after_ we choose a value this should be
        // the only spot where we need to worry about the
        // end of events.
        if (!next && !iter) {
          // there are no more iterators or rdates
          this.complete = true;
          break;
        }

        // no next rule day or recurrence rule is first.
        if (!next || (iter && next.compare(iter.last) > 0)) {
          // must be cloned, recur will reuse the time element.
          next = iter.last.clone();
          // move to next so we can continue
          iter.next();
        }

        // if the ruleDate is still next increment it.
        if (this.ruleDate === next) {
          this._nextRuleDay();
        }

        this.last = next;

        // check the negative rules
        if (this.exDate) {
          compare = this.exDate.compare(this.last);

          if (compare < 0) {
            this._nextExDay();
          }

          // if the current rule is excluded skip it.
          if (compare === 0) {
            this._nextExDay();
            continue;
          }
        }

        //XXX: The spec states that after we resolve the final
        //     list of dates we execute exdate this seems somewhat counter
        //     intuitive to what I have seen most servers do so for now
        //     I exclude based on the original date not the one that may
        //     have been modified by the exception.
        return this.last;
      }
    }
function() {
      var iter;
      var ruleOfDay;
      var next;
      var compare;

      var maxTries = 500;
      var currentTry = 0;

      while (true) {
        if (currentTry++ > maxTries) {
          throw new Error(
            'max tries have occured, rule may be impossible to forfill.'
          );
        }

        next = this.ruleDate;
        iter = this._nextRecurrenceIter(this.last);

        // no more matches
        // because we increment the rule day or rule
        // _after_ we choose a value this should be
        // the only spot where we need to worry about the
        // end of events.
        if (!next && !iter) {
          // there are no more iterators or rdates
          this.complete = true;
          break;
        }

        // no next rule day or recurrence rule is first.
        if (!next || (iter && next.compare(iter.last) > 0)) {
          // must be cloned, recur will reuse the time element.
          next = iter.last.clone();
          // move to next so we can continue
          iter.next();
        }

        // if the ruleDate is still next increment it.
        if (this.ruleDate === next) {
          this._nextRuleDay();
        }

        this.last = next;

        // check the negative rules
        if (this.exDate) {
          compare = this.exDate.compare(this.last);

          if (compare < 0) {
            this._nextExDay();
          }

          // if the current rule is excluded skip it.
          if (compare === 0) {
            this._nextExDay();
            continue;
          }
        }

        //XXX: The spec states that after we resolve the final
        //     list of dates we execute exdate this seems somewhat counter
        //     intuitive to what I have seen most servers do so for now
        //     I exclude based on the original date not the one that may
        //     have been modified by the exception.
        return this.last;
      }
    }
function ( ) { var iter ; var ruleOfDay ; var next ; var compare ; var maxTries = 500 ; var currentTry = 0 ; while ( true ) { if ( currentTry ++ > maxTries ) { throw new Error ( 'max tries have occured, rule may be impossible to forfill.' ) ; } next = this . ruleDate ; iter = this . _nextRecurrenceIter ( this . last ) ; // no more matches // because we increment the rule day or rule // _after_ we choose a value this should be // the only spot where we need to worry about the // end of events. if ( ! next && ! iter ) { // there are no more iterators or rdates this . complete = true ; break ; } // no next rule day or recurrence rule is first. if ( ! next || ( iter && next . compare ( iter . last ) > 0 ) ) { // must be cloned, recur will reuse the time element. next = iter . last . clone ( ) ; // move to next so we can continue iter . next ( ) ; } // if the ruleDate is still next increment it. if ( this . ruleDate === next ) { this . _nextRuleDay ( ) ; } this . last = next ; // check the negative rules if ( this . exDate ) { compare = this . exDate . compare ( this . last ) ; if ( compare < 0 ) { this . _nextExDay ( ) ; } // if the current rule is excluded skip it. if ( compare === 0 ) { this . _nextExDay ( ) ; continue ; } } //XXX: The spec states that after we resolve the final //     list of dates we execute exdate this seems somewhat counter //     intuitive to what I have seen most servers do so for now //     I exclude based on the original date not the one that may //     have been modified by the exception. return this . last ; } }
Retrieve the next occurrence in the series.
@return {ICAL.Time}
Retrieve the next occurrence in the series .