function maxDate(month, year) {
        var res = 31;
        if(month != null) {
            if(month == 4 || month == 6 || month == 9 || month == 11) {
                res = 30;
            }
            if(year != null && month == 2) {
                res = (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)? 29 : 28;
            }
        }
        return res;
    }
// Define fuction for getting the maximum date for a month.
Define fuction for getting the maximum date for a month.
Define fuction for getting the maximum date for a month .
function maxDate(month, year) {
        var res = 31;
        if(month != null) {
            if(month == 4 || month == 6 || month == 9 || month == 11) {
                res = 30;
            }
            if(year != null && month == 2) {
                res = (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)? 29 : 28;
            }
        }
        return res;
    }
function maxDate ( month , year ) { var res = 31 ; if ( month != null ) { if ( month == 4 || month == 6 || month == 9 || month == 11 ) { res = 30 ; } if ( year != null && month == 2 ) { res = ( year % 4 == 0 && year % 100 != 0 ) || ( year % 400 == 0 ) ? 29 : 28 ; } } return res ; }
Define fuction for getting the maximum date for a month.
Define fuction for getting the maximum date for a month .