Design comparison
SolutionDesign
Community feedback
- @OlatoyanPosted about 1 year ago
Hello Shaik. I noticed some bugs in your code.
- If I input an invalid date, I get an error which is super great. Nice job. But after I get the error, and I try to calculate another age, the error doesn't clear. So the error stays there forever which isn't great. The error should only be there when the date we inputted is invalid.
- There's a little bug in settings error for future dates. If I wanted to calculate a age. Let's say 13/1/2024. I get an error which is nice because 2024 is in the future. But now, if I calculate a future date in the same year, I don't get an error. For instance, let's say 13/12/2023. Now this is in the future because we're in November and December is next month. When I try to calculate this, I don't get an error, the age gets calculated and I get a minus in the output.
- You know some days are 30, some are 31 and February has 28 days 0r 29 in leap years. But in your code, all days are calculated in 31. So if I wrote 31/9/2020, I should get an error because September has only 30 days, but here I calculated September has 31 days.
These are the little bugs I found in your code. Aside these, you did a really great job, because dates are really tricky.
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