Skip to content

fix(form): correct misleading validation messages for date/time bounds#1894

Open
chintankavathia wants to merge 1 commit intomainfrom
fix/datepicker/validation/messages
Open

fix(form): correct misleading validation messages for date/time bounds#1894
chintankavathia wants to merge 1 commit intomainfrom
fix/datepicker/validation/messages

Conversation

@chintankavathia
Copy link
Copy Markdown
Member

@chintankavathia chintankavathia commented Apr 17, 2026

The min/max validation messages implied exclusive bounds (e.g. "Date after 12/03/2025") when the validation is actually inclusive. This caused confusion as the boundary value itself is valid but the message suggested otherwise.

Changed wording from "after"/"prior to" to "on or after"/"on or before" for minDate, maxDate, minTime, maxTime, rangeBeforeMinDate, and rangeAfterMaxDate error messages.


Documentation.
Examples.
Dashboards Demo.
Playwright report.

Coverage Reports:

Code Coverage

The min/max validation messages implied exclusive bounds (e.g. "Date after
12/03/2025") when the validation is actually inclusive. This caused confusion
as the boundary value itself is valid but the message suggested otherwise.

Changed wording from "after"/"prior to" to "on or after"/"on or before"
for minDate, maxDate, minTime, maxTime, rangeBeforeMinDate, and
rangeAfterMaxDate error messages.
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates validation error messages for date and time ranges to clarify that boundary values are inclusive. Feedback was provided to further refine these messages by removing the word "required" to adhere to UX writing guidelines regarding conciseness and the use of telegram style for interactive UI elements.

Comment on lines 49 to 68
maxDate: t(
() => $localize`:@@SI_FORM_CONTAINER.ERROR.MAX_DATE:Date prior to {{maxString}} required`
() => $localize`:@@SI_FORM_CONTAINER.ERROR.MAX_DATE:Date on or before {{maxString}} required`
),
minDate: t(
() => $localize`:@@SI_FORM_CONTAINER.ERROR.MIN_DATE:Date after {{minString}} required`
() => $localize`:@@SI_FORM_CONTAINER.ERROR.MIN_DATE:Date on or after {{minString}} required`
),
maxTime: t(
() => $localize`:@@SI_FORM_CONTAINER.ERROR.MAX_TIME:Time prior to {{maxString}} required`
() => $localize`:@@SI_FORM_CONTAINER.ERROR.MAX_TIME:Time on or before {{maxString}} required`
),
minTime: t(
() => $localize`:@@SI_FORM_CONTAINER.ERROR.MIN_TIME:Time after {{minString}} required`
() => $localize`:@@SI_FORM_CONTAINER.ERROR.MIN_TIME:Time on or after {{minString}} required`
),
rangeAfterMaxDate: t(
() =>
$localize`:@@SI_FORM_CONTAINER.ERROR.RANGE_AFTER_MAX_DATE:Period prior to {{maxString}} required`
$localize`:@@SI_FORM_CONTAINER.ERROR.RANGE_AFTER_MAX_DATE:Period on or before {{maxString}} required`
),
rangeBeforeMinDate: t(
() =>
$localize`:@@SI_FORM_CONTAINER.ERROR.RANGE_BEFORE_MIN_DATE:Period after {{minString}} required`
$localize`:@@SI_FORM_CONTAINER.ERROR.RANGE_BEFORE_MIN_DATE:Period on or after {{minString}} required`
),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

According to the UX writing guidelines, validation messages should use telegram style and be as concise as possible. The word "required" at the end of these messages makes them full sentences and is superfluous, as the context of a validation error already implies the requirement. Removing it also improves consistency with other validators in this file (like max and maxlength) which do not use "required" at the end.

Suggested change
maxDate: t(
() => $localize`:@@SI_FORM_CONTAINER.ERROR.MAX_DATE:Date prior to {{maxString}} required`
() => $localize`:@@SI_FORM_CONTAINER.ERROR.MAX_DATE:Date on or before {{maxString}} required`
),
minDate: t(
() => $localize`:@@SI_FORM_CONTAINER.ERROR.MIN_DATE:Date after {{minString}} required`
() => $localize`:@@SI_FORM_CONTAINER.ERROR.MIN_DATE:Date on or after {{minString}} required`
),
maxTime: t(
() => $localize`:@@SI_FORM_CONTAINER.ERROR.MAX_TIME:Time prior to {{maxString}} required`
() => $localize`:@@SI_FORM_CONTAINER.ERROR.MAX_TIME:Time on or before {{maxString}} required`
),
minTime: t(
() => $localize`:@@SI_FORM_CONTAINER.ERROR.MIN_TIME:Time after {{minString}} required`
() => $localize`:@@SI_FORM_CONTAINER.ERROR.MIN_TIME:Time on or after {{minString}} required`
),
rangeAfterMaxDate: t(
() =>
$localize`:@@SI_FORM_CONTAINER.ERROR.RANGE_AFTER_MAX_DATE:Period prior to {{maxString}} required`
$localize`:@@SI_FORM_CONTAINER.ERROR.RANGE_AFTER_MAX_DATE:Period on or before {{maxString}} required`
),
rangeBeforeMinDate: t(
() =>
$localize`:@@SI_FORM_CONTAINER.ERROR.RANGE_BEFORE_MIN_DATE:Period after {{minString}} required`
$localize`:@@SI_FORM_CONTAINER.ERROR.RANGE_BEFORE_MIN_DATE:Period on or after {{minString}} required`
),
maxDate: t(
() => $localize`:@@SI_FORM_CONTAINER.ERROR.MAX_DATE:Date on or before {{maxString}}`
),
minDate: t(
() => $localize`:@@SI_FORM_CONTAINER.ERROR.MIN_DATE:Date on or after {{minString}}`
),
maxTime: t(
() => $localize`:@@SI_FORM_CONTAINER.ERROR.MAX_TIME:Time on or before {{maxString}}`
),
minTime: t(
() => $localize`:@@SI_FORM_CONTAINER.ERROR.MIN_TIME:Time on or after {{minString}}`
),
rangeAfterMaxDate: t(
() =>
$localize`:@@SI_FORM_CONTAINER.ERROR.RANGE_AFTER_MAX_DATE:Period on or before {{maxString}}`
),
rangeBeforeMinDate: t(
() =>
$localize`:@@SI_FORM_CONTAINER.ERROR.RANGE_BEFORE_MIN_DATE:Period on or after {{minString}}`
),
References
  1. Use as few words as possible. (link)
  2. Avoid full sentences on interactive UI pages — use telegram style without a trailing full stop. (link)

@chintankavathia chintankavathia marked this pull request as ready for review April 17, 2026 12:17
@chintankavathia chintankavathia requested review from a team as code owners April 17, 2026 12:17
@spliffone
Copy link
Copy Markdown
Member

@chintankavathia The wording for the validation is aligned with UX, see #1373

@chintankavathia chintankavathia added the core-team-discussion Topics that should be discussed in the core team meeting label Apr 20, 2026
@chintankavathia
Copy link
Copy Markdown
Member Author

@chintankavathia The wording for the validation is aligned with UX, see #1373

How does it make sense to say "Date after 20/04/2026 is required" when minDate is 20/04/2026
Isn't that mean user can choose 21/04/2026 and not 20/04/2026 as per the message.

@spliffone
Copy link
Copy Markdown
Member

@chintankavathia The wording for the validation is aligned with UX, see #1373

How does it make sense to say "Date after 20/04/2026 is required" when minDate is 20/04/2026 Isn't that mean user can choose 21/04/2026 and not 20/04/2026 as per the message.

@Danisand can you please share your UX expertise?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core-team-discussion Topics that should be discussed in the core team meeting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants