Add today to forecast tab
This commit is contained in:
parent
f9916d8464
commit
4513b4d824
@ -191,12 +191,12 @@ function loadWeather(reload) {
|
|||||||
//
|
//
|
||||||
forecastItems = [];
|
forecastItems = [];
|
||||||
|
|
||||||
for (var i = 1; i < resp.forecast.length; i++) {
|
for (var i = 0; i < resp.forecast.length; i++) {
|
||||||
var low = (getStorage("units") == "metric" ? Math.round(ftoc(resp.forecast[i].temp.min)) : Math.round(resp.forecast[i].temp.min));
|
var low = (getStorage("units") == "metric" ? Math.round(ftoc(resp.forecast[i].temp.min)) : Math.round(resp.forecast[i].temp.min));
|
||||||
var high = (getStorage("units") == "metric" ? Math.round(ftoc(resp.forecast[i].temp.max)) + " °C" : Math.round(resp.forecast[i].temp.max) + " °F");
|
var high = (getStorage("units") == "metric" ? Math.round(ftoc(resp.forecast[i].temp.max)) + " °C" : Math.round(resp.forecast[i].temp.max) + " °F");
|
||||||
var precipcolor = precipChanceToColor(resp.forecast[i].precipitation.chance);
|
var precipcolor = precipChanceToColor(resp.forecast[i].precipitation.chance);
|
||||||
forecastItems.push({
|
forecastItems.push({
|
||||||
day: formatTimestamp('l', resp.forecast[i].date),
|
day: (i == 0 ? "Today" : formatTimestamp('l', resp.forecast[i].date)),
|
||||||
temps: low + " to " + high,
|
temps: low + " to " + high,
|
||||||
uv_index: resp.forecast[i].uv_index,
|
uv_index: resp.forecast[i].uv_index,
|
||||||
uv_color: uvIndexToColor(resp.forecast[i].uv_index),
|
uv_color: uvIndexToColor(resp.forecast[i].uv_index),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user