Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 9 months ago

Age Calculator App - Responsive and Interactive Date Calculation Tool

accessibility
noreenfatima775•70
@noreenfatima775
A solution to the Age calculator app challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

What I Am Most Proud Of:

I am most proud of successfully implementing a fully responsive design that adapts seamlessly to various screen sizes. Additionally, I effectively used JavaScript to handle input validation and perform accurate date calculations, ensuring a smooth and interactive user experience. I also integrated custom fonts to enhance the app's visual appeal.

What I Would Do Differently Next Time:

Next time, I would focus more on enhancing accessibility by using ARIA attributes and improving keyboard navigation. I would also consider using CSS Grid for more complex layouts and possibly integrating a JavaScript library or framework, such as React, to make the code more modular and maintainable.

What challenges did you encounter, and how did you overcome them?

One of the main challenges I encountered was validating user input to ensure that the entered date was both correct and meaningful (e.g., no invalid dates like February 30th). Additionally, accurately calculating the age in years, months, and days from the given date posed some difficulty due to the variations in month lengths and leap years.

To overcome these challenges, I implemented JavaScript functions to check for valid dates and handle errors gracefully with appropriate messages. For the age calculation, I used the Date object in JavaScript to compute the difference between the current date and the input date. This allowed me to handle the complexities of date arithmetic, such as month lengths and leap years, more effectively. I also tested the app with a variety of dates to ensure its accuracy and robustness.

What specific areas of your project would you like help with?

I would appreciate feedback and suggestions on the following areas:

Accessibility Enhancements: How to improve the app's accessibility, particularly for screen readers and keyboard navigation. Performance Optimization: Tips on optimizing the code to make it more efficient and improve loading times, especially for mobile devices. Design Improvements: Any advice on enhancing the visual design, such as color choices, typography, or layout adjustments, to improve user experience. JavaScript Best Practices: Suggestions on refining my JavaScript code for better readability, maintainability, and performance. Cross-Browser Compatibility: Advice on ensuring the app looks and functions consistently across different browsers and devices.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • P
    MikDra1•7,450
    @MikDra1
    Posted 9 months ago

    Well done,

    One thing that could be improved is that when there is one year it is displayed 1years and it should be 1year. The same applies to months and days. Try to sort out this problem with template literal and ternery operator 😉.

    Hope you found this comment helpful 💗💗💗

    Good job and keep going 😁😊😉

  • Mahmoud Elagamy•1,100
    @m-elagamy
    Posted 9 months ago

    Hi there,

    I've been using your calculator app and I've really enjoyed it. However, I did encounter a small issue that I thought you might want to know about.

    I recently used the calculator to determine my age by entering today's date as my birthday. The result displayed 24 years and 6 days instead of simply 24 years.

  • adriantech-beep•390
    @adriantech-beep
    Posted 9 months ago

    nice work.

    i only have a few suggestion instead of choosing alert pop up on window if there is no input you can use an (if else statement) on javascript to change the border color of input boxes and a text that will pop up below the input boxes.

    Hope this will help.😊

Join 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
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit 1st-party linked stylesheets, and styles within <style> tags.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub