Overview
The date field in Advanced Search allows users to enter years with more than four digits, which results in an unsupported search query.
Steps to reproduce
-
Search for
discourseon Meta using Chrome. -
Expand Advanced filters.
-
Under Posted, select
before. -
Enter November 12, 2026.
-
Replace the year
2026with202666and press Tab. -
Click Search.
Expected results
The year should be limited to four digits, or a validation message should be displayed.
Observed results
The date field accepts the six-digit year and submits discourse before:202666-11-12 without any validation message.
Additional context
The native date input has no max restriction, while the search backend expects a four-digit year.
A fix is already in review: FIX: Cap the year in native date inputs at four digits - Pull Request #47255 - discourse/discourse - GitHub
