Skip to content

Commit

Permalink
refactor: 신입 모집 마감 날짜 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
smb0123 committed Aug 29, 2024
1 parent 1b96ff7 commit b7917fa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions frontend/src/constants/application/28.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

/**
Expand Down
13 changes: 12 additions & 1 deletion frontend/src/hooks/useApplication.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
applicationDataAtom,
applicationIndexAtom,
} from "../stores/application";
import { END_DATE } from "../constants/application/28";

export const useApplication = () => {
// TODO: 질문의 이름마다 side effect가 있으니 주의하면 좋을 것
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit b7917fa

Please sign in to comment.