仅比较日期部分,而不比较JavaScript中的时间
window.addEvent('domready', function() { var now = new Date(); var input = $('datum').getValue(); var dateArray = input.split('/'); var userMonth = parseInt(dateArray[1])-1; var userDate = new Date(); userDate.setFullYear(dateArray[2], userMonth, dateArray[0], now.getHours(), now.getMinutes(), now.getSeconds(), now.getMilliseconds()); if (userDate > now) { alert(now + '\n' + userDate); }});
阿波罗的战车
相关分类