반응형
//날짜 입력 시 무슨 요일인지 찾아주는 함수
function _fnGetWhatDay(vDate) {

    if (String(vDate).length != 8) {
        return vDate;
    }
    else
    {
        var vformat = String(vDate);
        vformat = vformat.replace(/(\d{4})(\d{2})(\d{2})/, '$1-$2-$3'); 

        var week = ['일', '월', '화', '수', '목', '금', '토'];
        var dayOfWeek = week[new Date(vformat).getDay()];

        return dayOfWeek;
    }    
}

+ Recent posts