fix(DatetimePicker): can't change when filter when empty array (#4973)

This commit is contained in:
neverland 2019-11-10 10:58:25 +08:00 committed by GitHub
parent aa0dfe8808
commit e5bcf2409a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,16 +11,16 @@ export function times(n: number, iteratee: (index: number) => any[]) {
return result; return result;
} }
export function getTrueValue(value: string | undefined): number | undefined { export function getTrueValue(value: string | undefined): number {
if (!value) { if (!value) {
return; return 0;
} }
while (isNaN(parseInt(value, 10))) { while (isNaN(parseInt(value, 10))) {
if (value.length > 1) { if (value.length > 1) {
value = value.slice(1); value = value.slice(1);
} else { } else {
return; return 0;
} }
} }