Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Date de sortie" cannot be validated by form for 2021 #2

Open
ghiss75 opened this issue Mar 20, 2021 · 1 comment · May be fixed by #9
Open

"Date de sortie" cannot be validated by form for 2021 #2

ghiss75 opened this issue Mar 20, 2021 · 1 comment · May be fixed by #9

Comments

@ghiss75
Copy link

ghiss75 commented Mar 20, 2021

In form-data.json, "pattern" used for "datedesortie" does prohibit years > 2020

"pattern": "^([0][1-9]|[1-2][0-9]|30|31)\/([0][1-9]|10|11|12)\/(19[0-9][0-9]|20[0-1][0-9]|2020)",

Making validation of form at https://media.interieur.gouv.fr/attestation-deplacement-derogatoire-covid-19/ impossible

@ghiss75
Copy link
Author

ghiss75 commented Mar 20, 2021

In fact, the validation pattern of the form for "live feedback" is not conforming to the format of the placeholder:
Screenshot 2021-03-20 at 12 09 47

This pattern is expecting something of the format: 20/03/2021:
Screenshot 2021-03-20 at 12 14 44

that is not working because, the pattern does not support year > 2020
Screenshot 2021-03-20 at 12 15 17

Still, when the form is submitted, the field is validated with following pattern:

'#field-datesortie': {
pattern: /\d{4}-\d{2}-\d{2}/g,
},

that is expecting the same format as the placeholder.

From a user perspective it could be confusing as when entering a date conforming to the placeholder, the "live feedback" will indicate an incorrect input, still the form will be validated when clicking on the generate button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant