Don't parse multiple dates
Correct change added in https://github.com/iview/iview/pull/4253
This commit is contained in:
parent
737e9b8d2b
commit
6f8160270d
1 changed files with 1 additions and 1 deletions
|
@ -646,7 +646,6 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onPick(dates, visible = false, type) {
|
onPick(dates, visible = false, type) {
|
||||||
dates = this.parseDate(dates);
|
|
||||||
if (this.multiple){
|
if (this.multiple){
|
||||||
const pickedTimeStamp = dates.getTime();
|
const pickedTimeStamp = dates.getTime();
|
||||||
const indexOfPickedDate = this.internalValue.findIndex(date => date && date.getTime() === pickedTimeStamp);
|
const indexOfPickedDate = this.internalValue.findIndex(date => date && date.getTime() === pickedTimeStamp);
|
||||||
|
@ -654,6 +653,7 @@
|
||||||
const timeStamps = allDates.map(date => date.getTime()).filter((ts, i, arr) => arr.indexOf(ts) === i && i !== indexOfPickedDate); // filter away duplicates
|
const timeStamps = allDates.map(date => date.getTime()).filter((ts, i, arr) => arr.indexOf(ts) === i && i !== indexOfPickedDate); // filter away duplicates
|
||||||
this.internalValue = timeStamps.map(ts => new Date(ts));
|
this.internalValue = timeStamps.map(ts => new Date(ts));
|
||||||
} else {
|
} else {
|
||||||
|
dates = this.parseDate(dates);
|
||||||
this.internalValue = Array.isArray(dates) ? dates : [dates];
|
this.internalValue = Array.isArray(dates) ? dates : [dates];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue