diff --git a/ui/src/components/application/ApplicationForm.vue b/ui/src/components/application/ApplicationForm.vue index 1e0c946..fd56951 100644 --- a/ui/src/components/application/ApplicationForm.vue +++ b/ui/src/components/application/ApplicationForm.vue @@ -110,14 +110,17 @@ watch(() => showCoC.value, async () => { }); function convertToAge(dob: string) { + + if (dob === undefined) return ""; const [month, day, year] = dob.split('/').map(Number); let dobDate = new Date(year, month - 1, day); - return Math.floor( + let out = Math.floor( (Date.now() - dobDate.getTime()) / (1000 * 60 * 60 * 24 * 365.2425) ); + return Number.isNaN(out) ? "" : out; } @@ -132,7 +135,7 @@ function convertToAge(dob: string) {