Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: 신입 모집 마감 날짜 수정 #174

Merged
merged 5 commits into from
Aug 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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