export function getDateToString_zhh(date) {
    var year = date.getFullYear();
    var month = date.getMonth() + 1;
    var day = date.getDate();
    var hour = date.getHours();
    var minute = date.getMinutes();
    var second = date.getSeconds();
    return year + "年" + formatDatePara(month) + "月" + formatDatePara(day) + "日 " + formatDatePara(hour) + ":" + formatDatePara(minute);
}


function formatDatePara(str) {
    if (str.toString().length == 1) {
        return "0" + str;
    }
    return str;
}

/**
 验证内容是否为空
 如果为空则返回true
 不为空时返回false
 */
export  function isEmptyCheck(str) {
    if (str === null || str === undefined || str === "") {
        return true;
    }
    if (str.toString().trim().length == 0) {
        return true;
    }
    return false;
}


export  function getFullYear(type){
    let year = new Date().getFullYear();
    let month = new Date().getMonth() + 1;
    if(month < 10){
        month = "0"+month;
    }
    let day = new Date().getDate();
    if(type =="year"){
        return year
    }
    if(type =="month"){
        return year + "-" +month
    }
    if(type =="day"){
        return year + "-" +month+ "-" +day
    }
}