build/ical.js
function() {
      var iters = this.ruleIterators;

      if (iters.length === 0) {
        return null;
      }

      var len = iters.length;
      var iter;
      var iterTime;
      var iterIdx = 0;
      var chosenIter;

      // loop through each iterator
      for (; iterIdx < len; iterIdx++) {
        iter = iters[iterIdx];
        iterTime = iter.last;

        // if iteration is complete
        // then we must exclude it from
        // the search and remove it.
        if (iter.completed) {
          len--;
          if (iterIdx !== 0) {
            iterIdx--;
          }
          iters.splice(iterIdx, 1);
          continue;
        }

        // find the most recent possible choice
        if (!chosenIter || chosenIter.last.compare(iterTime) > 0) {
          // that iterator is saved
          chosenIter = iter;
        }
      }

      // the chosen iterator is returned but not mutated
      // this iterator contains the most recent event.
      return chosenIter;
    }
function() {
      var iters = this.ruleIterators;

      if (iters.length === 0) {
        return null;
      }

      var len = iters.length;
      var iter;
      var iterTime;
      var iterIdx = 0;
      var chosenIter;

      // loop through each iterator
      for (; iterIdx < len; iterIdx++) {
        iter = iters[iterIdx];
        iterTime = iter.last;

        // if iteration is complete
        // then we must exclude it from
        // the search and remove it.
        if (iter.completed) {
          len--;
          if (iterIdx !== 0) {
            iterIdx--;
          }
          iters.splice(iterIdx, 1);
          continue;
        }

        // find the most recent possible choice
        if (!chosenIter || chosenIter.last.compare(iterTime) > 0) {
          // that iterator is saved
          chosenIter = iter;
        }
      }

      // the chosen iterator is returned but not mutated
      // this iterator contains the most recent event.
      return chosenIter;
    }
function ( ) { var iters = this . ruleIterators ; if ( iters . length === 0 ) { return null ; } var len = iters . length ; var iter ; var iterTime ; var iterIdx = 0 ; var chosenIter ; // loop through each iterator for ( ; iterIdx < len ; iterIdx ++ ) { iter = iters [ iterIdx ] ; iterTime = iter . last ; // if iteration is complete // then we must exclude it from // the search and remove it. if ( iter . completed ) { len -- ; if ( iterIdx !== 0 ) { iterIdx -- ; } iters . splice ( iterIdx , 1 ) ; continue ; } // find the most recent possible choice if ( ! chosenIter || chosenIter . last . compare ( iterTime ) > 0 ) { // that iterator is saved chosenIter = iter ; } } // the chosen iterator is returned but not mutated // this iterator contains the most recent event. return chosenIter ; }
Find and return the recurrence rule with the most recent event and
return it.

@private
@return {?ICAL.RecurIterator}    Found iterator.
Find and return the recurrence rule with the most recent event and return it .