Design comparison
Solution retrospective
Honestly this is not perfect, but this is as far as I'll take it. Using the Date object, it is possible to get the difference of two dates. However, I couldn't quite find a way to convert this into years months and days without skipping leap years. So, for now I opted to just compare the year, month and day values. I might come back to this and fix it, but I mostly wanted a half decent working site and the weekend is almost over. The way I check the inputs also feels a bit stupid, but should work most of the time. If anyone has any hints or links to resources where I can learn better ways to solve these issues they are always welcome to post them :) Thanks for reviewing :*
Community feedback
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