Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Age calculator app width grid and flex

Liedson Franco• 370

@LiedsonFranco

Desktop design screenshot for the Age calculator app coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


Can anyone tell me if this logic is right, I have some doubts 🤔. JS:

    const day = document.getElementById('day')
    const month = document.getElementById('month')
    const year = document.getElementById('year')
    const amont_of_days = new Date(parseInt(year.value), parseInt(month.value), 0).getDate()
    let total_years = parseInt(current_year - year.value)
    let total_months = 12 - parseInt(month.value)
    let total_days = parseInt(day.value - current_day)
    if(current_month < month.value){
        total_years -= 1
    }
    if(current_day > day.value){
        total_months += 1
    }
    if(total_days < -1){
        total_days = total_days * -1
    }

Community feedback

Please log in to post a comment

Log in with GitHub
Discord logo

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