Use "quot" to round negative ages towards zero

I was using "div" which rounds towards negative infinity, so negative
age differences of less than a year had -1 rather than 0 in the years
field.
This commit is contained in:
pta 2024-02-25 23:29:35 -05:00
parent c95b99dc3a
commit 41b526d375
1 changed files with 1 additions and 1 deletions

View File

@ -87,7 +87,7 @@ findAge = do
return (\dob ->
let monthsAndDays = diffGregorianDurationClip today dob
totalMonths = cdMonths monthsAndDays
y = div totalMonths 12
y = quot totalMonths 12
m = rem totalMonths 12
d = cdDays monthsAndDays
countdown = diffDays (nextbday dob) today