lib/flightstats.js
function( options, callback ) {

    debug( 'route', options )

    var self = this

    var year = options.date.getFullYear()
    var month = options.date.getMonth() + 1
    var day = options.date.getDate()
    var direction = /^dep/i.test( options.direction ) ?
      'dep' : 'arr'

    var url = 'flightstatus/rest/v2/json/route/status/' + options.departureAirport + '/' + options.arrivalAirport +
      '/' + direction + '/' + year + '/' + month + '/' + day

    var extensions = [
      'useInlinedReferences'
    ]

    if( Array.isArray( options.extendedOptions ) ) {
      extensions = extensions.concat( options.extendedOptions )
    }

    return this._clientRequest({
      url: url,
      extendedOptions: extensions,
      qs: {
        maxFlights: options.maxFlights,
        codeType: options.codeType,
        numHours: options.numHours,
        utc: options.utc,
        hourOfDay: options.hourOfDay,
      }
    }, function( error, data ) {
      callback.call( self, error, data )
    })

  }
function( options, callback ) {

    debug( 'route', options )

    var self = this

    var year = options.date.getFullYear()
    var month = options.date.getMonth() + 1
    var day = options.date.getDate()
    var direction = /^dep/i.test( options.direction ) ?
      'dep' : 'arr'

    var url = 'flightstatus/rest/v2/json/route/status/' + options.departureAirport + '/' + options.arrivalAirport +
      '/' + direction + '/' + year + '/' + month + '/' + day

    var extensions = [
      'useInlinedReferences'
    ]

    if( Array.isArray( options.extendedOptions ) ) {
      extensions = extensions.concat( options.extendedOptions )
    }

    return this._clientRequest({
      url: url,
      extendedOptions: extensions,
      qs: {
        maxFlights: options.maxFlights,
        codeType: options.codeType,
        numHours: options.numHours,
        utc: options.utc,
        hourOfDay: options.hourOfDay,
      }
    }, function( error, data ) {
      callback.call( self, error, data )
    })

  }
function ( options , callback ) { debug ( 'route' , options ) var self = this var year = options . date . getFullYear ( ) var month = options . date . getMonth ( ) + 1 var day = options . date . getDate ( ) var direction = / ^dep / i . test ( options . direction ) ? 'dep' : 'arr' var url = 'flightstatus/rest/v2/json/route/status/' + options . departureAirport + '/' + options . arrivalAirport + '/' + direction + '/' + year + '/' + month + '/' + day var extensions = [ 'useInlinedReferences' ] if ( Array . isArray ( options . extendedOptions ) ) { extensions = extensions . concat ( options . extendedOptions ) } return this . _clientRequest ( { url : url , extendedOptions : extensions , qs : { maxFlights : options . maxFlights , codeType : options . codeType , numHours : options . numHours , utc : options . utc , hourOfDay : options . hourOfDay , } } , function ( error , data ) { callback . call ( self , error , data ) } ) }
Get routes between two airports
@param {Object} options
@param {Date} options.date
@param {String} options.departureAirport
@param {String} options.arrivalAirport
@param {String} options.codeType
@param {Number} options.maxFlights
@param {Number} options.numHours
@param {Number} options.hourOfDay
@param {Boolean} options.utc
@param {Array<String>} [options.extendedOptions]
@param {Function} callback
@return {Request}
Get routes between two airports