Skip to content

fix age to be calculated with more than just year. #58

@ravishende

Description

@ravishende

In /signup route in views.py (used almost everywhere that requires age) and in the get_age() function in app.py (used in profile.html), age is calculated as datetime.year-birthday.year. This only takes into account the years and not the days/months, so that means if someone hasn't had their birthday that year, it will still say their age like they have. In essence, everyone has a birthday of January first when calculating age with this model. To fix this, subtract datetime-birthday and then take only the years portion of the difference or something along those lines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    before-releasethis MUST be fixed before it is released to the publicbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions