parent
001d1763dd
commit
a4d028f63e
|
|
@ -102,13 +102,12 @@ function draw() {
|
||||||
clockLayout.dow.label = locale.dow(date, 1).toUpperCase() + " ";
|
clockLayout.dow.label = locale.dow(date, 1).toUpperCase() + " ";
|
||||||
var weatherJson = getWeather();
|
var weatherJson = getWeather();
|
||||||
if(weatherJson && weatherJson.weather){
|
if(weatherJson && weatherJson.weather){
|
||||||
var currentWeather = weatherJson.weather;
|
var currentWeather = weatherJson.weather;
|
||||||
const temp = locale.temp(currentWeather.temp-273.15).match(/^(\D*\d*)(.*)$/);
|
const temp = locale.temp(currentWeather.temp-273.15).match(/^(\D*\d*)(.*)$/);
|
||||||
clockLayout.temp.label = temp[1] + " " + temp[2];
|
clockLayout.temp.label = temp[1] + " " + temp[2];
|
||||||
clockLayout.weatherIcon.src = chooseIcon(currentWeather.txt);
|
clockLayout.weatherIcon.src = chooseIcon(currentWeather.txt);
|
||||||
const wind = locale.speed(currentWeather.wind).match(/^(\D*\d*)(.*)$/);
|
const wind = locale.speed(currentWeather.wind).match(/^(\D*\d*)(.*)$/);
|
||||||
clockLayout.wind.label = wind[1] + " " + wind[2] + " " + (currentWeather.wrose||'').toUpperCase();
|
clockLayout.wind.label = wind[1] + " " + wind[2] + " " + (currentWeather.wrose||'').toUpperCase();
|
||||||
var currentWeather = weatherJson.weather;
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
clockLayout.temp.label = "Err";
|
clockLayout.temp.label = "Err";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue