gitignore .vscode

This commit is contained in:
2023-09-25 18:09:13 +02:00
parent 99202436c0
commit cfe07d0dde
3 changed files with 35 additions and 31 deletions

2
.gitignore vendored
View File

@@ -27,3 +27,5 @@ yarn-error.log*
*.ntvs*
*.njsproj
*.sln
.vscode/

16
.vscode/settings.json vendored
View File

@@ -3,13 +3,9 @@
"editor.guides.bracketPairs": true,
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": [
"source.fixAll.eslint"
],
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"vue"
]
}
"editor.codeActionsOnSave": ["source.fixAll.eslint"],
"eslint.validate": ["javascript", "javascriptreact", "typescript", "vue"],
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}

View File

@@ -1,7 +1,13 @@
<template>
<div class="flex flex-center">
<h5 class="q-py-xl">{{ fecha }}</h5>
<q-btn class="fixed-center" color="deep-orange" glossy label="Calcular" @click="calcular()"></q-btn>
<q-btn
class="fixed-center"
color="deep-orange"
glossy
label="Calcular"
@click="calcular()"
></q-btn>
</div>
</template>
@@ -13,27 +19,27 @@ const data = ref([]);
const fecha = ref("");
const days = ref(0);
const calcular =async () => {
const result = fetch(
"https://api.openweathermap.org/data/2.5/forecast?lat=39.55&lon=-0.5667&units=metric&appid=1ce95ef35a6852cecee421a923fe4400"
)
.then((response) => {
console.log(response);
return response.json();
})
.catch((err) => console.error(err));
data.value = await result;
console.log(data.value.list);
let temp = 0;
const calcular = async () => {
const result = fetch(
"https://api.openweathermap.org/data/2.5/forecast?lat=39.55&lon=-0.5667&units=metric&appid=1ce95ef35a6852cecee421a923fe4400"
)
.then((response) => {
console.log(response);
return response.json();
})
.catch((err) => console.error(err));
data.value = await result;
console.log(data.value.list);
let temp = 0;
data.value.list.forEach((element) => {
temp += element.main.temp;
});
temp = temp / data.value.list.length;
// subimos el 0.25% la temperatura, openweathermap es muy fresquito!!
temp = temp * 0.75;
console.log(Math.floor(100 / temp), temp);
days.value = Math.floor(100 / temp);
data.value.list.forEach((element) => {
temp += element.main.temp;
});
temp = temp / data.value.list.length;
// subimos el 0.25% la temperatura, openweathermap es muy fresquito!!
temp = temp * 0.75;
console.log(Math.floor(100 / temp), temp);
days.value = Math.floor(100 / temp);
let hoy = new Date();
let newDate = date.addToDate(hoy, { days: days.value });