Don't parse multiple dates

Correct change added in https://github.com/iview/iview/pull/4253
This commit is contained in:
SergioCrisostomo 2018-08-10 14:58:31 +02:00
parent 737e9b8d2b
commit 6f8160270d

View file

@ -646,7 +646,6 @@
}
},
onPick(dates, visible = false, type) {
dates = this.parseDate(dates);
if (this.multiple){
const pickedTimeStamp = dates.getTime();
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
this.internalValue = timeStamps.map(ts => new Date(ts));
} else {
dates = this.parseDate(dates);
this.internalValue = Array.isArray(dates) ? dates : [dates];
}