Design comparison
Solution retrospective
My first React App 🙂 Feel free to give me any feedback or tip!
Community feedback
- @ChaffexdPosted over 1 year ago
Hey Sam!
Great project, really good use of a class component - I like the approach.
I have thing you need to change and that's the month counter, I understand why you have the +1 but it actually gives you the incorrect results. "mapMonthDays(date.getMonth() + 1" with the new Date() object, getMonth provides January as 0, so when you do the calculation it is actually adding a month to your age! I know I'm old but I'm not that old just yet haha.
Marked as helpful0@simonem-fPosted over 1 year agoHi @Chaffexd!
thanks! Yes, I realized in some cases there's a mistake in age calculation 😦 The +1 on the mapMonthDays is actually right, it's used to get how many days a month has. In months calculation I think I simply forgot the number to be carried from days calculation. I've submitted the fix, now it should work! Thanks again!
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