Skip to content

Commit

Permalink
Set a character limit for date fields (#289)
Browse files Browse the repository at this point in the history
Co-authored-by: Pavilion Sahota <pavilion.sahota@justice.gov.uk>
Co-authored-by: carloveo-moj <144013256+carloveo-moj@users.noreply.github.com>
  • Loading branch information
3 people authored Apr 9, 2024
1 parent 11953ed commit 4084d57
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,19 @@ export const dateItems = (year: string, month: string, day: string, prefix: stri
name: `day`,
classes: `govuk-input--width-2${fieldHasErrors(errors, `${prefix}-day`) ? ' govuk-input--error' : ''}`,
value: day,
attributes: { maxLength: 2 },
},
{
name: `month`,
classes: `govuk-input--width-2${fieldHasErrors(errors, `${prefix}-month`) ? ' govuk-input--error' : ''}`,
value: month,
attributes: { maxLength: 2 },
},
{
name: `year`,
classes: `govuk-input--width-4${fieldHasErrors(errors, `${prefix}-year`) ? ' govuk-input--error' : ''}`,
value: year,
attributes: { maxLength: 4 },
},
]
}
Expand Down

0 comments on commit 4084d57

Please sign in to comment.