fix: rangePicker validator check failed for prop value is [undefined, undefined]
							parent
							
								
									2a372acf42
								
							
						
					
					
						commit
						c1b353bee1
					
				|  | @ -57,7 +57,7 @@ export const MonthPickerProps = () => ({ | |||
| }) | ||||
| function isMomentArray (value) { | ||||
|   if (Array.isArray(value)) { | ||||
|     return value.length === 0 || !!value.find((val) => val === undefined || moment.isMoment(val)) | ||||
|     return value.length === 0 || value.findIndex((val) => val === undefined || moment.isMoment(val)) !== -1 | ||||
|   } | ||||
|   return false | ||||
| } | ||||
|  |  | |||
|  | @ -22,7 +22,7 @@ export function generateShowHourMinuteSecond (format) { | |||
| } | ||||
| function isMoment (value) { | ||||
|   if (Array.isArray(value)) { | ||||
|     return value.length === 0 || !!value.find((val) => val === undefined || moment.isMoment(val)) | ||||
|     return value.length === 0 || value.findIndex((val) => val === undefined || moment.isMoment(val)) !== -1 | ||||
|   } else { | ||||
|     return value === undefined || moment.isMoment(value) | ||||
|   } | ||||
|  |  | |||
|  | @ -49,7 +49,7 @@ function goDay (direction) { | |||
| 
 | ||||
| function isMoment (value) { | ||||
|   if (Array.isArray(value)) { | ||||
|     return value.length === 0 || !!value.find((val) => val === undefined || moment.isMoment(val)) | ||||
|     return value.length === 0 || value.findIndex((val) => val === undefined || moment.isMoment(val)) !== -1 | ||||
|   } else { | ||||
|     return value === undefined || moment.isMoment(value) | ||||
|   } | ||||
|  |  | |||
|  | @ -11,7 +11,7 @@ import moment from 'moment' | |||
| import { setTimeout } from 'timers' | ||||
| function isMoment (value) { | ||||
|   if (Array.isArray(value)) { | ||||
|     return value.length === 0 || !!value.find((val) => val === undefined || moment.isMoment(val)) | ||||
|     return value.length === 0 || value.findIndex((val) => val === undefined || moment.isMoment(val)) !== -1 | ||||
|   } else { | ||||
|     return value === undefined || moment.isMoment(value) | ||||
|   } | ||||
|  |  | |||
|  | @ -19,7 +19,7 @@ function getNowByCurrentStateValue (value) { | |||
| } | ||||
| function isMoment (value) { | ||||
|   if (Array.isArray(value)) { | ||||
|     return value.length === 0 || !!value.find((val) => val === undefined || moment.isMoment(val)) | ||||
|     return value.length === 0 || value.findIndex((val) => val === undefined || moment.isMoment(val)) !== -1 | ||||
|   } else { | ||||
|     return value === undefined || moment.isMoment(value) | ||||
|   } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 tangjinzhou
						tangjinzhou