Skip to content

Commit

Permalink
[jan] Calculate time of last condition update more precisely.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Apr 18, 2016
1 parent 1007405 commit 47b4230
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion framework/Service_Weather/lib/Horde/Service/Weather/Wwo.php
Expand Up @@ -238,7 +238,11 @@ protected function _getCommonElements($location, $length = Horde_Service_Weather

// Hack some data to allow UTC observation time to be returned.
$results->data->current_condition[0]->date = new Horde_Date($results->data->current_condition[0]->localObsDateTime);
$results->data->current_condition[0]->date->hour += -$station->getOffset();
if (preg_match('/^(\+|-)?(\d{2}):(\d{2})/', $station->getOffset(), $match)) {
$factor = $match[1] == '-' ? -1 : 1;
$results->data->current_condition[0]->date->hour += $factor * $match[2];
$results->data->current_condition[0]->date->min += $factor * $match[3];
}

// Parse it.
$this->_current = $this->_parseCurrent($results->data->current_condition);
Expand Down
4 changes: 2 additions & 2 deletions framework/Service_Weather/package.xml
Expand Up @@ -21,7 +21,7 @@
</stability>
<license uri="http://www.horde.org/licenses/bsd">BSD-2-Clause</license>
<notes>
*
* [jan] Calculate time of last condition update more precisely.
</notes>
<contents>
<dir baseinstalldir="/" name="/">
Expand Down Expand Up @@ -915,7 +915,7 @@
<date>2016-03-16</date>
<license uri="http://www.horde.org/licenses/bsd">BSD-2-Clause</license>
<notes>
*
* [jan] Calculate time of last condition update more precisely.
</notes>
</release>
</changelog>
Expand Down

0 comments on commit 47b4230

Please sign in to comment.