diff --git a/packages/semi-foundation/timePicker/utils/index.ts b/packages/semi-foundation/timePicker/utils/index.ts index 5391b67edf..4061e2d006 100644 --- a/packages/semi-foundation/timePicker/utils/index.ts +++ b/packages/semi-foundation/timePicker/utils/index.ts @@ -15,7 +15,7 @@ import { zhCN as defaultLocale } from 'date-fns/locale'; export const parseToDate = (input: string | Date | number, formatToken = strings.DEFAULT_FORMAT, dateFnsLocale = defaultLocale) => { if (input instanceof Date) { return input; - } else if (typeof input === 'number' || !isNaN(Number(input))) { + } else if (typeof input === 'number' || (!isNaN(Number(input)) && input !== '')) { return new Date(toNumber(input)); } else if (typeof input === 'string') { let curDate = new Date();