diff --git a/frontend/src/constants/application/28.ts b/frontend/src/constants/application/28.ts index 2db9ff5f..3856e5cc 100644 --- a/frontend/src/constants/application/28.ts +++ b/frontend/src/constants/application/28.ts @@ -195,12 +195,20 @@ export const APPLICATION_TIMELINE: ApplicationTimeline = { /** * @description 개인정보 수집에 대한 1차 모집 마감일 상수 데이터 - * @property {month}: 1차 모집 마감 달 (1-12) - * @property {date}: 1차 모집 마감 날짜 (1-31) + * @property {number} year - 1차 모집 마감 연도 + * @property {number} month - 1차 모집 마감 달 (1-12) + * @property {number} date - 1차 모집 마감 날짜 (1-31) + * @property {number} hours - 1차 모집 마감 시간(시) (0-23) + * @property {number} minutes - 1차 모집 마감 시간(분) (0-59) + * @property {number} seconds - 1차 모집 마감 시간(초) (0-59) */ export const END_DATE = { + year: 2024, month: 9, date: 15, + hours: 23, + minutes: 59, + seconds: 59, }; /** diff --git a/frontend/src/hooks/useApplication.tsx b/frontend/src/hooks/useApplication.tsx index f6f5fe1c..931221cf 100644 --- a/frontend/src/hooks/useApplication.tsx +++ b/frontend/src/hooks/useApplication.tsx @@ -23,6 +23,10 @@ export const useApplication = () => { const setApplicationIndex = useSetAtom(applicationIndexAtom); const applicationData = useAtomValue(applicationDataAtom); + const { + END_DATE, + } = require(`@/src/constants/application/${CURRENT_GENERATION}.ts`); + const canApplicationNext = (applicationNames: Array) => { const nonValidatedQuestion = applicationNames .map((name) => { @@ -84,7 +88,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 - 9, + END_DATE.minutes, + END_DATE.seconds + ) + ) { alert("지원 기간이 종료되었습니다."); return false; }