move logic to inside the correct if clause

This commit is contained in:
Sergio Crisostomo 2018-02-02 11:21:37 +01:00
parent 34867ff9a9
commit b990d2f413

View file

@ -312,11 +312,11 @@
},
handleRangePick (val) {
if (this.rangeState.selecting || this.currentView === 'time'){
const [minDate, maxDate] = [this.rangeState.from, val].sort(dateSorter);
this.dates = [minDate, maxDate];
if (this.currentView === 'time'){
this.dates = val;
} else {
const [minDate, maxDate] = [this.rangeState.from, val].sort(dateSorter);
this.dates = [minDate, maxDate];
this.rangeState = {
from: minDate,
to: maxDate,