Skip to content

Commit

Permalink
BDateTimePicker fixed error for validateConstraint.
Browse files Browse the repository at this point in the history
  • Loading branch information
emirhankudevi committed May 13, 2019
1 parent 775b4b8 commit c96b95a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/components/src/DateTimePicker/DatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,8 @@ class DatePicker extends ComponentBase {

validateConstraint() {
const { dateFormat, timeFormat } = this.props;
let instanceDate;
let instanceTime;
if (dateFormat) instanceDate = this.bActionInputDate.getInstance();
if (timeFormat) instanceTime = this.bActionInputTime.getInstance();
const instanceDate = dateFormat ? this.bActionInputDate.getInstance() : undefined;
const instanceTime = timeFormat ? this.bActionInputTime.getInstance() : undefined;

const dateResult = dateFormat && instanceDate ? instanceDate.validateConstraint() : true;
if (!dateResult) {
Expand Down

0 comments on commit c96b95a

Please sign in to comment.