function validateDate(date) {
    var pos1 = date.indexOf(“-“);
    var pos2 = date.indexOf(“-“, pos1 + 1);
    if ( pos1 == -1 || pos2 == -1 )
{
        return false;
    }
    var year = date.substr(0, pos1);
    var month = date.substr(0, pos1);
    var day = date.substr(0, pos1);
    if ( month < 1 || month >
12 ) {
        return false;
    }
    if ( day < 1 || day > 31 )
{
        return false;
    }
    if ( (month == 4 || month == 6
|| month == 11) && (day == 31) ) {
        return false;
    }
    if ( month == 2 ) {
        var leap = (year % 4 == 0 && (year %100 澳门新葡亰8455下载app,!= 0 || year % 400 ==
0));
        if (day > 29 || (day ==
29 && !leap)) {
            return false;
        }
    }
    return true;
}

网站地图xml地图