build/ical.js
function(component) {
      this.ruleIterators = [];

      this.last = this.dtstart.clone();

      // to provide api consistency non-recurring
      // events can also use the iterator though it will
      // only return a single time.
      if (!isRecurringComponent(component)) {
        this.ruleDate = this.last.clone();
        this.complete = true;
        return;
      }

      if (component.hasProperty('rdate')) {
        this.ruleDates = this._extractDates(component, 'rdate');

        // special hack for cases where first rdate is prior
        // to the start date. We only check for the first rdate.
        // This is mostly for google's crazy recurring date logic
        // (contacts birthdays).
        if ((this.ruleDates[0]) &&
            (this.ruleDates[0].compare(this.dtstart) < 0)) {

          this.ruleDateInc = 0;
          this.last = this.ruleDates[0].clone();
        } else {
          this.ruleDateInc = ICAL.helpers.binsearchInsert(
            this.ruleDates,
            this.last,
            compareTime
          );
        }

        this.ruleDate = this.ruleDates[this.ruleDateInc];
      }

      if (component.hasProperty('rrule')) {
        var rules = component.getAllProperties('rrule');
        var i = 0;
        var len = rules.length;

        var rule;
        var iter;

        for (; i < len; i++) {
          rule = rules[i].getFirstValue();
          iter = rule.iterator(this.dtstart);
          this.ruleIterators.push(iter);

          // increment to the next occurrence so future
          // calls to next return times beyond the initial iteration.
          // XXX: I find this suspicious might be a bug?
          iter.next();
        }
      }

      if (component.hasProperty('exdate')) {
        this.exDates = this._extractDates(component, 'exdate');
        // if we have a .last day we increment the index to beyond it.
        this.exDateInc = ICAL.helpers.binsearchInsert(
          this.exDates,
          this.last,
          compareTime
        );

        this.exDate = this.exDates[this.exDateInc];
      }
    }
function(component) {
      this.ruleIterators = [];

      this.last = this.dtstart.clone();

      // to provide api consistency non-recurring
      // events can also use the iterator though it will
      // only return a single time.
      if (!isRecurringComponent(component)) {
        this.ruleDate = this.last.clone();
        this.complete = true;
        return;
      }

      if (component.hasProperty('rdate')) {
        this.ruleDates = this._extractDates(component, 'rdate');

        // special hack for cases where first rdate is prior
        // to the start date. We only check for the first rdate.
        // This is mostly for google's crazy recurring date logic
        // (contacts birthdays).
        if ((this.ruleDates[0]) &&
            (this.ruleDates[0].compare(this.dtstart) < 0)) {

          this.ruleDateInc = 0;
          this.last = this.ruleDates[0].clone();
        } else {
          this.ruleDateInc = ICAL.helpers.binsearchInsert(
            this.ruleDates,
            this.last,
            compareTime
          );
        }

        this.ruleDate = this.ruleDates[this.ruleDateInc];
      }

      if (component.hasProperty('rrule')) {
        var rules = component.getAllProperties('rrule');
        var i = 0;
        var len = rules.length;

        var rule;
        var iter;

        for (; i < len; i++) {
          rule = rules[i].getFirstValue();
          iter = rule.iterator(this.dtstart);
          this.ruleIterators.push(iter);

          // increment to the next occurrence so future
          // calls to next return times beyond the initial iteration.
          // XXX: I find this suspicious might be a bug?
          iter.next();
        }
      }

      if (component.hasProperty('exdate')) {
        this.exDates = this._extractDates(component, 'exdate');
        // if we have a .last day we increment the index to beyond it.
        this.exDateInc = ICAL.helpers.binsearchInsert(
          this.exDates,
          this.last,
          compareTime
        );

        this.exDate = this.exDates[this.exDateInc];
      }
    }
function ( component ) { this . ruleIterators = [ ] ; this . last = this . dtstart . clone ( ) ; // to provide api consistency non-recurring // events can also use the iterator though it will // only return a single time. if ( ! isRecurringComponent ( component ) ) { this . ruleDate = this . last . clone ( ) ; this . complete = true ; return ; } if ( component . hasProperty ( 'rdate' ) ) { this . ruleDates = this . _extractDates ( component , 'rdate' ) ; // special hack for cases where first rdate is prior // to the start date. We only check for the first rdate. // This is mostly for google's crazy recurring date logic // (contacts birthdays). if ( ( this . ruleDates [ 0 ] ) && ( this . ruleDates [ 0 ] . compare ( this . dtstart ) < 0 ) ) { this . ruleDateInc = 0 ; this . last = this . ruleDates [ 0 ] . clone ( ) ; } else { this . ruleDateInc = ICAL . helpers . binsearchInsert ( this . ruleDates , this . last , compareTime ) ; } this . ruleDate = this . ruleDates [ this . ruleDateInc ] ; } if ( component . hasProperty ( 'rrule' ) ) { var rules = component . getAllProperties ( 'rrule' ) ; var i = 0 ; var len = rules . length ; var rule ; var iter ; for ( ; i < len ; i ++ ) { rule = rules [ i ] . getFirstValue ( ) ; iter = rule . iterator ( this . dtstart ) ; this . ruleIterators . push ( iter ) ; // increment to the next occurrence so future // calls to next return times beyond the initial iteration. // XXX: I find this suspicious might be a bug? iter . next ( ) ; } } if ( component . hasProperty ( 'exdate' ) ) { this . exDates = this . _extractDates ( component , 'exdate' ) ; // if we have a .last day we increment the index to beyond it. this . exDateInc = ICAL . helpers . binsearchInsert ( this . exDates , this . last , compareTime ) ; this . exDate = this . exDates [ this . exDateInc ] ; } }
Initialize the recurrence expansion.

@private
@param {ICAL.Component} component    The component to initialize from.
Initialize the recurrence expansion .