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 10, 2019
1 parent 7dcfcfc commit 775b4b8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/components/src/DateTimePicker/DatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,10 @@ class DatePicker extends ComponentBase {

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

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

0 comments on commit 775b4b8

Please sign in to comment.