From b63d27cd8dd12abcabf4cd36f10ab9ec8dc32e20 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Sun, 18 Apr 2010 19:45:05 -0400 Subject: [PATCH] Fix weatherdotcom timeobjects - parsing back and forth like this is not needed.. --- timeobjects/lib/Driver/Weatherdotcom.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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; } -- 2.11.0