Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Set date picker minimum to current day
  • Loading branch information
regalijan committed Mar 10, 2024
1 parent 29ad1da commit 0517586
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/routes/book-event.tsx
Expand Up @@ -47,10 +47,10 @@ export default function () {
const [submitSuccess, setSubmitSuccess] = useState(false);

useEffect(() => {
currentDate.setUTCDate(0);
setDatePickerMin(
`${currentYear}-${currentMonth.toString().padStart(2, "0")}-01`,
`${currentYear}-${currentMonth.toString().padStart(2, "0")}-${currentDate.getUTCDate().toString().padStart(2, "0")}`,
);
currentDate.setUTCDate(0);
setDatePickerMax(
`${currentYear}-${currentMonth.toString().padStart(2, "0")}-${new Date(currentYear, currentMonth, 0).getUTCDate()}`,
);
Expand Down

0 comments on commit 0517586

Please sign in to comment.