Expand my Community achievements bar.

Basic Date validation in Lib guidedateinput field component - best practice

Avatar

Level 4

We are using the guidedateinput component in a lot of our forms and we are looking for best practices to provide the basic date validation (ie Is it a valid date) It is looking like out of the box there is no validation in that it allows the 31st February to be entered. We do not want or expect the form editor to create a rule for every date field they use, so is there a way to attach the validation at the component level so that it validates before passing onto the rules editor to allow further checks (eg the date is this year)

 

IainClucas_0-1683537999028.png

 

1 Reply

Avatar

Level 4

Debugging in the guideRuntime shows that the _parseDate is logging an invalid date, but this appears not to be handled anywhere. Is there something else that I would need to to to handle this and output an error message?

 

IainClucas_0-1683636461038.png