diff --git a/packages/date-picker/src/panel/date-range.vue b/packages/date-picker/src/panel/date-range.vue
index 3889954e4..9c9a7f4d1 100644
--- a/packages/date-picker/src/panel/date-range.vue
+++ b/packages/date-picker/src/panel/date-range.vue
@@ -24,7 +24,7 @@
@@ -32,7 +32,7 @@
@@ -61,7 +61,7 @@
ref="rightInput"
placeholder="结束时间"
class="el-date-range-picker__editor"
- v-model.lazy="rightVisibleTime"
+ :value="rightVisibleTime"
@focus="minDate && (rightTimePickerVisible = !rightTimePickerVisible)"
:readonly="!minDate"
@change="handleTimeChange($event, 'max')" />
@@ -177,7 +177,7 @@
},
rightVisibleDate() {
- return formatDate(this.maxDate);
+ return formatDate(this.maxDate || this.minDate);
},
leftVisibleTime() {
@@ -188,60 +188,6 @@
return formatDate(this.maxDate, 'HH:mm:ss');
},
- leftHours: {
- get() {
- return this.date.getHours();
- },
- set(hours) {
- this.date.setHours(hours);
- }
- },
-
- leftMinutes: {
- get() {
- return this.date.getMinutes();
- },
- set(minutes) {
- this.date.setMinutes(minutes);
- }
- },
-
- leftSeconds: {
- get() {
- return this.date.getSeconds();
- },
- set(seconds) {
- this.date.setSeconds(seconds);
- }
- },
-
- rightHours: {
- get() {
- return this.rightDate.getHours();
- },
- set(hours) {
- this.rightDate.setHours(hours);
- }
- },
-
- rightMinutes: {
- get() {
- return this.rightDate.getMinutes();
- },
- set(minutes) {
- this.rightDate.setMinutes(minutes);
- }
- },
-
- rightSeconds: {
- get() {
- return this.rightDate.getSeconds();
- },
- set(seconds) {
- this.rightDate.setSeconds(seconds);
- }
- },
-
rightDate() {
const newDate = new Date(this.date);
const month = newDate.getMonth();
@@ -396,6 +342,10 @@
this.maxDate = new Date(target.getTime());
}
}
+ const l2r = type === 'min' ? 'left' : 'right';
+
+ this.$refs[l2r + 'timepicker'].value = target;
+ this[l2r + 'TimePickerVisible'] = false;
}
},
diff --git a/packages/date-picker/src/panel/date.vue b/packages/date-picker/src/panel/date.vue
index 8a216269f..13f3e3b8f 100644
--- a/packages/date-picker/src/panel/date.vue
+++ b/packages/date-picker/src/panel/date.vue
@@ -111,7 +111,7 @@
{{ $t('datepicker.now') }}
+ @click="changeToNow">{{ $t('datepicker.now') }}