Skip to content

Commit

Permalink
consider weeks when calculating age
Browse files Browse the repository at this point in the history
  • Loading branch information
celineung committed Feb 25, 2025
1 parent 58c47fc commit baec910
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions shared/src/convention/convention.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { differenceInCalendarISOWeekYears } from "date-fns";
import { differenceInISOWeekYears } from "date-fns";
import { keys, mapObjIndexed, values } from "ramda";
import { Role, SignatoryRole, allSignatoryRoles } from "../role/role.dto";
import { DotNestedKeys } from "../utils";
Expand Down Expand Up @@ -115,7 +115,7 @@ export const isBeneficiaryMinorAccordingToAge = (
conventionDateStart: DateString,
beneficiaryBirthdate: string,
): boolean => {
const age = differenceInCalendarISOWeekYears(
const age = differenceInISOWeekYears(
new Date(conventionDateStart),
new Date(beneficiaryBirthdate),
);
Expand Down

0 comments on commit baec910

Please sign in to comment.