diff --git a/Cmfcmf/OpenWeatherMap/WeatherForecast.php b/Cmfcmf/OpenWeatherMap/WeatherForecast.php index 2fc6a6c..9264ea9 100644 --- a/Cmfcmf/OpenWeatherMap/WeatherForecast.php +++ b/Cmfcmf/OpenWeatherMap/WeatherForecast.php @@ -78,16 +78,8 @@ public function __construct($xml, $units, $days) $this->sun = new Sun(new \DateTime($xml->sun['rise'], $utctz), new \DateTime($xml->sun['set'], $utctz)); $this->lastUpdate = new \DateTime($xml->meta->lastupdate, $utctz); - $today = new \DateTime('now', $utctz); - $today->setTime(0, 0, 0); $counter = 0; foreach ($xml->forecast->time as $time) { - $date = new \DateTime(isset($time['day']) ? $time['day'] : $time['to'], $utctz); - if ($date < $today) { - // Sometimes OpenWeatherMap returns results which aren't real - // forecasts. The best we can do is to ignore them. - continue; - } $forecast = new Forecast($time, $units); $forecast->city = $this->city; $forecast->sun = $this->sun; diff --git a/tests/FakeData.php b/tests/FakeData.php index c6bd1d1..2890b39 100644 --- a/tests/FakeData.php +++ b/tests/FakeData.php @@ -65,7 +65,7 @@ public static function forecastXML() -