Skip to content

Calculator is maybe not true #12

@binhmuc

Description

@binhmuc

Hi,
I run your example code at 02/Nov/2018. Your code example is 9 months ago. So the day of birth is 02/Feb/2018.
But your function "helpers.date_to_age_in_months" is calculate valid_age is: 8 ( i think 9 is correct, because 9 months ago, right ?)
Maybe your code.
def date_to_age_in_months(date): delta = datetime.date.today() - date print (delta.days / 30.4375) #years = delta.days / 365.25 return str(int(delta.days / 30.4375))
In file helper is wrong, delta.days / 30.4375 = 8.969199178644764 and return 8.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions