How can I compare datetime with jquery

function checkMemberGraduated(month, year){

    var yearNow = new Date().getFullYear();
    var monthNow = new Date().getMonth();
    var dateNow = new Date(yearNow, monthNow, 1);
    var dateGraduated = new Date(year, month - 1, 1);
    if(dateGraduated < dateNow){
        return true;
    }
    return false;

}

Comments

Popular Posts