mirror of https://github.com/ElemeFE/element
[DatePicker]: fix #1506 - allow any visible date to be selected in range picker
parent
3d12579652
commit
ec3bb5d3fe
|
@ -366,8 +366,6 @@
|
||||||
|
|
||||||
const newDate = new Date(this.year, this.month, 1);
|
const newDate = new Date(this.year, this.month, 1);
|
||||||
|
|
||||||
const clickNormalCell = className.indexOf('prev') === -1 && className.indexOf('next') === -1;
|
|
||||||
|
|
||||||
if (className.indexOf('prev') !== -1) {
|
if (className.indexOf('prev') !== -1) {
|
||||||
if (month === 0) {
|
if (month === 0) {
|
||||||
year = year - 1;
|
year = year - 1;
|
||||||
|
@ -390,7 +388,7 @@
|
||||||
|
|
||||||
newDate.setDate(parseInt(text, 10));
|
newDate.setDate(parseInt(text, 10));
|
||||||
|
|
||||||
if (clickNormalCell && this.selectionMode === 'range') {
|
if (this.selectionMode === 'range') {
|
||||||
if (this.minDate && this.maxDate) {
|
if (this.minDate && this.maxDate) {
|
||||||
const minDate = new Date(newDate.getTime());
|
const minDate = new Date(newDate.getTime());
|
||||||
const maxDate = null;
|
const maxDate = null;
|
||||||
|
@ -419,9 +417,7 @@
|
||||||
this.rangeState.selecting = true;
|
this.rangeState.selecting = true;
|
||||||
this.markRange(this.minDate);
|
this.markRange(this.minDate);
|
||||||
}
|
}
|
||||||
}
|
} else if (selectionMode === 'day') {
|
||||||
|
|
||||||
if (selectionMode === 'day') {
|
|
||||||
this.$emit('pick', newDate);
|
this.$emit('pick', newDate);
|
||||||
} else if (selectionMode === 'week') {
|
} else if (selectionMode === 'week') {
|
||||||
var weekNumber = getWeekNumber(newDate);
|
var weekNumber = getWeekNumber(newDate);
|
||||||
|
|
Loading…
Reference in New Issue