Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getAge() is inconsistent with getDateOfBirth() #94

Closed
urbanaut opened this issue Dec 5, 2017 · 5 comments
Closed

getAge() is inconsistent with getDateOfBirth() #94

urbanaut opened this issue Dec 5, 2017 · 5 comments
Assignees
Labels

Comments

@urbanaut
Copy link

urbanaut commented Dec 5, 2017

When a person object is instantiated, and then date of birth and age are generated, the age will not match up with birth date year.

@OlgaMaciaszek OlgaMaciaszek self-assigned this Dec 16, 2017
@mariuszs mariuszs self-assigned this Mar 12, 2018
@mariuszs mariuszs added the bug label Mar 12, 2018
@jiminhsieh
Copy link

@mariuszs @OlgaMaciaszek
Could I work on this one?

@mariuszs
Copy link
Member

mariuszs commented Nov 6, 2019

Yes! :)

@jiminhsieh
Copy link

@mariuszs I think this issue is related to how we calculate age.

Here is the example of the current calculation:
If today is 2020/01/01 and age is 20, then the birth date will between 2000/01/01 to 1999/01/02.

LocalDate maxDate = timeProvider.getCurrentDate().minusYears(age);
LocalDate minDate = maxDate.minusYears(1).plusDays(1);
dateOfBirth = dateProducer.randomDateBetweenTwoDates(minDate, maxDate);

I think this is legitimate.

@urbanaut Could you elaborate on what you expect? Thanks.

@kdebski85
Copy link
Contributor

@mariuszs
I also checked the calculation and every seems to be fine now.
Maybe we can close this issue.

@mariuszs
Copy link
Member

mariuszs commented Mar 2, 2020

Ok, thanks!

@mariuszs mariuszs closed this as completed Mar 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants