Skip to content

Commit

Permalink
Validate content for non-required fields
Browse files Browse the repository at this point in the history
  • Loading branch information
romanblanco committed Sep 16, 2019
1 parent 8811c76 commit 366f4c7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/dialog-user/services/dialogData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,14 @@ export default class DialogDataService {
}
}
}
} else {
if (field.type === 'DialogFieldDateControl' ||
field.type === 'DialogFieldDateTimeControl') {
if (!(_.isDate(value) || value === null)) {
// if value === undefined, a sting has been entered
fail(__('Select a valid date'));
}
}
}

// Run check if someone has specified a regex. Make sure if its required it is not blank
Expand Down

0 comments on commit 366f4c7

Please sign in to comment.