Explorar el Código

获取时间添加默认值

xiaohaizhao hace 2 años
padre
commit
8ba200b849
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      utils/getTime.js

+ 1 - 1
utils/getTime.js

@@ -1,4 +1,4 @@
-const formatTime = (date, j1 = '/', j2 = ':') => {
+const formatTime = (date = new Date(), j1 = '/', j2 = ':') => {
     const year = date.getFullYear()
     const month = date.getMonth() + 1
     const day = date.getDate()