Skip to content

Commit

Permalink
handle undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
langz committed Oct 8, 2024
1 parent 9e8084c commit c062229
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ function NationalIdentityNumber(props: Props) {
}

function is18YearsOrOlder(value: string) {
if (value === undefined) return false

function getAge(birthDate: Date): number {
const today = new Date()
const age = today.getFullYear() - birthDate.getFullYear()
Expand Down

0 comments on commit c062229

Please sign in to comment.