Skip to content

Commit

Permalink
[feat] 모집상태처리 #1388
Browse files Browse the repository at this point in the history
  • Loading branch information
Sangmin Park authored and Sangmin Park committed Apr 15, 2024
1 parent b439afa commit 62943a1
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
26 changes: 25 additions & 1 deletion components/admin/recruitments/RecruitmentsHistoryList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const tableTitle: { [key: string]: string } = {
id: 'ID',
usedAt: '적용 시간',
title: '제목',
isFinish: '상태',
status: '상태',
detailRecruitment: '공고 상세보기',
detaillUser: '지원자 보기',
};
Expand Down Expand Up @@ -140,6 +140,30 @@ function RecruitmentsHistoryList({
);
}

if (columnName === 'status') {
const today = new Date();
const todaystring = today.toISOString().slice(0, 19);
const todaydate = new Date(todaystring);
const endDate = new Date(recruit.endDate);
const startDate = new Date(recruit.startDate);
console.log(
startDate,
endDate,
todaystring,
startDate < todaydate,
endDate > todaydate
);
return (
<div>
{recruit.isFinish
? '완료'
: startDate <= todaydate && endDate >= todaydate
? '진행중'
: '진행전'}
</div>
);
}

return (
<AdminContent
content={recruit[columnName as keyof Irecruit]?.toString() as string}
Expand Down
1 change: 0 additions & 1 deletion constants/admin/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ export const tableFormat: TableFormat = {
'startAt',
'endAt',
'status',
'isFinish',
'isCurrent',
'detailRecruitment',
'detaillUser',
Expand Down
2 changes: 1 addition & 1 deletion types/admin/adminRecruitmentsTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface Irecruit {
title: string;
contents?: string;
status?: '모집전' | '모집중' | '완료';
isFinish?: '모집전' | '모집중' | '완료';
isFinish?: boolean;
generation: string;
form?: Array<Iquestion>;
}
Expand Down

0 comments on commit 62943a1

Please sign in to comment.