Fix inaccurate age calculation (#1237)

This commit is contained in:
peolic
2021-03-30 06:25:56 +03:00
committed by GitHub
parent 7acae34ed4
commit 496900df42
3 changed files with 3 additions and 2 deletions

View File

@@ -79,7 +79,7 @@ const getAge = (dateString?: string | null, fromDateString?: string) => {
if (
birthdate.getMonth() > fromDate.getMonth() ||
(birthdate.getMonth() >= fromDate.getMonth() &&
birthdate.getDay() > fromDate.getDay())
birthdate.getDate() > fromDate.getDate())
) {
age -= 1;
}