Design comparison
SolutionDesign
Solution retrospective
Any feedback would be appreciated!
Community feedback
- @thales91Posted 12 months ago
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
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord