Skip to main content

betaThis is a new capability. Help us improve it and give your feedback on Slack.

Month Year Field

Two inputs (month, year) for collecting partial dates.

Preview

When did this start?
For example, 3 2025

JSON definition

{
"type": "MonthYearField",
"name": "fieldName",
"title": "Question title",
"errorDescription": "",
"hint": "",
"shortDescription": "",
"options": {}
}

Properties

PropertyTypeRequiredDescription
errorDescriptionstringNo
hintstringNoHint text displayed below the field label to help the user answer the question.
shortDescriptionstringNoA short description of the field used in the check-your-answers summary.

Options

PropertyTypeRequiredDescription
classesstringNoAdditional CSS classes applied to the component.
customValidationMessagestringNoA single custom message shown for any validation error on this field.
customValidationMessagesobjectNoA map of Joi error codes to custom error messages.
earliestMonthYearstringNo
instructionTextstringNoAlternative text read by screen readers in place of the field title.
latestMonthYearstringNo
optionalTextbooleanNoWhen true, appends '(optional)' to the field label.
requiredbooleanNoWhether the field must be filled in. Defaults to true.