/**
 * 获取当前周
 */
export function timeFormate(timeStamp) { //显示当前时间
    let newDate = new Date(timeStamp);
    let year = newDate.getFullYear();
    let month = newDate.getMonth() + 1 < 10 ? '0' + (newDate.getMonth() + 1) : newDate.getMonth() + 1;
    let date = newDate.getDate();
    let week = newDate.getDay();
    let getWeek = Math.ceil((date + 6 - week) / 7)

    return year + '年' + month + '月第' + getWeek + '周'
}

export function timeFormateMonth(timeStamp) { //显示当前时间
    let newDate = new Date(timeStamp);
    let year = newDate.getFullYear();
    let month = newDate.getMonth() + 1 < 10 ? '0' + (newDate.getMonth() + 1) : newDate.getMonth() + 1;
    let date = newDate.getDate();
    let week = newDate.getDay();
    let getWeek = Math.ceil((date + 6 - week) / 7)

    return year + '年' + month + '月'
}

export function timeFormateWeek(timeStamp) {
    let newDate = new Date(timeStamp);
    let year = newDate.getFullYear();
    var d1 = new Date(timeStamp);
    var d2 = new Date(timeStamp);
    d2.setMonth( 0 );
    d2.setDate( 1 );
    var rq = d1 - d2;
    var s1 = Math.ceil(rq / ( 24 * 60 * 60 * 1000 ));
    var s2 = Math.ceil(s1 / 7 );
    return year + '年第' + s2 + '周'
}