Skip to content

Commit

Permalink
ofmcc-6116 - update error message for invalid date format
Browse files Browse the repository at this point in the history
  • Loading branch information
vietle-cgi committed Sep 25, 2024
1 parent 7a58527 commit 1c7dbef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/src/utils/rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const rules = {
],
notNullRequired: [(v) => v != null || REQUIRED_MSG], // value must be not null and not undefined
postalCode: [(v) => !v || /^[ABCEGHJ-NPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][ -]?\d[ABCEGHJ-NPRSTV-Z]\d$/i.test(v) || 'A valid postal code is required'],
MMDDYYYY: (v) => (!!v && !isNaN(new Date(v))) || 'Date must be in MM/DD/YYYY format',
MMDDYYYY: (v) => (!!v && !isNaN(new Date(v))) || 'Invalid date format',
validEndDate(startDate) {
return (v) => new Date(v) > new Date(startDate) || 'End date must be after start date'
},
Expand Down

0 comments on commit 1c7dbef

Please sign in to comment.