Skip to content

Commit

Permalink
Merge pull request #174 from JNU-econovation/refactor/173-endDate
Browse files Browse the repository at this point in the history
refactor: 신입 모집 마감 날짜 수정 (#174)
  • Loading branch information
smb0123 authored Aug 31, 2024
2 parents 9ce54ee + 5fd8c2a commit f27a023
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
12 changes: 10 additions & 2 deletions frontend/src/constants/application/28.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

/**
Expand Down
16 changes: 15 additions & 1 deletion frontend/src/hooks/useApplication.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>) => {
const nonValidatedQuestion = applicationNames
.map((name) => {
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit f27a023

Please sign in to comment.