Design comparison
Solution retrospective
Hello my name is João Vitor and i have completed another frontend mentor challenge.🔗
- I'm having problems checking the entries, I can't check what appears in the preview
- Another problem is that if the year is less than 100 the wrong age appears.
How can i improve and reduce unnecessary code? Leave your comment. 😁
Community feedback
- @AyoubrabiaePosted about 1 year ago
For the second problem, there are two issues to address:
-
To avoid errors, you can add a rule that triggers an error if the selected year is earlier than a specific year you've chosen, like this:
if (year < 1899) { showError(); }
-
Another issue is that even when selecting the current year, you can still choose a month that's later than the current month. To fix this, make sure to:
- Check within your existing code (line 61) that the selected year is not greater than the current year.
- Also, in the month condition, include a check to ensure the selected day isn't greater than the current day.
If you have any questions or need help implementing these changes, feel free to ask.
Marked as helpful0@jvssvjPosted about 1 year ago@Ayoubrabiae Thanks for the review friend, I'll fix it as soon as possible
0 -
- @AyoubrabiaePosted about 1 year ago
I will show you your code and see if I can help.
Marked as helpful0
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