Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions packages/date-picker/src/panel/date-range.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
@input.native="handleDateInput($event, 'min')"
@change.native="handleDateChange($event, 'min')" />
</span>
<span class="el-date-range-picker__time-picker-wrap" v-clickoutside="() => minTimePickerVisible = false">
<span class="el-date-range-picker__time-picker-wrap" v-clickoutside="handleMinTimeClose">
<el-input
size="small"
:disabled="rangeState.selecting"
Expand Down Expand Up @@ -62,7 +62,7 @@
@input.native="handleDateInput($event, 'max')"
@change.native="handleDateChange($event, 'max')" />
</span>
<span class="el-date-range-picker__time-picker-wrap" v-clickoutside="() => maxTimePickerVisible = false">
<span class="el-date-range-picker__time-picker-wrap" v-clickoutside="handleMaxTimeClose">
<el-input
size="small"
:disabled="rangeState.selecting"
Expand Down Expand Up @@ -539,6 +539,10 @@
}
},

handleMinTimeClose() {
this.minTimePickerVisible = false;
},

handleMaxTimePick(value, visible, first) {
if (this.maxDate && value) {
this.maxDate = modifyTime(this.maxDate, value.getHours(), value.getMinutes(), value.getSeconds());
Expand All @@ -553,6 +557,10 @@
}
},

handleMaxTimeClose() {
this.maxTimePickerVisible = false;
},

// leftPrev*, rightNext* need to take care of `unlinkPanels`
leftPrevYear() {
this.leftDate = prevYear(this.leftDate);
Expand Down
6 changes: 5 additions & 1 deletion packages/date-picker/src/panel/date.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
@input="val => userInputDate = val"
@change="handleVisibleDateChange" />
</span>
<span class="el-date-picker__editor-wrap" v-clickoutside="() => timePickerVisible = false">
<span class="el-date-picker__editor-wrap" v-clickoutside="handleTimePickClose">
<el-input
ref="input"
@focus="timePickerVisible = true"
Expand Down Expand Up @@ -317,6 +317,10 @@
}
},

handleTimePickClose() {
this.timePickerVisible = false;
},

handleMonthPick(month) {
if (this.selectionMode === 'month') {
this.date = modifyDate(this.date, this.year, month, 1);
Expand Down