From: Michael J. Rubinsky Date: Sun, 18 Apr 2010 23:45:05 +0000 (-0400) Subject: Fix weatherdotcom timeobjects - parsing back and forth like this is not needed.. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=b63d27cd8dd12abcabf4cd36f10ab9ec8dc32e20;p=horde.git Fix weatherdotcom timeobjects - parsing back and forth like this is not needed.. --- diff --git a/timeobjects/lib/Driver/Weatherdotcom.php b/timeobjects/lib/Driver/Weatherdotcom.php index 4e10cbcda..b2c1184b2 100644 --- a/timeobjects/lib/Driver/Weatherdotcom.php +++ b/timeobjects/lib/Driver/Weatherdotcom.php @@ -48,7 +48,6 @@ class TimeObjects_Driver_Weatherdotcom extends TimeObjects_Driver // Horde to set your current location, maybe with a google // map? } - if ($country != 'US') { $params['units'] = 'metric'; } @@ -180,9 +179,7 @@ class TimeObjects_Driver_Weatherdotcom extends TimeObjects_Driver throw new TimeObjects_Exception($location->getMessage()); } - $date = strptime($forecast['update'], $prefs->getValue('date_format') . ' ' . ($prefs->getValue('twentyFour') ? '%H:%M' : '%I:%M %P')); - $day = new Horde_Date(gmmktime($date['tm_hour'], $date['tm_min'], $date['tm_sec'], $date['tm_mon'] + 1, $date['tm_mday'], $date['tm_year'] + 1900)); - + $day = new Horde_Date($forecast['update']); $objects = array(); foreach ($forecast['days'] as $which => $data) { $day_end = clone $day; @@ -258,7 +255,6 @@ class TimeObjects_Driver_Weatherdotcom extends TimeObjects_Driver $day->mday++; } - return $objects; }