1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-09 07:25:19 +02:00

fix date test

This commit is contained in:
Karan Handa 2024-01-19 14:07:57 +05:30
parent 3bc4ac1687
commit b00f97d033

View file

@ -132,7 +132,7 @@ export function dobToAge(dob: string | Date | DateTime | null | undefined, now =
? DateTime.fromJSDate(dob, { zone: 'utc' }) ? DateTime.fromJSDate(dob, { zone: 'utc' })
: dob : dob
return Math.floor(now.diff(normalizedDate, 'years').years) return Math.max(Math.floor(now.diff(normalizedDate, 'years').years), 0)
} }
// We allow a maximum of 30 years of history for performance reasons (hypertable chunking) // We allow a maximum of 30 years of history for performance reasons (hypertable chunking)