diff --git a/pages/index.js b/pages/index.js index f022a6a..2b273e0 100644 --- a/pages/index.js +++ b/pages/index.js @@ -60,6 +60,16 @@ export default function Home() { console.log("system changed"); }; + var weekday = [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + ]; + // console.log(convertTime(weatherData.dt, weatherData.timezone)); return ( @@ -88,11 +98,24 @@ export default function Home() { )}
-

- Today at:{" "} - {convertTime(weatherData.dt, weatherData.timezone)[0].split(":")[0]} - :00 -

+ {weatherData && ( +

+ { + weekday[ + new Date( + convertTime(weatherData.dt, weatherData.timezone).input + ).getUTCDay() + ] + } + ,{" "} + { + convertTime(weatherData.dt, weatherData.timezone)[0].split( + ":" + )[0] + } + :00 +

+ )}