李志伟 3 年之前
父節點
當前提交
2ae1757a0c
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4
    2
      src/util/formattingData.js

+ 4
- 2
src/util/formattingData.js 查看文件

@@ -3,11 +3,13 @@
3 3
 
4 4
 // 日期格式化
5 5
 export function parseTime (time, pattern) {
6
-  let aTime = time
6
+  let aTime
7
+  if (time) {
8
+    aTime = time
7 9
     .toLocaleString()
8 10
     .replace(/T/g, ' ')
9 11
     .replace(/\.[\d]{3}Z/, '')
10
-
12
+  }
11 13
 
12 14
   if (arguments.length === 0 || !aTime) {
13 15
     return null