diff --git a/src/interfaces/utils.ts b/src/interfaces/utils.ts index ef23c9b1..d9edd9d9 100644 --- a/src/interfaces/utils.ts +++ b/src/interfaces/utils.ts @@ -5,8 +5,10 @@ export function calculateAge(start: Date, end = new Date()) { let month = end.getMonth() - start.getMonth(); let day = end.getDate() - start.getDate(); - if (month < 0) year -= 1; - if (month < 0) month += 12; + if (month < 0) { + month += 12; + year -= 1; + } if (day < 0) { month -= 1; day =