var start = $('#StartDate').val(); var end = $('#EndDate').val(); if (end.length>0 && start.length>0) { if (Date.parse(start.replace(/-/g, '/')) > Date.parse(end.replace(/-/g, '/'))) { alert("起始日期不能大于截止日期!"); return false; } }
转载于:https://www.cnblogs.com/samsonhuang/articles/2570205.html