Simple weather only in farenheit ? #226

Open
vimorozov opened this Issue Mar 24, 2016 · 8 comments

Projects

None yet

7 participants

@vimorozov

Hi, any idea why simple weather only display the weather in farenheit ?

@woosungchu

Yahoo has made some changes to their API . So I guess that is temporary solution.

@biapar
biapar commented Mar 25, 2016

+1

@KibGim
KibGim commented Mar 25, 2016

+1

@biapar
biapar commented Mar 25, 2016

The yahoo api work now on public url.

@biapar
biapar commented Mar 25, 2016

Simple workaround

Unit=c
temp = F temperature
function getMyAltTemp(unit, temp) { if(unit === 'c') { return Math.round((5.0/9.0)*(temp-32.0)); } else { return Math.round((9.0/5.0)*temp+32.0); } }

@maninderx

Celsius also not displaying for my WOEID

@carrillo455

As the bug is only displaying Farenheit, I came to this solution:

// Based on @biapar answer (y)
var getCelsius = function (temp) {
    return Math.round((5.0/9.0)*(temp-32.0));
};

var isFarenheitBug = weather.units.temp === "F";
if (isFarenheitBug) {
    weather.temp = getCelsius(parseInt(weather.temp));
    weather.units.temp = "C";
}

Hope its useful :)

@sleddogrob

Celsius seems to be working with the exception of "wind chill" ( feels like ). I really hate asking but I don't suppose someone could point methe right direction for a work around for this? Been banging my head for a few days now on this one with no luck .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment