Skip to content

Commit

Permalink
fix: age probleme when 130 into demographic and encounter form
Browse files Browse the repository at this point in the history
  • Loading branch information
Mehdi-BOUYAHIA committed Sep 24, 2024
1 parent ba4f9f6 commit 2d7f6f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/age.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export const convertStringToDuration = (age: string | null | undefined): Duratio

export const convertDurationToString = (ageDate: DurationType): string | null => {
if (ageDate.year === null && ageDate.month === null && ageDate.day === null) return null
if ((ageDate.year === 130 || ageDate.year === 0) && !ageDate.month && !ageDate.day) return null
if (ageDate.year === 0 && !ageDate.month && !ageDate.day) return null
return `${ageDate.day || 0}/${ageDate.month || 0}/${ageDate.year || 0}`
}

Expand Down

0 comments on commit 2d7f6f4

Please sign in to comment.