Skip to content

Commit

Permalink
fix aemet check
Browse files Browse the repository at this point in the history
  • Loading branch information
lluisd committed Jul 12, 2024
1 parent 3c6b09d commit d7c499b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions services/aemet.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const endpointPrefix = 'https://opendata.aemet.es/opendata/api/'
async function getSunsetPrediction(name) {
let sunsetTime = null
const result = await _getTimePrediction(name)
if (result && result.length > 1) {
if (result && result.length > 0) {
sunsetTime = result[0].prediccion.dia[0].ocaso
}
return sunsetTime
Expand All @@ -14,7 +14,7 @@ async function getSunsetPrediction(name) {
async function getSunrisePrediction(name) {
let sunsetTime = null
const result = await _getTimePrediction(name)
if (result && result.length > 1) {
if (result && result.length > 0) {
sunsetTime = result[0].prediccion.dia[0].orto
}
return sunsetTime
Expand Down

0 comments on commit d7c499b

Please sign in to comment.