From b7917faa559d78300b399de4cf1b5547d4a89c99 Mon Sep 17 00:00:00 2001 From: minbo Date: Thu, 29 Aug 2024 17:34:41 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EC=8B=A0=EC=9E=85=20=EB=AA=A8?= =?UTF-8?q?=EC=A7=91=20=EB=A7=88=EA=B0=90=20=EB=82=A0=EC=A7=9C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/constants/application/28.ts | 4 ++++ frontend/src/hooks/useApplication.tsx | 13 ++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/frontend/src/constants/application/28.ts b/frontend/src/constants/application/28.ts index 2db9ff5f..af528a44 100644 --- a/frontend/src/constants/application/28.ts +++ b/frontend/src/constants/application/28.ts @@ -199,8 +199,12 @@ export const APPLICATION_TIMELINE: ApplicationTimeline = { * @property {date}: 1차 모집 마감 날짜 (1-31) */ export const END_DATE = { + year: 2024, month: 9, date: 15, + hours: 15, + minutes: 0, + seconds: 0, }; /** diff --git a/frontend/src/hooks/useApplication.tsx b/frontend/src/hooks/useApplication.tsx index f6f5fe1c..d54c6c1c 100644 --- a/frontend/src/hooks/useApplication.tsx +++ b/frontend/src/hooks/useApplication.tsx @@ -17,6 +17,7 @@ import { applicationDataAtom, applicationIndexAtom, } from "../stores/application"; +import { END_DATE } from "../constants/application/28"; export const useApplication = () => { // TODO: 질문의 이름마다 side effect가 있으니 주의하면 좋을 것 @@ -84,7 +85,17 @@ export const useApplication = () => { ) => { const isSend = confirm("지원서를 제출하시겠습니까?"); if (!isSend) return false; - if (Date.now() > Date.UTC(2024, 2, 15, 15, 0, 0)) { + if ( + Date.now() > + Date.UTC( + END_DATE.year, + END_DATE.month - 1, + END_DATE.date, + END_DATE.hours, + END_DATE.minutes, + END_DATE.seconds + ) + ) { alert("지원 기간이 종료되었습니다."); return false; }