fix(math): age calculation logic

This commit is contained in:
Franek 2025-04-26 15:00:58 +02:00
parent 7f5df0b4b2
commit e8fc605cf9

View File

@ -1,4 +1,6 @@
export function calculateAge(birthDate: Date) {
birthDate.setMonth(birthDate.getMonth() - 1);
let today = new Date();
let years = today.getFullYear() - birthDate.getFullYear();
let months = today.getMonth() - birthDate.getMonth();