fix(DatetimePicker): infinite loop when use formatted text is unnumeric (#4485)

This commit is contained in:
neverland
2019-09-18 14:22:04 +08:00
committed by GitHub
parent 2038d135bc
commit 31ceba6c38
2 changed files with 15 additions and 7 deletions
+5 -1
View File
@@ -17,7 +17,11 @@ export function getTrueValue(value: string | undefined): number | undefined {
}
while (isNaN(parseInt(value, 10))) {
value = value.slice(1);
if (value.length > 1) {
value = value.slice(1);
} else {
return;
}
}
return parseInt(value, 10);