barometer icon indicating copy to clipboard operation
barometer copied to clipboard

Fix zone offset parsing

Open avit opened this issue 7 years ago • 0 comments

We were seeing errors from Weather Underground for certain locations where a time zone name was not being returned, and Barometer was unable to parse the offset value. It looks like the zone data parsing was tested under the assumption that it expects a numeric value, when in fact it receives a string value.

This change teaches the zone data to parse standard offset strings of +HH or +HHMM.

The original implementation was treating numeric values as hours, and this assumption still remains when passing integer types. This means "1200" and 1200 are understood differently as 12 hours vs. 1200 hours, respectively.

avit avatar Aug 08 '17 06:08 avit