You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I needed to validate whether the startDate is before the endDate and whether both dates have the right format:
var dateSchema = new schema({
dateRange: {
type: {
startDate: {
type: Date,
required: true,
validate: [dateFormatValidator, '{VALUE} is not a valid date!']
},
endDate: {
type: Date,
required: true,
validate: [dateFormatValidator, '{VALUE} is not a valid date!']
}
},
required: true,
validate: [dateRangeValidator, 'startDate must be before endDate!']
}
});
The validation of dateRange is executed, but the validation of the startDate and endDate format isn't. Is this a bug?
The text was updated successfully, but these errors were encountered:
I needed to validate whether the startDate is before the endDate and whether both dates have the right format:
The validation of dateRange is executed, but the validation of the startDate and endDate format isn't. Is this a bug?
The text was updated successfully, but these errors were encountered: