Thales• 150
@thales91
Posted
Hello, the solution was very good, the only thing I saw that you can improve is to test the last day of the month if it is valid using the date-fns lib to ensure that the user will not enter February 31st, for example, follow the code I I did it on mine
const lastDayMonth = lastDayOfMonth(new Date(year, month - 1, 1));
if (day > lastDayMonth.getDate()) {
setError("day", { message: "Invalid day" });
return;
}
0