From d09d7dfff38cf79644b06d9ff1c8e04304c8214f Mon Sep 17 00:00:00 2001 From: Sebastian Pravda Date: Sun, 25 Dec 2022 13:07:31 +0100 Subject: [PATCH] feat: DD.MM.YYYY birthdate format --- .../routes/(candidate)/(authenticated)/register/+page.svelte | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte b/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte index c381c21..97c97f7 100644 --- a/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte +++ b/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte @@ -81,7 +81,7 @@ birthdate: yup .string() .required() - .matches(/^([0-3]?[0-9])\.([1-9]|1[0-2])\.[0-9]{4}$/), + .matches(/^([0-3]?[0-9])\.(0?[1-9]|1[0-2])\.[0-9]{4}$/), sex: yup.string(), address: yup.string().required(), citizenship: yup.string().required(), @@ -250,7 +250,6 @@ if (details !== undefined) { details.candidate.birthdate = details.candidate.birthdate .split('-') - .map((x) => x.startsWith('0') ? x.slice(1) : x) .reverse() .join('.');