feat: DD.MM.YYYY birthdate format

This commit is contained in:
Sebastian Pravda 2022-12-25 13:07:31 +01:00
parent 2baafbcd48
commit d09d7dfff3
No known key found for this signature in database
GPG key ID: F3BC84F08EFA3F57

View file

@ -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('.');