add week day
This commit is contained in:
parent
7deb989a10
commit
a96bec9db2
@ -60,6 +60,16 @@ export default function Home() {
|
|||||||
console.log("system changed");
|
console.log("system changed");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var weekday = [
|
||||||
|
"Sunday",
|
||||||
|
"Monday",
|
||||||
|
"Tuesday",
|
||||||
|
"Wednesday",
|
||||||
|
"Thursday",
|
||||||
|
"Friday",
|
||||||
|
"Saturday",
|
||||||
|
];
|
||||||
|
|
||||||
// console.log(convertTime(weatherData.dt, weatherData.timezone));
|
// console.log(convertTime(weatherData.dt, weatherData.timezone));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -88,11 +98,24 @@ export default function Home() {
|
|||||||
)}
|
)}
|
||||||
<div className={styles.statsWrapper}>
|
<div className={styles.statsWrapper}>
|
||||||
<div className={styles.titleAndSearch}>
|
<div className={styles.titleAndSearch}>
|
||||||
<h2 style={{ textAlign: "left" }}>
|
{weatherData && (
|
||||||
Today at:{" "}
|
<h2 style={{ textAlign: "left" }}>
|
||||||
{convertTime(weatherData.dt, weatherData.timezone)[0].split(":")[0]}
|
{
|
||||||
:00
|
weekday[
|
||||||
</h2>
|
new Date(
|
||||||
|
convertTime(weatherData.dt, weatherData.timezone).input
|
||||||
|
).getUTCDay()
|
||||||
|
]
|
||||||
|
}
|
||||||
|
,{" "}
|
||||||
|
{
|
||||||
|
convertTime(weatherData.dt, weatherData.timezone)[0].split(
|
||||||
|
":"
|
||||||
|
)[0]
|
||||||
|
}
|
||||||
|
:00
|
||||||
|
</h2>
|
||||||
|
)}
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
className={styles.searchInput}
|
className={styles.searchInput}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user