Commit b990d2f4134dc2b425d63f705dec0c5ee4f304c2
1 parent
34867ff9
move logic to inside the correct if clause
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
src/components/date-picker/panel/Date/date-range.vue
... | ... | @@ -312,11 +312,11 @@ |
312 | 312 | }, |
313 | 313 | handleRangePick (val) { |
314 | 314 | if (this.rangeState.selecting || this.currentView === 'time'){ |
315 | - const [minDate, maxDate] = [this.rangeState.from, val].sort(dateSorter); | |
316 | - this.dates = [minDate, maxDate]; | |
317 | 315 | if (this.currentView === 'time'){ |
318 | 316 | this.dates = val; |
319 | 317 | } else { |
318 | + const [minDate, maxDate] = [this.rangeState.from, val].sort(dateSorter); | |
319 | + this.dates = [minDate, maxDate]; | |
320 | 320 | this.rangeState = { |
321 | 321 | from: minDate, |
322 | 322 | to: maxDate, | ... | ... |