赵士淞
2023-02-08 62676c33ff868ff46b7d34c223546d11e2a2cf3e
eladmin-web-master/src/components/Crud/crud.js
@@ -560,6 +560,20 @@
      }
    },
    /**
     * 月日格式化
     * @param {Object} timestamp 时间戳
     */
    toMonthDay(timestamp) {
      if (timestamp == null) {
        return
      } else {
        const system = new Date(timestamp)
        const month = system.getMonth() + 1 < 10 ? '0' + (system.getMonth() + 1) : system.getMonth() + 1
        const date = system.getDate() < 10 ? '0' + system.getDate() : system.getDate()
        return month + '-' + date
      }
    },
    /**
     * 时间格式化
     * @param {Object} timestamp
     */