This commit is contained in:
Jasper 2025-11-08 21:26:26 +00:00 committed by GitHub
commit cfd4ef264d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 6 deletions

View file

@ -57,7 +57,8 @@ export default {
}, },
endpoint() { endpoint() {
const { apiKey, city } = this.options; const { apiKey, city } = this.options;
const params = `?q=${city}&cnt=${this.numDays}&units=${this.units}&appid=${apiKey}`; const count = this.numDays * 8;
const params = `?q=${city}&cnt=${count}&units=${this.units}&appid=${apiKey}`;
return `${widgetApiEndpoints.weatherForecast}${params}`; return `${widgetApiEndpoints.weatherForecast}${params}`;
}, },
tempDisplayUnits() { tempDisplayUnits() {
@ -92,9 +93,12 @@ export default {
/* Process the results from the Axios request */ /* Process the results from the Axios request */
processData(dataList) { processData(dataList) {
const uiWeatherData = []; const uiWeatherData = [];
dataList.list.forEach((day, index) => {
const step = 8;
for (let i = 1; i < dataList.list.length; i += step) {
const day = dataList.list[i];
uiWeatherData.push({ uiWeatherData.push({
index, index: i,
date: this.dateFromStamp(day.dt), date: this.dateFromStamp(day.dt),
icon: day.weather[0].icon, icon: day.weather[0].icon,
main: day.weather[0].main, main: day.weather[0].main,
@ -102,7 +106,7 @@ export default {
temp: this.processTemp(day.main.temp), temp: this.processTemp(day.main.temp),
info: this.makeWeatherData(day), info: this.makeWeatherData(day),
}); });
}); }
this.weatherData = uiWeatherData; this.weatherData = uiWeatherData;
}, },
/* Process additional data, needed when user clicks a given day */ /* Process additional data, needed when user clicks a given day */

View file

@ -1889,7 +1889,7 @@ html[data-theme='neomorphic'] {
div.edit-mode-bottom-banner, .add-new-section { div.edit-mode-bottom-banner, .add-new-section {
background: rgba(255, 255, 255, 0.15); background: rgba(255, 255, 255, 0.15);
backdrop-filter: blur(50px); //backdrop-filter: blur(50px);
} }
.critical-error-wrap { .critical-error-wrap {