mirror of
https://github.com/ElemeFE/element.git
synced 2025-12-16 11:44:01 +08:00
@@ -188,6 +188,7 @@
|
||||
},
|
||||
|
||||
value(val) {
|
||||
if (this.selectionMode === 'dates' && this.value) return;
|
||||
if (isDate(val)) {
|
||||
this.date = new Date(val);
|
||||
} else {
|
||||
|
||||
@@ -28,6 +28,7 @@ export const toDate = function(date) {
|
||||
export const isDate = function(date) {
|
||||
if (date === null || date === undefined) return false;
|
||||
if (isNaN(new Date(date).getTime())) return false;
|
||||
if (Array.isArray(date)) return false; // deal with `new Date([ new Date() ]) -> new Date()`
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user