Skip to content

Commit

Permalink
Merge pull request #1478 from danskernesdigitalebibliotek/DDFHER-77-i…
Browse files Browse the repository at this point in the history
…nvalid-ssn-when-creating-with-mit-id

DDFHER-77 - Allow age to be equal to the configured minimum age in `patronAgeValid`
  • Loading branch information
kasperbirch1 authored Oct 10, 2024
2 parents 1d712cd + e0a2a6d commit 3689d60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/utils/helpers/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ export const patronAgeValid = (cpr: string, minAge: number) => {
if (cprDate === null) return false;

const age = dayjs().diff(dayjs(cprDate), "year");
return age > minAge;
return age >= minAge;
};

// Create a string of authors with commas and a conjunction
Expand Down

0 comments on commit 3689d60

Please sign in to comment.