Skip to content

Commit

Permalink
Made error message for DTEND and DURATION clearer (adamgibbons#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
TalAter authored Jun 13, 2023
1 parent 7ffeddb commit b89c274
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/schema/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const schema = yup.object().shape({
lastModified: dateTimeSchema,
calName: yup.string(),
htmlContent: yup.string()
}).test('xor', `object should have end or duration`, val => {
}).test('xor', `object should have end or duration (but not both)`, val => {
const hasEnd = !!val.end
const hasDuration = !!val.duration
return ((hasEnd && !hasDuration) || (!hasEnd && hasDuration) || (!hasEnd && !hasDuration))
Expand Down

0 comments on commit b89c274

Please sign in to comment.