李志伟 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