You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Design System's guidance for Date Inputs has a subsection about error messages. This contains the following recommendations (abridged slightly):
If you’re highlighting just one field - either the day, month or year - only style the field that has an error. The error message must say which field has an error
If nothing is entered: Highlight the date input as a whole. If the date is incomplete: Highlight the day, month or year field where the information is missing or incomplete. If more than one field is missing information, highlight the fields the user needs to fill in. If the date entered cannot be correct: For example, ‘13’ in the month field cannot be correct. Highlight the day, month or year field with the incorrect information. Or highlight the date as a whole if there’s incorrect information in more than one field, or it’s not clear which field is incorrect. If the date is in the future when it needs to be in the past: Highlight the date input as a whole. If the date is in the future when it needs to be today or in the past: Highlight the date input as a whole. If the date is in the past when it needs to be in the future: Highlight the date input as a whole. If the date is in the past when it needs to be today or in the future: Highlight the date input as a whole. If the date must be the same as or after another date: Highlight the date input as a whole. If the date must be after another date: Highlight the date input as a whole. If the date must be the same as or before another date: Highlight the date input as a whole. If the date must be before another date: Highlight the date input as a whole. If the date must be between two dates: Highlight the date input as a whole.
Is there a known/recommended way to highlight a single date field that's in error? As far as I can tell there's no easy way of doing this with the gem's date input component.
The text was updated successfully, but these errors were encountered:
There isn't because the field is bound to a date object which as far as Ruby is concerned is either valid or invalid.
I've been thinking about the best way of checking it, as have others, but taking on the role of actually validating the dates goes beyond the scope of this library.
It might be the case that the builder will display a certain format of errors but the building of them is the responsibility of the app - or via a separate gem.
I'm definitely open to collaborating on a nice, reusable solution for this. cc @felixclack
The Design System's guidance for Date Inputs has a subsection about error messages. This contains the following recommendations (abridged slightly):
Is there a known/recommended way to highlight a single date field that's in error? As far as I can tell there's no easy way of doing this with the gem's date input component.
The text was updated successfully, but these errors were encountered: