From 84c65eec6dff43eb41bcc6ced98b3f59f2ed4d7f Mon Sep 17 00:00:00 2001 From: xbigcat Date: Thu, 24 Jan 2019 14:35:53 +0800 Subject: [PATCH] Update index.js --- src/utils/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/index.js b/src/utils/index.js index ab240b1e..821392e9 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -13,7 +13,9 @@ export function parseTime(time, cFormat) { } else { if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { time = parseInt(time) - if (time.toString().length === 10) time = time * 1000 + } + if ((typeof time === 'number') && (time.toString().length === 10)) { + time = time * 1000 } date = new Date(time) }