Great job in completing this challenge🎉. Although, I have a little suggestion. After I confirm the order, I get the confirmation modal which is great.
But when I click on Start new order, my cart is supposed to be cleared. I’m supposed to start a new order, instead I get the previous items in the cart.
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.
Nice job Théo. There's just a suggestion I'll make and that is the cardholder name field. I can input a space and it'll go through. So instead of typing a value, if I type spaces inside, I don't get any error. So I should get an error if I input any whitespaces first. Hope you can fix this. You did a really great job.
Nice job in completing your first API project. You did great. There's only one styling issue and it's the min-height you set up in the body tag, it's advisable you use min-height: 100dvh.
Because the attribution text overflows the container. And on smaller screens, the height is always what you set (1000px). So it's too much.
hello everyone ;) this challenge was not very simple, from the point of view of the implementation of the JS code, as I had to do several tests until I got to cover all the various types of possible errors by the user and related error messages.
Figuring out how to calculate age taking into account all possible variables, including whether or not the year is a leap year, also got me busy. But precisely for this reason it was a very useful challenge for the continuous learning of JS.
How do you think he solved the challenge? if you have any question/information/suggestion I'm here and we can discuss it..see you next time ;)
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.
Hello there, I just checked your site and there are lots of things you need to improve.
When I opened the site, I tried to submit which gave me the error for the input field that it's required which is fine. But somehow the age calculated with an empty input field. You should handle that correctly.
You didn't really validate the input field that well, because when I tried to input an invalid day/month/year, I get the error it must be in the past... But if I try to calculate the age with invalid dates, somehow the age still gets calculated.
This was a tricky app to make. Especially with figuring out the proper algorithm required to convert the user's birthday into an age. The app is fully responsive and even has an animation that occurs when the user clicks on the submit button. I used a setInterval() that calls the setState() function every 30 milliseconds. Inside the setState(), it will continue to increment the state by 1 until it reaches the age of the user in months, years, or days. This is what creates the animation of the numbers in my app.
Nice Job. Although, I noticed you didn't really account for a leap year. so when I tried inputting a day in the leap year, e.g 29/04/2004, I got an error. But I love the animations. Nice job