Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Include leading zeroes in months/days for date picker bounds
  • Loading branch information
regalijan committed Feb 26, 2024
1 parent 49cc8ee commit 9554240
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/routes/book-event.tsx
Expand Up @@ -27,9 +27,11 @@ export default function () {

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

Expand Down

0 comments on commit 9554240

Please sign in to comment.