您好我会喜欢到比较newDate()字符串例如15/01/2017
比较字符串DD/MM/YYYY用的currentdate格式JS
var dates = jQuery('tr.Entries').find('td.event-date > a').map(function() { //event date format is e.g 15/01/2017
return jQuery(this).text();
}).get();
var currentDate = new Date();
jQuery.each(dates, function (index, value) {
console.log(value);
//var parts = value.split('/');
//var mydate = new Date(parts[2],parts[0]-1,parts[1]);
//console.log("mydate is: "+mydate);
if(value < currentDate){
//do something
}
});
你的问题还不清楚。你想达到什么目的?当前代码有什么问题? – Rajesh
[与javascript中的今天日期比较字符串]可能的重复(https://stackoverflow.com/questions/15063670/compare-string-with-todays-date-in-javascript) – Pete