diff --git a/src/utils/index.js b/src/utils/index.js index 0445827b..821392e9 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -11,7 +11,12 @@ export function parseTime(time, cFormat) { if (typeof time === 'object') { date = time } else { - if (('' + time).length === 10) time = parseInt(time) * 1000 + if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { + time = parseInt(time) + } + if ((typeof time === 'number') && (time.toString().length === 10)) { + time = time * 1000 + } date = new Date(time) } const formatObj = {