/** * Format the date *@param {*} The value date * /
    function formatDate(value) {
        if(! value)return ' ';
        const date = new Date(value);
        const year = date.getFullYear();
        let month = date.getMonth() + 1;
        let day = date.getDate();
        let hour = date.getHours();
        let min = date.getMinutes();
        month = month < 10 ? ` 0${month}` : month;
        day = day < 10 ? ` 0${day}` : day;
        hour = hour < 10 ? ` 0${hour}` : hour;
        min = min < 10 ? ` 0${min}` : min;
        return `${year}-${month}-${day} ${hour}:${min}`;
    }
Copy the code