LAB-MI / attestation-deplacement-derogatoire-covid-19

MIT License
28 stars 21 forks source link

Validation of field "Date de sortie" is inconsistent #12

Open ghiss75 opened 3 years ago

ghiss75 commented 3 years ago

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

Note: A pull request fixing this issue has already been proposed: #9

Still, there is another issue as when the form is submitted, the field is validated with following pattern: https://github.com/LAB-MI/attestation-deplacement-derogatoire-covid-19/blob/1fc8aedb67b28759b039cb7ae045d92c87971dbb/src/js/form-util.js#L34-L36

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.

Originally posted by @ghiss75 in https://github.com/LAB-MI/attestation-deplacement-derogatoire-covid-19/issues/2#issuecomment-803293791

usmonster commented 3 years ago

Just to clarify: this last issue is visible only on Safari desktop.

R4F4L3 commented 3 years ago

The regex pattern dont look like a valid datetime ( UTC or whatever GMT ) filter. 2505-05-45 looks like a valid timestamp :>