Skip to content

Commit bd4d68b

Browse files
committed
Removed not-so-forecast measure
Because it won't happen again
1 parent a15fd88 commit bd4d68b

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

Cmfcmf/OpenWeatherMap/WeatherForecast.php

-8
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,8 @@ public function __construct($xml, $units, $days)
7878
$this->sun = new Sun(new \DateTime($xml->sun['rise'], $utctz), new \DateTime($xml->sun['set'], $utctz));
7979
$this->lastUpdate = new \DateTime($xml->meta->lastupdate, $utctz);
8080

81-
$today = new \DateTime('now', $utctz);
82-
$today->setTime(0, 0, 0);
8381
$counter = 0;
8482
foreach ($xml->forecast->time as $time) {
85-
$date = new \DateTime(isset($time['day']) ? $time['day'] : $time['to'], $utctz);
86-
if ($date < $today) {
87-
// Sometimes OpenWeatherMap returns results which aren't real
88-
// forecasts. The best we can do is to ignore them.
89-
continue;
90-
}
9183
$forecast = new Forecast($time, $units);
9284
$forecast->city = $this->city;
9385
$forecast->sun = $this->sun;

0 commit comments

Comments
 (0)