Latest solutions
Loopstudios Landing Page Solution using React JS & TailwindCSS
#react#tailwind-css#viteSubmitted 9 months agoResponsive Newsletter Signup Form with Vite, React, Tailwind CSS
#react#react-router#tailwind-cssSubmitted about 1 year agoI'm always open to feedback on how to improve the code, design, or overall functionality.
Advice Generator App Solution using React and Axios
#axios#react#viteSubmitted about 1 year agoIf you have any feedback or suggestions, I'd be happy to hear them!
Age Calculator with Responsive Design and Validation
#node#react#tailwind-css#viteSubmitted about 1 year agoSince I'm confident with the current functionality, I'm not seeking specific help at this time.
QR Code Component Solution.
Submitted about 1 year agoCurrently, I don’t need assistance with any specific areas. However, I’m open to feedback on any aspect of the project.
Latest comments
- @Hvbiba@rohanvron
Beautiful Design, keep up the great effort!
- @BenjiHunt2319@rohanvron
Hey Benji,
Your age calculator looks great!
I noticed a small thing with the date accuracy for months other than the current one. The calculation might be off slightly in those cases.
It seems the code needs an adjustment in how it validates birth dates with different months. Here's an idea:
- Use a Date object to create a representation of the entered date (including year and month). Then, use getDate() to retrieve the correct number of days for that specific month and year (including leap year handling).
This approach ensures accurate validation regardless of the month entered. I've included a code snippet to illustrate this solution:
const inputDate = new Date(year, month - 1, day); if ( inputDate.getDate() !== parseInt(day) || inputDate.getMonth() + 1 !== parseInt(month) || inputDate.getFullYear() !== parseInt(year) ) { return false; } return true; };
Just a heads up about the date validation! Overall, your age calculator is a solid foundation. Keep up the good work! 🚀
Marked as helpful - @Vaibhav507@rohanvron
Hi Vaibhav,
Your age calculator app looks great!
However, I noticed a couple of interesting edge cases that might need some attention:
Month Handling: When entering a date like 14/04/2001" (April 14th, 2001), the output shows -> 22 years 12 months and 21days. While technically correct, it might be more intuitive for users to see this as 23 years 00 months and 21 days. Perhaps there's an opportunity to simplify the output by combining years and months when exceeding 12 months.
Input Validation: Currently, it seems like negative numbers and future dates are accepted as input. For a more user-friendly experience, it might be beneficial to implement some basic validation. For example, users shouldn't be able to enter negative birthdates or dates exceeding the current year.
Just some thoughts to consider! Overall, your age calculator is really cool. Keep up the good work!
Marked as helpful - @joshjavierWhat are you most proud of, and what would you do differently next time?
I'm proud of the way I structured my code. I think I did a pretty good job dividing code into components and modules that have distinct responsibilities, so it would be easier for other devs (or myself in the future) to understand the code and improve it.
I also feel more confident in deciding when or not to use an external package to solve a problem. In this case, implementing the form without a form library is possible, but I decided to use React Hook Form because it seemed like a good balance between ease of development (I don't have to implement the error validation from scratch) and the performance hit on the app (package size is pretty small at 8.5KB).
What challenges did you encounter, and how did you overcome them?For working with dates, JavaScript's built-in
What specific areas of your project would you like help with?Date
class proved sufficient for this app. One gotcha I encountered was that theDate()
constructor doesn't throw an error when passed an invalid date. For example, creating aDate
object for April 31, 1995 will be evaluated to May 1, 1995. So, to check for invalid dates, I compared the input date and the parsed date. If they're not equal, then the form won't pass validation.Any feedback on the animations? I added it last and didn't want to over-optimize, but I feel like it could use more oomph. It's my first time using React Spring, so I'm still not aware of its full capabilities. Anyway, constructive feedback is welcome!
Age calculator app built with React, React Hook Form and React Spring
#accessibility#react#vite#animation@rohanvronGreat job! Your solution is impressive.
- @Mrst12What are you most proud of, and what would you do differently next time?
I'm glad that I kept going with my project, i've been working a lot with tailwindcss so my vanilla CSS is a bit rusty, so I need to work on that a little. I would try to refactor the challenge a little next time as probably went a bit over the top creating the project.
What challenges did you encounter, and how did you overcome them?I struggled with figma as it was the first time using it, so i really need some practice on using design files. I saw a few basic tutorials to get me going which was really helpful.
What specific areas of your project would you like help with?This was my first challenge so any feedback would be appreciated, trying to boost my confidence with my skills really.
@rohanvronGreat Work Lisa! Congratulations on completing your first challenge!