@Olatoyan
Posted
Hello there, nice job in completing this task. There are quite a few bugs I noticed.
- I noticed you handled the error when the date is invalid which is great.
- Talking about error handling. I saw you wrote a code that calculates ages in leap year which is totally fantastic. I really love that. But when I input “Feb 29” in a year that’s not a leap year, I get an error which is great but somehow the age still get calculated. I wrote Feb 29 2020(which was a leap year) the age got calculated. But when I wrote Feb 29 2021(which isn’t a leap year) I got an error(which is great) but the age still got calculated.
- You wrote a code that checks if we input w future year. Which is superb. But I tried inputting something like this Dec 31 2023, now this is a future date but somehow it got calculated. My own advice on how this can be solved is to convert the date we inputted to a timestamp, and also convert the current date to a timestamp, then compare both. So if the timestamp of the date we inputted is higher than the current date timestamp, we should get an error
So Pablo, once again, nice job in completing the task. Dates are very tricky in JavaScript and I hope I’m able to help.
Marked as helpful
@p4bloxx
Posted
@Olatoyan hello and first of all thanks for the feedback ;) I did the various tests you said and yes, I thought I had foreseen all the various error cases but no, I left some.
Now I'm going to fix the various errors and as regards the issue of the future date I'll try to do as you advised me and there shouldn't be any problems.
Thanks again for the help, see you next time ;)
@Olatoyan
Posted
@p4bloxx You’re welcome bro. You’ve absolutely got this✊🏽