From 872f8ca6715b4e57c9f1060aa18edfbedd01631a Mon Sep 17 00:00:00 2001 From: Gwanho Kim Date: Thu, 8 Aug 2024 20:28:14 +0900 Subject: [PATCH 1/3] Test print date --- pages/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/pages/index.tsx b/pages/index.tsx index 1db7554..08cbb23 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -15,6 +15,7 @@ const HomePage: React.FunctionComponent<{ nextEvent: ICalendar; }> = ({ noticeList, nextEvent }) => { const isDayTime = 9 <= new Date().getHours() && new Date().getHours() <= 18; + console.log(new Date().getHours()); return ( From fc7f72570fe0c372f83c2721b3193cffbe0a6745 Mon Sep 17 00:00:00 2001 From: Gwanho Kim Date: Thu, 8 Aug 2024 20:46:19 +0900 Subject: [PATCH 2/3] test 2 --- pages/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/pages/index.tsx b/pages/index.tsx index 08cbb23..ae80b55 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -16,6 +16,7 @@ const HomePage: React.FunctionComponent<{ }> = ({ noticeList, nextEvent }) => { const isDayTime = 9 <= new Date().getHours() && new Date().getHours() <= 18; console.log(new Date().getHours()); + console.log(isDayTime); return ( From 0b008f87106b75e7fff128f7de7219edcfd7d5ff Mon Sep 17 00:00:00 2001 From: Gwanho Kim Date: Thu, 24 Oct 2024 22:18:57 -0700 Subject: [PATCH 3/3] Fix hour getting function --- pages/index.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pages/index.tsx b/pages/index.tsx index ae80b55..e0c1bfb 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -14,9 +14,8 @@ const HomePage: React.FunctionComponent<{ noticeList: INotice[]; nextEvent: ICalendar; }> = ({ noticeList, nextEvent }) => { - const isDayTime = 9 <= new Date().getHours() && new Date().getHours() <= 18; - console.log(new Date().getHours()); - console.log(isDayTime); + const KRHour = new Date().getUTCHours() + 9; + const isDayTime = KRHour >= 6 && KRHour < 18; return (