here's the code.
setWeatherForecast(unit: any, scaleTemp: any) {
this.forecast.splice(0, this.forecast.length);
this.weatherService.getLocation().subscribe(data => {
this.lat = JSON.parse(data['_body']).latitude;
this.lon = JSON.parse(data['_body']).longitude;
this.weatherService
.fiveDayForecast(this.lat, this.lon, unit)
.subscribe(forecastData => {
for (let i = 0; i < forecastData.list.length; i = i + 8) {
console.log(forecastData.list[i]);
const forecastWeather = new Forecast(
forecastData.city.name,
forecastData.list[i].weather[0].description,
forecastData.list[i].main.temp.toFixed(0) + scaleTemp,
forecastData.list[i].dt_txt.replace(/\s/, 'T'),
forecastData.list[i].weather[0].icon
);
this.forecast.push(forecastWeather);
}
return this.forecast;
});
});
}
what I want is to remove the first weather in weather forecast. for example.
friday, saturday, sunday, monday, tuesday, wednesday
it will remove the saturday. it only display the sunday to tuesday.