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

Increase precision of age around birthdate #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

theycallmeswift
Copy link

The current formula for calculating age isn't accurate within ~24 hours of the birthday on some years because we're using a hardcoded value for milliseconds per year. This change calculates the year and decimal places separately to increase accuracy.

Changes:

  • Convert the dob to the current timezone when saving and loading
  • Calculate age in years by comparing days
  • Calculate age in MS as % of MS in current year

 - Convert the dob to the current timezone when saving and loading
 - Calculate age in years by comparing days
 - Calculate age in MS as % of MS in current year
@boyski33
Copy link

It would be great if this could be merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants