mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-08 15:05:22 +02:00
fix date test
This commit is contained in:
parent
3bc4ac1687
commit
b00f97d033
1 changed files with 1 additions and 1 deletions
|
@ -132,7 +132,7 @@ export function dobToAge(dob: string | Date | DateTime | null | undefined, now =
|
|||
? DateTime.fromJSDate(dob, { zone: 'utc' })
|
||||
: 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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue