Update lib.js

This commit is contained in:
ferrreo 2023-09-01 21:57:30 +01:00 committed by GitHub
parent 4d5906d066
commit b839dbb22a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,7 +10,7 @@ export const getTemp = (temp) => {
export const getWeatherSymbol = (weatherCode) => { export const getWeatherSymbol = (weatherCode) => {
const dt = new Date(); const dt = new Date();
const hour = dt.getHours(); const hour = dt.getHours();
if (hour < 7 || hour > 21) { if (hour <= 7 || hour >= 20) {
return NIGHT_WEATHER_SYMBOL[WWO_CODE[weatherCode]]; return NIGHT_WEATHER_SYMBOL[WWO_CODE[weatherCode]];
} }
return WEATHER_SYMBOL[WWO_CODE[weatherCode]]; return WEATHER_SYMBOL[WWO_CODE[weatherCode]];
@ -160,4 +160,4 @@ const NIGHT_WEATHER_SYMBOL = {
"ThunderyShowers": "thunderstorm", "ThunderyShowers": "thunderstorm",
"ThunderySnowShowers": "thunderstorm", "ThunderySnowShowers": "thunderstorm",
"VeryCloudy": "cloud", "VeryCloudy": "cloud",
} }