DatePicker: fix bug of only select min date of date range problem (#17191) (#17207)

pull/17283/head
Kerwin Ch 2019-09-02 10:58:03 +08:00 committed by hetech
parent b9eacfeb9b
commit 3f7d98b629
1 changed files with 1 additions and 0 deletions

View File

@ -669,6 +669,7 @@
// NOTE: this is a hack to reset {min, max}Date on picker open. // NOTE: this is a hack to reset {min, max}Date on picker open.
// TODO: correct way of doing so is to refactor {min, max}Date to be dependent on value and internal selection state // TODO: correct way of doing so is to refactor {min, max}Date to be dependent on value and internal selection state
// an alternative would be resetView whenever picker becomes visible, should also investigate date-panel's resetView // an alternative would be resetView whenever picker becomes visible, should also investigate date-panel's resetView
if (this.minDate && this.maxDate == null) this.rangeState.selecting = false;
this.minDate = this.value && isDate(this.value[0]) ? new Date(this.value[0]) : null; this.minDate = this.value && isDate(this.value[0]) ? new Date(this.value[0]) : null;
this.maxDate = this.value && isDate(this.value[0]) ? new Date(this.value[1]) : null; this.maxDate = this.value && isDate(this.value[0]) ? new Date(this.value[1]) : null;
} }