diff --git a/src/components/content/heroes/aurora/weather-easter-egg/daylight-percentage-calculator.ts b/src/components/content/heroes/aurora/weather-easter-egg/daylight-percentage-calculator.ts index e69d095fc..615e0f403 100644 --- a/src/components/content/heroes/aurora/weather-easter-egg/daylight-percentage-calculator.ts +++ b/src/components/content/heroes/aurora/weather-easter-egg/daylight-percentage-calculator.ts @@ -7,7 +7,7 @@ export const getSunlightPercentage = ( if (totalDaylightMinutes <= 0) { return 20; } - const currentMinutes = time - sunriseTime + 86400000; + const currentMinutes = time - sunriseTime; const sunlightPercentage = (currentMinutes / totalDaylightMinutes) * 100; if (sunlightPercentage < 0) { @@ -29,7 +29,7 @@ export const getNighttimePercentage = ( if (totalNighttimeMinutes <= 0) { return 0; } - const currentMinutes = time - sunsetTime + 86400000; + const currentMinutes = time - sunsetTime; const nighttimePercentage = (currentMinutes / totalNighttimeMinutes) * 100; if (nighttimePercentage < 0) { diff --git a/src/components/content/heroes/aurora/weather-easter-egg/sun.tsx b/src/components/content/heroes/aurora/weather-easter-egg/sun.tsx index fc4a9078f..7a362a160 100644 --- a/src/components/content/heroes/aurora/weather-easter-egg/sun.tsx +++ b/src/components/content/heroes/aurora/weather-easter-egg/sun.tsx @@ -179,18 +179,22 @@ export const Sun = () => { setSunrise(sunriseTime); setSunset(sunsetTime); setTimePercent( - getSunlightPercentage(sunriseTime, sunsetTime, +new Date()), + getSunlightPercentage(sunriseTime, sunsetTime, +new Date() + 86400000), ); setNightTimePercent( - getNighttimePercentage(sunriseTime, sunsetTime, +new Date()), + getNighttimePercentage(sunriseTime, sunsetTime, +new Date() + 86400000), ); }; fetchData(); const interval = setInterval(() => { - setTimePercent(getSunlightPercentage(sunrise, sunset, +new Date())); - setNightTimePercent(getNighttimePercentage(sunrise, sunset, +new Date())); + setTimePercent( + getSunlightPercentage(sunrise, sunset, +new Date() + 86400000), + ); + setNightTimePercent( + getNighttimePercentage(sunrise, sunset, +new Date() + 86400000), + ); }, 10000); return () => {