function $number(num) {
    return num.toFixed(0).replace(/(\d)(?=(\d{3})+$)/g, "$1,");
}

function numberMaxLength(e){
    if(e.value.length > e.maxLength){
        e.value = e.value.slice(0, e.maxLength);
    }
}

function isPhoneNumber(_mNumber) {
    var mNumber = _mNumber && _mNumber.split('-').join('');
    var regPhone = /^((01[1|6|7|8|9])[1-9]+[0-9]{6,7})|(010[1-9][0-9]{7})$/;
    return regPhone.test(mNumber);
}

$(".numberOnly").on('keyup', function () {
    var _this = $(this);
    _this.val(_this.val().replace(/[^0-9]/g,""));
});

function dateCheck(obj) {
    if( !obj.start || !obj.end ) {
        // 12자리 맞춤 년월일시
        console.log( '시작일 혹은 종료일 누락: ', obj.start, " / ", obj.end);
        return false;
    }

    var startdate = obj.start,
        enddate = obj.end;

    var now = new Date();
    var year = now.getFullYear().toString(),
        month = parseInt(now.getMonth()+1).toString(),
        date = now.getDate().toString(),
        hour = now.getHours().toString(),
        min = now.getMinutes().toString(),
        sec = now.getSeconds().toString(),
        today;

    month = month.length < 2 ? "0"+month : month;
    date = date.length < 2 ? "0"+date : date;
    hour = hour.length < 2 ? "0"+hour : hour;
    min = min.length < 2 ? "0"+min : min;
    sec = sec.length < 2 ? "0"+sec : sec;
    today = year + month + date + hour + min + sec;

    return (eval(today) >= eval(startdate)) && ((eval(today) <= eval(enddate)))
}