index.js
function() {
    const startDate = moment.utc(this.getFirstDateInPayload());
    const baseDate = startDate.clone().set('hour', 12).startOf('hour');
    let firstDate = baseDate.clone();

    log(`five day summary is using ${baseDate.toString()} as a starting point`);

    /* istanbul ignore else  */
    if (firstDate.isBefore(startDate)) {
      // first date is unique since we may not have data back to midday so instead we
      // go with the earliest available
      firstDate = startDate.clone();
    }

    log(`getting five day summary starting with ${firstDate.toISOString()}`);

    return Promise.all([
      this.getForecastForTime(firstDate),
      this.getForecastForTime(baseDate.clone().add(1, 'days')),
      this.getForecastForTime(baseDate.clone().add(2, 'days')),
      this.getForecastForTime(baseDate.clone().add(3, 'days')),
      this.getForecastForTime(baseDate.clone().add(4, 'days'))
    ])
      .then(function (results) {
        // Return a single array of objects
        return Array.prototype.concat.apply([], results);
      });
  }
function() {
    const startDate = moment.utc(this.getFirstDateInPayload());
    const baseDate = startDate.clone().set('hour', 12).startOf('hour');
    let firstDate = baseDate.clone();

    log(`five day summary is using ${baseDate.toString()} as a starting point`);

    /* istanbul ignore else  */
    if (firstDate.isBefore(startDate)) {
      // first date is unique since we may not have data back to midday so instead we
      // go with the earliest available
      firstDate = startDate.clone();
    }

    log(`getting five day summary starting with ${firstDate.toISOString()}`);

    return Promise.all([
      this.getForecastForTime(firstDate),
      this.getForecastForTime(baseDate.clone().add(1, 'days')),
      this.getForecastForTime(baseDate.clone().add(2, 'days')),
      this.getForecastForTime(baseDate.clone().add(3, 'days')),
      this.getForecastForTime(baseDate.clone().add(4, 'days'))
    ])
      .then(function (results) {
        // Return a single array of objects
        return Array.prototype.concat.apply([], results);
      });
  }
function ( ) { const startDate = moment . utc ( this . getFirstDateInPayload ( ) ) ; const baseDate = startDate . clone ( ) . set ( 'hour' , 12 ) . startOf ( 'hour' ) ; let firstDate = baseDate . clone ( ) ; log ( ` ${ baseDate . toString ( ) } ` ) ; /* istanbul ignore else  */ if ( firstDate . isBefore ( startDate ) ) { // first date is unique since we may not have data back to midday so instead we // go with the earliest available firstDate = startDate . clone ( ) ; } log ( ` ${ firstDate . toISOString ( ) } ` ) ; return Promise . all ( [ this . getForecastForTime ( firstDate ) , this . getForecastForTime ( baseDate . clone ( ) . add ( 1 , 'days' ) ) , this . getForecastForTime ( baseDate . clone ( ) . add ( 2 , 'days' ) ) , this . getForecastForTime ( baseDate . clone ( ) . add ( 3 , 'days' ) ) , this . getForecastForTime ( baseDate . clone ( ) . add ( 4 , 'days' ) ) ] ) . then ( function ( results ) { // Return a single array of objects return Array . prototype . concat . apply ( [ ] , results ) ; } ) ; }
Get five day weather.
@param {Function} callback
Get five day weather .