This turned out to be a version difference in surveyJS.
In our UAT environment (older surveyJS version), using "maxValueExpression": "today()"
does not work on a question with "inputType": "month"
. Any month value triggers the built-in validation error, making the question unanswerable.
In our dev environment (newer surveyJS), the same configuration works as expected. Users can select the current or past month, and selecting future months is blocked.
Resolution
Upgrade to the latest SurveyJS. After upgrading, the configuration below behaves correctly:
{
"pages": [
{
"elements": [
{
"type": "text",
"name": "m",
"title": "Month",
"inputType": "month",
"isRequired": true,
"maxValueExpression": "today()"
}
]
}
]
}
Why others couldn't reproduce
They were testing on newer SurveyJS versions where this issue has already been fixed.