build/ical.js
function(time) {
      if (!this.rangeExceptions.length) {
        return null;
      }

      var utc = time.toUnixTime();
      var idx = ICAL.helpers.binsearchInsert(
        this.rangeExceptions,
        [utc],
        compareRangeException
      );

      idx -= 1;

      // occurs before
      if (idx < 0) {
        return null;
      }

      var rangeItem = this.rangeExceptions[idx];

      /* istanbul ignore next: sanity check only */
      if (utc < rangeItem[0]) {
        return null;
      }

      return rangeItem[1];
    }
function(time) {
      if (!this.rangeExceptions.length) {
        return null;
      }

      var utc = time.toUnixTime();
      var idx = ICAL.helpers.binsearchInsert(
        this.rangeExceptions,
        [utc],
        compareRangeException
      );

      idx -= 1;

      // occurs before
      if (idx < 0) {
        return null;
      }

      var rangeItem = this.rangeExceptions[idx];

      /* istanbul ignore next: sanity check only */
      if (utc < rangeItem[0]) {
        return null;
      }

      return rangeItem[1];
    }
function ( time ) { if ( ! this . rangeExceptions . length ) { return null ; } var utc = time . toUnixTime ( ) ; var idx = ICAL . helpers . binsearchInsert ( this . rangeExceptions , [ utc ] , compareRangeException ) ; idx -= 1 ; // occurs before if ( idx < 0 ) { return null ; } var rangeItem = this . rangeExceptions [ idx ] ; /* istanbul ignore next: sanity check only */ if ( utc < rangeItem [ 0 ] ) { return null ; } return rangeItem [ 1 ] ; }
Finds the range exception nearest to the given date.

@param {ICAL.Time} time usually an occurrence time of an event
@return {?ICAL.Event} the related event/exception or null
Finds the range exception nearest to the given date .