Skip to content

Commit

Permalink
[fix] 어드민 선착순 이벤트 수정/생성에서 현재날짜보다 이전/같은 날짜로 설정하는 것을 막음
Browse files Browse the repository at this point in the history
  • Loading branch information
darkdulgi committed Aug 22, 2024
1 parent 51c27bf commit e04d7b5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/adminPage/features/eventEdit/FcfsInput/FcfsItemInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import { EventEditDispatchContext } from "../businessLogic/context.js";
import { Input } from "@admin/components/SmallInput.jsx";
import DateInput from "@admin/components/DateInput";
import DeleteButton from "@admin/components/DeleteButton";
import { formatDate, padNumber } from "@common/utils.js";
import { formatDate, padNumber, getDayDifference } from "@common/utils.js";
import fcfsInputGridStyle from "./tableStyle.js";
import serverTimeStore from "@admin/serverTime/store.js";

const MINUTE = 60;

Expand Down Expand Up @@ -34,9 +35,10 @@ function FcfsItemInput({ uniqueKey, date, start, end, participantCount, prizeInf
) : (
<DateInput
date={date}
setDate={(date) =>
dispatch({ type: "modify_fcfs_item", key: uniqueKey, value: { date } })
}
setDate={(date) => {
if (getDayDifference(serverTimeStore.getState().serverTime, date) <= 0) return;
dispatch({ type: "modify_fcfs_item", key: uniqueKey, value: { date } });
}}
required
size="4"
/>
Expand Down

0 comments on commit e04d7b5

Please sign in to comment.