손수민

[UPDATE] SelectPage Files

...@@ -3,6 +3,18 @@ import "../style/SelectPage.scss" ...@@ -3,6 +3,18 @@ import "../style/SelectPage.scss"
3 3
4 function SelectPage(props) { 4 function SelectPage(props) {
5 5
6 + const today = new Date();
7 +
8 + const today_year = today.getFullYear();
9 + const today_month = today.getMonth();
10 + const today_date = today.getDate();
11 +
12 + const tomorrow = new Date(today.setDate(today.getDate() + 1));
13 +
14 + const tomorrow_year = tomorrow.getFullYear();
15 + const tomorrow_month = tomorrow.getMonth();
16 + const tomorrow_date = tomorrow.getDate();
17 +
6 const [Time, setTime] = useState("00:00:00"); 18 const [Time, setTime] = useState("00:00:00");
7 19
8 const currentTime = () => { 20 const currentTime = () => {
...@@ -19,40 +31,6 @@ function SelectPage(props) { ...@@ -19,40 +31,6 @@ function SelectPage(props) {
19 31
20 startTimer() 32 startTimer()
21 33
22 - const location = useCallback((event) => { //위치
23 - });
24 -
25 - const today_date = useCallback((event) => { //오늘 일자
26 - });
27 -
28 - const today_weather = useCallback((event) => { //오늘 날씨
29 - });
30 -
31 - const today_curtemp = useCallback((event) => { //오늘 현재 온도
32 - });
33 -
34 - const today_maxtemp = useCallback((event) => { //오늘 최고 온도
35 - });
36 -
37 - const today_mintemp = useCallback((event) => { //오늘 최저 온도
38 - });
39 -
40 - const tomorrow_date = useCallback((event) => { //내일 일자
41 - });
42 -
43 - const tomorrow_weather = useCallback((event) => { //내일 날씨
44 - });
45 -
46 - const tomorrow_curtemp = useCallback((event) => { //내일 현재 온도
47 - });
48 -
49 - const tomorrow_maxtemp = useCallback((event) => { //내일 최고 온도
50 - });
51 -
52 - const tomorrow_mintemp = useCallback((event) => { //내일 최저 온도
53 - });
54 -
55 -
56 return ( 34 return (
57 <> 35 <>
58 <dir id = "header"> 36 <dir id = "header">
...@@ -75,7 +53,7 @@ function SelectPage(props) { ...@@ -75,7 +53,7 @@ function SelectPage(props) {
75 <dir className="today_weather"> 53 <dir className="today_weather">
76 <dir className="days"> 54 <dir className="days">
77 <h1 id="today">오늘의 날씨</h1> 55 <h1 id="today">오늘의 날씨</h1>
78 - <h2 id="day">2022 5 12</h2> 56 + <h2 id="day">{today_year} {today_month + 1} {today_date}</h2>
79 </dir> 57 </dir>
80 <dir className="weather"> 58 <dir className="weather">
81 <h1 id="present_do">14</h1> 59 <h1 id="present_do">14</h1>
...@@ -85,7 +63,7 @@ function SelectPage(props) { ...@@ -85,7 +63,7 @@ function SelectPage(props) {
85 <dir className="tomorrow_weather"> 63 <dir className="tomorrow_weather">
86 <dir className="days"> 64 <dir className="days">
87 <h1 id="today">내일의 날씨</h1> 65 <h1 id="today">내일의 날씨</h1>
88 - <h2 id="day">2022 5 13</h2> 66 + <h2 id="day">{tomorrow_year} {tomorrow_month + 1} {tomorrow_date}</h2>
89 </dir> 67 </dir>
90 <dir className="weather"> 68 <dir className="weather">
91 <h1 id="present_do">50</h1> 69 <h1 id="present_do">50</h1>
......